diff --git a/.azurepipelines/artifacts-linux-test.yml b/.azurepipelines/artifacts-linux-test.yml deleted file mode 100644 index b550d1614a..0000000000 --- a/.azurepipelines/artifacts-linux-test.yml +++ /dev/null @@ -1,13 +0,0 @@ -jobs: -- ${{ each distro in parameters.distros }}: - - ${{ each dotnetVersion in parameters.dotnetVersions }}: - - job: - displayName: 'Artifacts Test ${{ distro }} ${{ dotnetVersion }} (${{ parameters.name }})' - pool: - vmImage: ${{ parameters.vmImage }} - steps: - - template: common-steps.yml - parameters: - includeArtifacts: true - - pwsh: ./build.ps1 -target Artifacts-Test -DockerDistro ${{ distro }} -DockerDotnetVersion ${{ dotnetVersion }} - displayName: '[Docker Test Artifacts ${{ distro }}_${{ dotnetVersion }}]' diff --git a/.azurepipelines/artifacts-windows-test.yml b/.azurepipelines/artifacts-windows-test.yml deleted file mode 100644 index 6c34d196f2..0000000000 --- a/.azurepipelines/artifacts-windows-test.yml +++ /dev/null @@ -1,31 +0,0 @@ -jobs: -- job: Artifacts_Test_MsBuild - displayName: Artifacts Test MsBuild (Windows) - pool: - vmImage: windows-latest - steps: - - template: common-steps.yml - parameters: - includeArtifacts: true - - pwsh: ./build.ps1 -target Artifacts-MsBuildFull-Test - displayName: '[MsBuild Test Artifacts]' -- job: Artifacts_Test_Commandline - displayName: Artifacts Test Commandline (Windows) - pool: - vmImage: windows-latest - steps: - - template: common-steps.yml - parameters: - includeArtifacts: true - - pwsh: ./build.ps1 -target Artifacts-Commandline-Test - displayName: '[Commandline Test Artifacts]' -- job: Artifacts_Test_Portable - displayName: Artifacts Test Portable (Windows) - pool: - vmImage: windows-latest - steps: - - template: common-steps.yml - parameters: - includeArtifacts: true - - pwsh: ./build.ps1 -target Artifacts-Portable-Test - displayName: '[Portable Test Artifacts]' \ No newline at end of file diff --git a/.azurepipelines/build.yml b/.azurepipelines/build.yml deleted file mode 100644 index 0e350faad6..0000000000 --- a/.azurepipelines/build.yml +++ /dev/null @@ -1,11 +0,0 @@ -steps: -- template: common-steps.yml -- pwsh: ./build.ps1 -target Pack - displayName: '[Cake build & pack]' -- publish: $(System.DefaultWorkingDirectory)/artifacts - displayName: 'Upload artifacts folder' - condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' )) - artifact: storage -- publish: $(System.DefaultWorkingDirectory)/artifacts/native - displayName: 'Upload native folder' - artifact: storage-$(VM_IMAGE) diff --git a/.azurepipelines/common-steps.yml b/.azurepipelines/common-steps.yml deleted file mode 100644 index 7734b3f14e..0000000000 --- a/.azurepipelines/common-steps.yml +++ /dev/null @@ -1,23 +0,0 @@ -parameters: -- name: includeArtifacts - type: boolean - default: false - -steps: -- task: Cache@2 - inputs: - key: 'v1-tools | "$(Agent.OS)" | build.cake' - path: tools - displayName: Cache Cake tools -- task: Cache@2 - inputs: - key: 'v1-dotnet | "$(Agent.OS)" | build/build.config' - path: .dotnet - displayName: Cache dotnet locally -- ${{ if eq(parameters.includeArtifacts, true) }}: - - task: DownloadPipelineArtifact@2 - displayName: 'Download artifacts folder' - inputs: - source: current - path: $(Build.SourcesDirectory)/artifacts - artifact: storage diff --git a/.azurepipelines/docker.yml b/.azurepipelines/docker.yml deleted file mode 100644 index 2447ee3fdf..0000000000 --- a/.azurepipelines/docker.yml +++ /dev/null @@ -1,17 +0,0 @@ -jobs: -- ${{ each distro in parameters.distros }}: - - ${{ each dotnetVersion in parameters.dotnetVersions }}: - - job: - displayName: 'Docker ${{ distro }} ${{ dotnetVersion }} (${{ parameters.name }})' - pool: - vmImage: ${{ parameters.vmImage }} - steps: - - template: common-steps.yml - parameters: - includeArtifacts: true - - pwsh: ./build.ps1 -target Publish-DockerHub -DockerDistro ${{ distro }} -DockerDotnetVersion ${{ dotnetVersion }} - displayName: '[Docker build & Test ${{ distro }} ${{ dotnetVersion }}]' - env: - DOCKER_USERNAME: $(DOCKER_USERNAME) - DOCKER_PASSWORD: $(DOCKER_PASSWORD) - ENABLED_PUBLISH_DOCKER: $(ENABLED_PUBLISH_DOCKER) diff --git a/.azurepipelines/publish.yml b/.azurepipelines/publish.yml deleted file mode 100644 index e1ba2c7ae2..0000000000 --- a/.azurepipelines/publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -parameters: -- name: taskName # defaults for any parameters that aren't specified - default: '' - -steps: -- template: common-steps.yml - parameters: - includeArtifacts: true -- pwsh: ./build.ps1 -target Publish-${{ parameters.taskName }} - displayName: '[Publish]' - env: - GITHUB_TOKEN: $(GITHUB_TOKEN) - NUGET_API_KEY: $(NUGET_API_KEY) - NUGET_API_URL: $(NUGET_API_URL) - CHOCOLATEY_API_KEY: $(CHOCOLATEY_API_KEY) - CHOCOLATEY_API_URL: $(CHOCOLATEY_API_URL) - ENABLED_PUBLISH_NUGET: $(ENABLED_PUBLISH_NUGET) - ENABLED_PUBLISH_CHOCOLATEY: $(ENABLED_PUBLISH_CHOCOLATEY) - DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2 diff --git a/.azurepipelines/release.yml b/.azurepipelines/release.yml deleted file mode 100644 index 0ad9bd3c0f..0000000000 --- a/.azurepipelines/release.yml +++ /dev/null @@ -1,18 +0,0 @@ -parameters: - oses: ['windows', 'ubuntu', 'macos'] -steps: -- template: common-steps.yml - parameters: - includeArtifacts: true -- ${{ each os in parameters.oses }}: - - task: DownloadPipelineArtifact@2 - displayName: 'Download ${{os}} native folder' - inputs: - source: current - path: $(Build.SourcesDirectory)/artifacts/native - artifact: storage-${{os}}-latest -- pwsh: ./build.ps1 -target Release - displayName: '[Release]' - env: - GITHUB_TOKEN: $(GITHUB_TOKEN) - ENABLED_PUBLISH_RELEASE: $(ENABLED_PUBLISH_RELEASE) diff --git a/.azurepipelines/test.yml b/.azurepipelines/test.yml deleted file mode 100644 index 9ebbdffef1..0000000000 --- a/.azurepipelines/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: common-steps.yml -- pwsh: ./build.ps1 -target Test - displayName: '[Run Test]' - env: - ENABLED_UNIT_TESTS: $(ENABLED_UNIT_TESTS) - CODECOV_TOKEN: $(CODECOV_TOKEN) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000000..3ad6694334 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "gitreleasemanager.tool": { + "version": "0.20.0", + "commands": [ + "dotnet-gitreleasemanager" + ] + }, + "wyam2": { + "version": "3.0.0", + "commands": [ + "wyam2" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f6b9fc4559..df058170ac 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,4 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/dotnet/.devcontainer/base.Dockerfile - -# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal -ARG VARIANT="6.0-bullseye-slim" -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} +FROM mcr.microsoft.com/devcontainers/dotnet:dev-9.0 # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 31d2b11306..69b116d50b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,42 +1,55 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/dotnet { - "name": "C# (.NET)", - "runArgs": ["--init"], - "build": { - "dockerfile": "Dockerfile", - "args": { - "VARIANT": "6.0", - } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "editor.fontFamily": "'Cascadia Code', Consolas, 'Courier New', monospace", - "editor.rulers": [90], - "cSpell.words": [ - "commiting", - "gittools", - "gitversion" - ], + "name": "GitVersion", + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "os-provided", + "ppa": "false" + }, + "ghcr.io/devcontainers/features/powershell:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest" + } + }, + "customizations": { + "vscode": { + "settings": { + "editor.fontFamily": "'Cascadia Code', Consolas, 'Courier New', monospace", + "editor.rulers": [ 90 ], + "cSpell.words": [ + "commiting", + "gittools", + "gitversion" + ] + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-dotnettools.csdevkit", + "EditorConfig.EditorConfig", + "streetsidesoftware.code-spell-checker" + ] + } }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp", - "EditorConfig.EditorConfig", - "streetsidesoftware.code-spell-checker" - ], - - "postCreateCommand": "dotnet restore src; dotnet build build", + "postCreateCommand": "dotnet restore src; dotnet build build", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "docker-in-docker": "latest", - "git": "latest", - "github-cli": "latest", - "sshd": "latest", - "powershell": "latest" - } + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } diff --git a/.editorconfig b/.editorconfig index b1965ff726..f199d80f9e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,16 +1,21 @@ +root = true # http://editorconfig.org # top-most EditorConfig file -root = true [*] indent_style = space indent_size = 4 end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +# Microsoft .NET properties +dotnet_style_qualification_for_event = false:none +dotnet_style_qualification_for_field = false:none +dotnet_style_qualification_for_method = false:none +dotnet_style_qualification_for_property = false:none + [*.yml] indent_size = 2 @@ -59,18 +64,12 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning dotnet_style_prefer_simplified_interpolation = true:suggestion - -# Dispose rules (CA2000 and CA2213) ported to IDE analyzers. We already execute the CA rules on the repo, so disable the IDE ones. -dotnet_diagnostic.IDE0067.severity = none -dotnet_diagnostic.IDE0068.severity = none -dotnet_diagnostic.IDE0069.severity = none - #### C# Coding Conventions #### # Prefer "var" everywhere -csharp_style_var_for_built_in_types = true:silent -csharp_style_var_when_type_is_apparent = true:silent -csharp_style_var_elsewhere = true:silent +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion # Prefer method-like constructs to have a block body, except for lambdas csharp_style_expression_bodied_methods = true:warning @@ -152,38 +151,29 @@ csharp_space_between_method_call_parameter_list_parentheses = false csharp_space_between_method_declaration_empty_parameter_list_parentheses = false csharp_space_between_method_declaration_name_and_open_parenthesis = false csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false csharp_space_between_square_brackets = false +resharper_csharp_use_roslyn_logic_for_evident_types = true + # Alignment -align_multiline_parameter = true +resharper_csharp_align_multiline_parameter = true # Qualify fields with "this." -csharp_instance_members_qualify_members = field - -# IDE0011: Add braces -dotnet_diagnostic.IDE0011.severity = none - -# IDE0090: Use 'new(...)' -dotnet_diagnostic.IDE0090.severity = warning +resharper_csharp_instance_members_qualify_members = field -# IDE0041: Use 'is null' check -dotnet_diagnostic.IDE0041.severity = warning +# IDE0005: Using directive is unnecessary. +dotnet_diagnostic.ide0005.severity = warning -# CA1825: Avoid zero-length array allocations -dotnet_diagnostic.CA1825.severity = warning +# RCS1037: Remove trailing white-space. +dotnet_diagnostic.rcs1037.severity = error -# CA1822: Mark members as static -dotnet_diagnostic.CA1822.severity = warning +# RCS1036: Remove redundant empty line. +dotnet_diagnostic.rcs1036.severity = error -# CA2208: Instantiate argument exceptions correctly -dotnet_diagnostic.CA2208.severity = warning +xml_space_before_self_closing = true -# CA1810: Initialize reference type static fields inline -dotnet_diagnostic.CA1810.severity = warning +resharper_arrange_object_creation_when_type_not_evident_highlighting = none -# CA1816: Dispose methods should call SuppressFinalize -dotnet_diagnostic.CA1816.severity = warning +resharper_unused_auto_property_accessor_global_highlighting = none -# IDE0005: Using directive is unnecessary. -dotnet_diagnostic.IDE0005.severity = warning +resharper_unused_method_return_value_global_highlighting = none diff --git a/.gitattributes b/.gitattributes index 9a5cb22250..14ce78d666 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,7 @@ # Custom for Visual Studio *.cs diff=csharp *.sln +*.slnx *.csproj *.vbproj *.fsproj diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 19839b4122..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[Bug]" -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -## Expected Behavior - - -## Actual Behavior - - -## Possible Fix - - -## Steps to Reproduce - - -## Context - - -## Your Environment - - - -- Version Used: -- Operating System and version (Windows 10, Ubuntu 18.04): -- Link to your project: -- Link to your CI build (if appropriate): diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 6a58a1674f..a0369f2732 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: Gitter Community Chat - url: https://gitter.im/GitTools/GitVersion - about: Please ask and answer questions here. \ No newline at end of file +- name: Ask for help or share ideas + url: https://github.com/GitTools/GitVersion/discussions/new/choose + about: Ask the community for help or share ideas for new features. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md deleted file mode 100644 index 597757df8a..0000000000 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Documentation -about: Describe this issue template's purpose here. -title: "[Docs]" -labels: documentation -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/failing-test.md b/.github/ISSUE_TEMPLATE/failing-test.md deleted file mode 100644 index 252723f267..0000000000 --- a/.github/ISSUE_TEMPLATE/failing-test.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Failing test -about: Describe this issue template's purpose here. -title: "[Failing test]" -labels: failing test case -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is or a link to it - -## Test code - -```csharp -using var fixture = new EmptyRepositoryFixture(); -fixture.Repository.MakeACommit(); -fixture.BranchTo("develop"); -fixture.Repository.MakeCommits(3); - -fixture.AssertFullSemver("0.1.0-alpha.1"); -``` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 1714c54078..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[Feature]" -labels: feature -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always -frustrated when [...] - -## Detailed Description - - -## Context - - - -## Possible Implementation - diff --git a/.github/ISSUE_TEMPLATE/improvement-request.md b/.github/ISSUE_TEMPLATE/improvement-request.md deleted file mode 100644 index eb0b004e01..0000000000 --- a/.github/ISSUE_TEMPLATE/improvement-request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Improvement request -about: Describe this issue template's purpose here. -title: "[Improvement]" -labels: improvement -assignees: '' - ---- - -**Is your improvement request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -## Detailed Description - - -## Context - - - -## Possible Implementation - diff --git a/.github/ISSUE_TEMPLATE/issue-report.yml b/.github/ISSUE_TEMPLATE/issue-report.yml new file mode 100644 index 0000000000..5e174295a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-report.yml @@ -0,0 +1,73 @@ +name: 🐞 Bug/Issue report +description: Create a report to help us improve +title: "[ISSUE]: " +labels: ["needs triage"] +body: +- type: checkboxes + attributes: + label: Prerequisites + options: + - label: I have written a descriptive issue title + required: true + - label: I have searched [issues](https://github.com/GitTools/GitVersion/issues) to ensure it has not already been reported + required: true +- type: dropdown + attributes: + label: GitVersion package + options: + - GitVersion.Tool + - GitVersion.MsBuild + - GitVersion.Portable + - gittools/actions + - AzureDevops task + - N/A + multiple: true + validations: + required: true +- type: input + attributes: + label: GitVersion version + validations: + required: true +- type: dropdown + attributes: + label: Operating system + options: + - Linux + - Windows + - macOS + - N/A + multiple: true + validations: + required: true +- type: textarea + attributes: + label: What are you seeing? + description: Describe the issue you are seeing + validations: + required: true +- type: textarea + attributes: + label: What is expected? + description: Describe what you would expect + validations: + required: true +- type: textarea + attributes: + label: Steps to Reproduce + description: List of steps or sample project to reproduce the issue + validations: + required: true +- type: textarea + attributes: + label: RepositoryFixture Test + description: If you are able to write your bug or scenario up as a `RepositoryFixture` test and submit a pull-request with it, it is going to increase the likelyhood of the bug being fixed. Make sure there is no sensitive data shared and that you place a stack trace inside a code (```csharp) block to avoid formatting issues. + validations: + required: false +- type: textarea + attributes: + label: Output log or link to your CI build (if appropriate). + description: Log messages you receive when running. Make sure there is no sensitive data shared. No need for backticks here. + render: shell + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 35967a1a21..4f351aa9c3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,30 +1,43 @@ <!--- Provide a general summary of your changes in the Title above --> ## Description + <!--- Describe your changes in detail --> ## Related Issue + <!--- This project only accepts pull requests related to open issues --> + <!--- If suggesting a new feature or change, please discuss it in an issue first --> + <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> + <!--- Please link to the issue here: --> ## Motivation and Context + <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? + <!--- Please describe in detail how you tested your changes. --> + <!--- Include details of your testing environment, and the tests you ran to --> + <!--- see how your change affects other areas of the code, etc. --> ## Screenshots (if appropriate): +<!--- Drag and drop screenshots here --> + ## Checklist: + <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> + <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> -- [ ] My code follows the code style of this project. -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. +* \[ ] My code follows the code style of this project. +* \[ ] My change requires a change to the documentation. +* \[ ] I have updated the documentation accordingly. +* \[ ] I have added tests to cover my changes. +* \[ ] All new and existing tests passed. diff --git a/.github/actions/artifacts-attest/action.yml b/.github/actions/artifacts-attest/action.yml new file mode 100644 index 0000000000..7722489c36 --- /dev/null +++ b/.github/actions/artifacts-attest/action.yml @@ -0,0 +1,13 @@ +name: 'Artifacts attestation' +description: 'Artifacts attestation' + +runs: + using: 'composite' + steps: + - + name: 'Attestation' + uses: actions/attest-build-provenance@v2.0.1 + with: + subject-path: | + ${{ github.workspace }}/artifacts/packages/native + ${{ github.workspace }}/artifacts/packages/nuget \ No newline at end of file diff --git a/.github/actions/artifacts-restore/action.yml b/.github/actions/artifacts-restore/action.yml new file mode 100644 index 0000000000..acca453639 --- /dev/null +++ b/.github/actions/artifacts-restore/action.yml @@ -0,0 +1,30 @@ +name: 'Artifacts restore' +description: 'Artifacts restore' + +runs: + using: 'composite' + steps: + - + uses: actions/download-artifact@v4 + name: Download native linux packages + with: + name: native-Linux + path: ${{ github.workspace }}/artifacts/packages/native + - + uses: actions/download-artifact@v4 + name: Download native windows packages + with: + name: native-Windows + path: ${{ github.workspace }}/artifacts/packages/native + - + uses: actions/download-artifact@v4 + name: Download native macos packages + with: + name: native-macOS + path: ${{ github.workspace }}/artifacts/packages/native + - + uses: actions/download-artifact@v4 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget \ No newline at end of file diff --git a/.github/actions/cache-restore/action.yml b/.github/actions/cache-restore/action.yml new file mode 100644 index 0000000000..3a3487843b --- /dev/null +++ b/.github/actions/cache-restore/action.yml @@ -0,0 +1,25 @@ +name: 'Cache restore' +description: 'Cache restore' + +runs: + using: 'composite' + steps: + - + name: Use cached cake frosting + id: cache-cake + uses: actions/cache@v4 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + - + name: Use cached tools + id: cache-tools + uses: actions/cache@v4 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json \ No newline at end of file diff --git a/.github/actions/docker-manifests/action.yml b/.github/actions/docker-manifests/action.yml new file mode 100644 index 0000000000..23de24c989 --- /dev/null +++ b/.github/actions/docker-manifests/action.yml @@ -0,0 +1,52 @@ +name: 'Docker Manifests' +description: 'Docker Publish Manifests' +inputs: + docker_distro: + description: 'Linux Distro' + required: true + dotnet_version: + description: '.net version' + required: true + docker_registry_username: + description: 'DockerHub Registry Username' + required: true + docker_registry_password: + description: 'DockerHub Registry Password' + required: true + github_registry_username: + description: 'GitHub Registry Username' + required: true + github_registry_password: + description: 'GitHub Registry Password' + required: true + +runs: + using: 'composite' + steps: + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ inputs.docker_registry_username }} + password: ${{ inputs.docker_registry_password }} + - + name: '[Docker Publish Manifests] DockerHub' + shell: pwsh + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub + - + name: Login to GitHub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ inputs.github_registry_username }} + password: ${{ inputs.github_registry_password }} + - + name: '[Docker Publish Manifests] GitHub' + shell: pwsh + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml new file mode 100644 index 0000000000..e5f2e05757 --- /dev/null +++ b/.github/actions/docker-publish/action.yml @@ -0,0 +1,55 @@ +name: 'Docker Publish' +description: 'Docker Publish Images' +inputs: + arch: + description: 'Docker architecture' + required: true + docker_distro: + description: 'Linux Distro' + required: true + dotnet_version: + description: '.net version' + required: true + docker_registry_username: + description: 'DockerHub Registry Username' + required: true + docker_registry_password: + description: 'DockerHub Registry Password' + required: true + github_registry_username: + description: 'GitHub Registry Username' + required: true + github_registry_password: + description: 'GitHub Registry Password' + required: true + +runs: + using: 'composite' + steps: + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ inputs.docker_registry_username }} + password: ${{ inputs.docker_registry_password }} + - + name: '[Docker Publish] DockerHub' + shell: pwsh + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic + - + name: Login to GitHub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ inputs.github_registry_username }} + password: ${{ inputs.github_registry_password }} + - + name: '[Docker Publish] GitHub' + shell: pwsh + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/actions/docker-setup/action.yml b/.github/actions/docker-setup/action.yml new file mode 100644 index 0000000000..7b75cebdfd --- /dev/null +++ b/.github/actions/docker-setup/action.yml @@ -0,0 +1,16 @@ +name: 'Docker Setup' +description: 'Setups the docker engine' + +runs: + using: 'composite' + steps: + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: '{ "features": { "containerd-snapshotter": true } }' + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: 'latest' + driver-opts: 'image=moby/buildkit:buildx-stable-1' + install: true diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml new file mode 100644 index 0000000000..c7a747121f --- /dev/null +++ b/.github/actions/docker-test/action.yml @@ -0,0 +1,30 @@ +name: 'Docker Test' +description: 'Docker Test Images' +inputs: + arch: + description: 'Docker architecture' + default: 'amd64' + docker_distro: + description: 'Linux Distro' + default: 'debian.12' + dotnet_version: + description: '.net version' + default: '8.0' + +runs: + using: 'composite' + steps: + - + name: '[Docker Build & Test] DockerHub' + shell: pwsh + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic + - + name: '[Docker Build & Test] GitHub' + shell: pwsh + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/chatmodes/plan.chatmode.md b/.github/chatmodes/plan.chatmode.md new file mode 100644 index 0000000000..57ced4af97 --- /dev/null +++ b/.github/chatmodes/plan.chatmode.md @@ -0,0 +1,114 @@ +--- +description: 'Strategic planning and architecture assistant focused on thoughtful analysis before implementation. Helps developers understand codebases, clarify requirements, and develop comprehensive implementation strategies.' +tools: ['codebase', 'extensions', 'fetch', 'findTestFiles', 'githubRepo', 'problems', 'search', 'searchResults', 'usages', 'vscodeAPI'] +--- + +# Plan Mode - Strategic Planning & Architecture Assistant + +You are a strategic planning and architecture assistant focused on thoughtful analysis before implementation. Your primary role is to help developers understand their codebase, clarify requirements, and develop comprehensive implementation strategies. + +## Core Principles + +**Think First, Code Later**: Always prioritize understanding and planning over immediate implementation. Your goal is to help users make informed decisions about their development approach. + +**Information Gathering**: Start every interaction by understanding the context, requirements, and existing codebase structure before proposing any solutions. + +**Collaborative Strategy**: Engage in dialogue to clarify objectives, identify potential challenges, and develop the best possible approach together with the user. + +## Your Capabilities & Focus + +### Information Gathering Tools +- **Codebase Exploration**: Use the `codebase` tool to examine existing code structure, patterns, and architecture +- **Search & Discovery**: Use `search` and `searchResults` tools to find specific patterns, functions, or implementations across the project +- **Usage Analysis**: Use the `usages` tool to understand how components and functions are used throughout the codebase +- **Problem Detection**: Use the `problems` tool to identify existing issues and potential constraints +- **Test Analysis**: Use `findTestFiles` to understand testing patterns and coverage +- **External Research**: Use `fetch` to access external documentation and resources +- **Repository Context**: Use `githubRepo` to understand project history and collaboration patterns +- **VSCode Integration**: Use `vscodeAPI` and `extensions` tools for IDE-specific insights +- **External Services**: Use MCP tools like `mcp-atlassian` for project management context and `browser-automation` for web-based research + +### Planning Approach +- **Requirements Analysis**: Ensure you fully understand what the user wants to accomplish +- **Context Building**: Explore relevant files and understand the broader system architecture +- **Constraint Identification**: Identify technical limitations, dependencies, and potential challenges +- **Strategy Development**: Create comprehensive implementation plans with clear steps +- **Risk Assessment**: Consider edge cases, potential issues, and alternative approaches + +## Workflow Guidelines + +### 1. Start with Understanding +- Ask clarifying questions about requirements and goals +- Explore the codebase to understand existing patterns and architecture +- Identify relevant files, components, and systems that will be affected +- Understand the user's technical constraints and preferences + +### 2. Analyze Before Planning +- Review existing implementations to understand current patterns +- Identify dependencies and potential integration points +- Consider the impact on other parts of the system +- Assess the complexity and scope of the requested changes + +### 3. Develop Comprehensive Strategy +- Break down complex requirements into manageable components +- Propose a clear implementation approach with specific steps +- Identify potential challenges and mitigation strategies +- Consider multiple approaches and recommend the best option +- Plan for testing, error handling, and edge cases + +### 4. Present Clear Plans +- Provide detailed implementation strategies with reasoning +- Include specific file locations and code patterns to follow +- Suggest the order of implementation steps +- Identify areas where additional research or decisions may be needed +- Offer alternatives when appropriate + +## Best Practices + +### Information Gathering +- **Be Thorough**: Read relevant files to understand the full context before planning +- **Ask Questions**: Don't make assumptions - clarify requirements and constraints +- **Explore Systematically**: Use directory listings and searches to discover relevant code +- **Understand Dependencies**: Review how components interact and depend on each other + +### Planning Focus +- **Architecture First**: Consider how changes fit into the overall system design +- **Follow Patterns**: Identify and leverage existing code patterns and conventions +- **Consider Impact**: Think about how changes will affect other parts of the system +- **Plan for Maintenance**: Propose solutions that are maintainable and extensible + +### Communication +- **Be Consultative**: Act as a technical advisor rather than just an implementer +- **Explain Reasoning**: Always explain why you recommend a particular approach +- **Present Options**: When multiple approaches are viable, present them with trade-offs +- **Document Decisions**: Help users understand the implications of different choices + +## Interaction Patterns + +### When Starting a New Task +1. **Understand the Goal**: What exactly does the user want to accomplish? +2. **Explore Context**: What files, components, or systems are relevant? +3. **Identify Constraints**: What limitations or requirements must be considered? +4. **Clarify Scope**: How extensive should the changes be? + +### When Planning Implementation +1. **Review Existing Code**: How is similar functionality currently implemented? +2. **Identify Integration Points**: Where will new code connect to existing systems? +3. **Plan Step-by-Step**: What's the logical sequence for implementation? +4. **Consider Testing**: How can the implementation be validated? + +### When Facing Complexity +1. **Break Down Problems**: Divide complex requirements into smaller, manageable pieces +2. **Research Patterns**: Look for existing solutions or established patterns to follow +3. **Evaluate Trade-offs**: Consider different approaches and their implications +4. **Seek Clarification**: Ask follow-up questions when requirements are unclear + +## Response Style + +- **Conversational**: Engage in natural dialogue to understand and clarify requirements +- **Thorough**: Provide comprehensive analysis and detailed planning +- **Strategic**: Focus on architecture and long-term maintainability +- **Educational**: Explain your reasoning and help users understand the implications +- **Collaborative**: Work with users to develop the best possible solution + +Remember: Your role is to be a thoughtful technical advisor who helps users make informed decisions about their code. Focus on understanding, planning, and strategy development rather than immediate implementation. diff --git a/.github/chatmodes/planner.chatmode.md b/.github/chatmodes/planner.chatmode.md new file mode 100644 index 0000000000..baf3afb8ac --- /dev/null +++ b/.github/chatmodes/planner.chatmode.md @@ -0,0 +1,14 @@ +--- +description: 'Generate an implementation plan for new features or refactoring existing code.' +tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo', 'search', 'usages'] +--- +# Planning mode instructions +You are in planning mode. Your task is to generate an implementation plan for a new feature or for refactoring existing code. +Don't make any code edits, just generate a plan. + +The plan consists of a Markdown document that describes the implementation plan, including the following sections: + +* Overview: A brief description of the feature or refactoring task. +* Requirements: A list of requirements for the feature or refactoring task. +* Implementation Steps: A detailed list of steps to implement the feature or refactoring task. +* Testing: A list of tests that need to be implemented to verify the feature or refactoring task. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7fda019add..87b6a493c0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,75 @@ version: 2 updates: -- package-ecosystem: nuget - labels: - - "dependencies" - commit-message: - prefix: "(deps)" - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: "Microsoft.Build" - versions: ["16.9.0", "16.11.0"] -- package-ecosystem: github-actions - labels: - - "dependencies" - commit-message: - prefix: "(build deps)" - directory: "/" - schedule: - interval: daily + - package-ecosystem: dotnet-sdk + labels: + - "dependencies" + commit-message: + prefix: "(sdk)" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 * * *" + - package-ecosystem: nuget + labels: + - "dependencies" + commit-message: + prefix: "(deps)" + groups: + microsoft: + patterns: + - "Microsoft.*" + - "System.*" + Microsoft_CodeAnalysis: + patterns: + - "Microsoft.CodeAnalysis.*" + analyzers: + patterns: + - "*Analyzers" + serilog: + patterns: + - "Serilog.*" + nunit: + patterns: + - "NUnit.*" + LibGit2Sharp: + patterns: + - "LibGit2Sharp.*" + JsonSchemaNet: + patterns: + - "JsonSchemaNet.*" + directories: + - "/build" + - "/new-cli" + - "/src" + schedule: + interval: cron + cronjob: "0 12 * * *" + open-pull-requests-limit: 10 + + - package-ecosystem: github-actions + labels: + - "dependencies" + commit-message: + prefix: "(build deps)" + groups: + actions: + patterns: + - "actions/*" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 * * *" + + - package-ecosystem: npm + labels: + - "dependencies" + commit-message: + prefix: "(docs deps)" + groups: + remark: + patterns: + - "remark*" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 1,15 * *" diff --git a/.github/mergify.yml b/.github/mergify.yml index a4c175a3eb..2a9dca3674 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -11,12 +11,6 @@ pull_request_rules: - '#commits-behind=0' # Only merge up to date pull requests - check-success=DotNet Format - check-success=Release - - check-success=Unit Test code (windows-latest, netcoreapp3.1) - - check-success=Unit Test code (ubuntu-latest, netcoreapp3.1) - - check-success=Unit Test code (macos-latest, netcoreapp3.1) - - check-success=Unit Test code (windows-latest, net5.0) - - check-success=Unit Test code (windows-latest, net5.0) - - check-success=Unit Test code (windows-latest, net5.0) - repository-full-name=GitTools/GitVersion # Don't auto-merge PRs in forks actions: merge: diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index b9f69483f9..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 90 - -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 30 - -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security - - bug - - failing test case - - help wanted - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: true - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: true - -# Label to use when marking an issue as stale -staleLabel: stale - -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. After 30 days from now, it will be closed if no further - activity occurs. Thank you for your contributions. - -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml new file mode 100644 index 0000000000..140d4489a7 --- /dev/null +++ b/.github/workflows/_artifacts_linux.yml @@ -0,0 +1,60 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + arch: + required: true + type: string + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + artifacts: + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} + runs-on: ${{ inputs.runner }} + strategy: + fail-fast: false + matrix: + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + uses: actions/download-artifact@v6 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + - + uses: actions/download-artifact@v6 + name: Download native packages + with: + name: native-Linux + path: ${{ github.workspace }}/artifacts/packages/native + - + name: Set up Docker + uses: ./.github/actions/docker-setup + - + name: '[Test Artifacts]' + shell: pwsh + run: | + dotnet run/artifacts.dll ` + --target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnet_version }} ` + --docker_distro=${{ matrix.docker_distro }} \ No newline at end of file diff --git a/.github/workflows/_artifacts_windows.yml b/.github/workflows/_artifacts_windows.yml new file mode 100644 index 0000000000..fb7c2e0696 --- /dev/null +++ b/.github/workflows/_artifacts_windows.yml @@ -0,0 +1,35 @@ +on: + workflow_call: + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + artifacts: + name: ${{ matrix.package }} + runs-on: windows-2025 + strategy: + fail-fast: false + matrix: + package: [ Executable, MsBuildFull ] + + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + uses: actions/download-artifact@v6 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + - + name: '[Test Artifacts]' + shell: pwsh + run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml new file mode 100644 index 0000000000..c34e570287 --- /dev/null +++ b/.github/workflows/_build.yml @@ -0,0 +1,50 @@ +on: + workflow_call: + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + build: + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2025, ubuntu-24.04, macos-15] + + runs-on: ${{ matrix.os }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + name: '[Build]' + shell: pwsh + run: dotnet run/build.dll --target=Package + - + name: 'Upload nuget packages' + uses: actions/upload-artifact@v5 + if: matrix.os == 'windows-2025' + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + - + name: 'Upload native packages' + uses: actions/upload-artifact@v5 + if: matrix.os == 'windows-2025' + with: + name: native-${{ runner.os }} + path: ${{ github.workspace }}/artifacts/packages/native/*.zip + - + name: 'Upload native packages' + uses: actions/upload-artifact@v5 + if: matrix.os != 'windows-2025' + with: + name: native-${{ runner.os }} + path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz diff --git a/.github/workflows/_docker.yml b/.github/workflows/_docker.yml new file mode 100644 index 0000000000..cd415edfa5 --- /dev/null +++ b/.github/workflows/_docker.yml @@ -0,0 +1,67 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + arch: + required: true + type: string + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + docker: + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} + runs-on: ${{ inputs.runner }} + strategy: + fail-fast: false + matrix: + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + uses: actions/download-artifact@v6 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + - + name: Set up Docker + uses: ./.github/actions/docker-setup + - + name: Docker Test + if: success() && github.event_name == 'pull_request' || github.repository_owner != 'GitTools' + uses: ./.github/actions/docker-test + with: + arch: ${{ inputs.arch }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + - + name: Docker Publish + if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' + uses: ./.github/actions/docker-publish + with: + arch: ${{ inputs.arch }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + docker_registry_username: ${{ secrets.DOCKER_USERNAME }} + docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} + github_registry_username: ${{ github.repository_owner }} + github_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/_docker_manifests.yml b/.github/workflows/_docker_manifests.yml new file mode 100644 index 0000000000..0fb895ec27 --- /dev/null +++ b/.github/workflows/_docker_manifests.yml @@ -0,0 +1,46 @@ +on: + workflow_call: + inputs: + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + manifest: + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + name: Set up Docker + uses: ./.github/actions/docker-setup + - + name: Docker Manifests + if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' + uses: ./.github/actions/docker-manifests + with: + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + docker_registry_username: ${{ secrets.DOCKER_USERNAME }} + docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} + github_registry_username: ${{ github.repository_owner }} + github_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml new file mode 100644 index 0000000000..4a0abe2050 --- /dev/null +++ b/.github/workflows/_prepare.yml @@ -0,0 +1,72 @@ +on: + workflow_call: + outputs: + docker_distros: + description: 'List of Docker distros' + value: ${{ jobs.set_matrix.outputs.docker_distros }} + dotnet_versions: + description: 'List of .NET versions' + value: ${{ jobs.set_matrix.outputs.dotnet_versions }} + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + prepare: + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2025, ubuntu-24.04, macos-15] + + runs-on: ${{ matrix.os }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + - + name: Cache cake frosting + id: cache-cake + uses: actions/cache@v4 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + - name: Use cached tools + id: cache-tools + uses: actions/cache@v4 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + - + name: '[Build]' + if: steps.cache-cake.outputs.cache-hit != 'true' + run: dotnet build build/ --configuration=Release + - + name: '[Prepare]' + shell: pwsh + run: dotnet run/build.dll --target=BuildPrepare + set_matrix: + needs: [ prepare ] + name: Set Matrix + runs-on: ubuntu-24.04 + outputs: + docker_distros: ${{ steps.set_matrix.outputs.docker_distros }} + dotnet_versions: ${{ steps.set_matrix.outputs.dotnet_versions }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + name: '[Matrix]' + id: set_matrix + shell: pwsh + run: dotnet run/config.dll --target=SetMatrix \ No newline at end of file diff --git a/.github/workflows/_publish.yml b/.github/workflows/_publish.yml new file mode 100644 index 0000000000..864431558b --- /dev/null +++ b/.github/workflows/_publish.yml @@ -0,0 +1,39 @@ +on: + workflow_call: + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + publish: + name: ${{ matrix.taskName }} + runs-on: windows-2025 + strategy: + fail-fast: false + matrix: + taskName: [ NuGet, Chocolatey ] + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + uses: actions/download-artifact@v6 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + - + name: '[Publish]' + shell: pwsh + run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} \ No newline at end of file diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml new file mode 100644 index 0000000000..503646b45b --- /dev/null +++ b/.github/workflows/_unit_tests.yml @@ -0,0 +1,42 @@ +on: + workflow_call: + inputs: + dotnet_versions: + required: true + type: string +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" + +jobs: + unit_test: + name: ${{ matrix.os }} - net${{ matrix.dotnet_version }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + strategy: + fail-fast: false + matrix: + os: [windows-2025, ubuntu-24.04, macos-15] + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} + + runs-on: ${{ matrix.os }} + steps: + - + name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + name: '[Unit Test]' + shell: pwsh + run: dotnet run/build.dll --target=Test --dotnet_version=${{ matrix.dotnet_version }} + + - + name: Test Summary + uses: test-summary/action@v2.4 + if: ${{ always() && matrix.dotnet_version == '9.0' }} + with: + paths: artifacts/test-results/*.results.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a2da1be3b..2421ae3dd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,27 +3,30 @@ name: CI on: push: branches: - - main - - 'fix/*' - - 'feature/*' - - 'support/*' + - main + - 'fix/*' + - 'feature/*' + - 'poc/*' + - 'support/*' paths: - - '**' - - '!docs/**' + - '**' + - '!docs/**' pull_request: branches: - - main - - 'support/*' + - main + - 'support/*' paths: - - '**' - - '!docs/**' - + - '**' + - '!docs/**' + merge_group: + types: [checks_requested] + repository_dispatch: - types: [release] + types: [ ci-release ] env: - DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2 + DOTNET_ROLL_FORWARD: "Major" DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: 1 @@ -31,466 +34,127 @@ env: ENABLED_DIAGNOSTICS: ${{ secrets.ENABLED_DIAGNOSTICS }} permissions: + id-token: write contents: read packages: write + attestations: write jobs: prepare: - name: Prepare Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Prepare]' - if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release - + name: Prepare + uses: ./.github/workflows/_prepare.yml + build: - name: Build code & Package - needs: [prepare] - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Build]' - shell: pwsh - run: dotnet run/build.dll --target=Package - - - name: 'Upload nuget packages' - uses: actions/upload-artifact@v3 - if: matrix.os == 'windows-latest' - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: 'Upload native packages' - uses: actions/upload-artifact@v3 - if: matrix.os == 'windows-latest' - with: - name: native-${{ runner.os }} - path: ${{ github.workspace }}/artifacts/packages/native/*.zip - - - name: 'Upload native packages' - uses: actions/upload-artifact@v3 - if: matrix.os != 'windows-latest' - with: - name: native-${{ runner.os }} - path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz + name: Build & Package + needs: [ prepare ] + uses: ./.github/workflows/_build.yml unit_test: - name: Unit Test code - needs: [prepare] - runs-on: ${{ matrix.os }} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - targetFramework: [net48, net5.0, net6.0, netcoreapp3.1] - exclude: - - - os: 'ubuntu-latest' - targetFramework: net48 - - - os: 'macos-latest' - targetFramework: net48 - fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Unit Test]' - shell: pwsh - run: dotnet run/build.dll --target=Test --dotnet_target=${{ matrix.targetFramework }} - - # - - # name: Test Summary - # uses: test-summary/action@v1 - # with: - # paths: artifacts/test-results/*.results.xml - # if: always() + name: Test + needs: [ prepare ] + uses: ./.github/workflows/_unit_tests.yml + with: + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} + secrets: inherit artifacts_windows_test: - name: Test artifacts on windows - needs: [build] - runs-on: windows-latest - strategy: - matrix: - package: [ Executable, MsBuildFull ] - fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - uses: actions/download-artifact@v3 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Test Artifacts]' - shell: pwsh - run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test + name: Artifacts Windows + needs: [ build ] + uses: ./.github/workflows/_artifacts_windows.yml artifacts_linux_test: - name: Test artifacts in docker - needs: [build] - runs-on: ubuntu-latest + needs: [ prepare, build ] + name: Artifacts Linux (${{ matrix.arch }}) strategy: - matrix: - targetFramework: [ '3.1', '5.0', '6.0' ] - distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ] fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - uses: actions/download-artifact@v3 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - uses: actions/download-artifact@v3 - name: Download native packages - with: - name: native-${{ runner.os }} - path: ${{ github.workspace }}/artifacts/packages/native - - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Test Artifacts (amd64)]' - shell: pwsh - run: dotnet run/artifacts.dll --target=ArtifactsTest --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} - - - name: '[Test Artifacts (arm64)]' - shell: pwsh - run: dotnet run/artifacts.dll --target=ArtifactsTest --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} + matrix: + include: + - arch: amd64 + runner: ubuntu-24.04 + - arch: arm64 + runner: ubuntu-24.04-arm + uses: ./.github/workflows/_artifacts_linux.yml + with: + runner: ${{ matrix.runner }} + arch: ${{ matrix.arch }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} docker_linux_images: - name: Build, Test and Publish Docker Images - needs: [build] - runs-on: ubuntu-latest + needs: [ prepare, build ] + name: Docker Images (${{ matrix.arch }}) strategy: - matrix: - targetFramework: [ '3.1', '5.0', '6.0' ] - distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ] fail-fast: false - - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - uses: actions/download-artifact@v3 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: Login to DockerHub - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: '[Docker Build/Test/Publish (amd64)] DockerHub' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub - - - name: '[Docker Build/Test/Publish (arm64)] DockerHub' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub - - - name: '[Docker Publish Manifest] DockerHub' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub - - - - name: Login to GitHub Container Registry - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.DOCKER_GITHUB_TOKEN }} - - - name: '[Docker Build/Test/Publish (amd64)] GitHub Container Registry' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github - - - name: '[Docker Build/Test/Publish (arm64)] GitHub Container Registry' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github - - - name: '[Docker Publish Manifest] GitHub Container Registry' - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' - shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github + matrix: + include: + - arch: amd64 + runner: ubuntu-24.04 + - arch: arm64 + runner: ubuntu-24.04-arm + + uses: ./.github/workflows/_docker.yml + with: + runner: ${{ matrix.runner }} + arch: ${{ matrix.arch }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} + secrets: inherit + + docker_linux_manifests: + needs: [ prepare, docker_linux_images ] + name: Docker Manifests + uses: ./.github/workflows/_docker_manifests.yml + with: + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} + secrets: inherit publish: name: Publish - needs: [artifacts_windows_test, artifacts_linux_test, docker_linux_images] - runs-on: windows-latest - strategy: - matrix: - taskName: [NuGet, Chocolatey] - fail-fast: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} - CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - uses: actions/download-artifact@v3 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - - - name: '[Publish]' - shell: pwsh - run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} + needs: [ artifacts_windows_test, artifacts_linux_test ] + uses: ./.github/workflows/_publish.yml + secrets: inherit release: name: Release - needs: [publish] - runs-on: windows-latest + needs: [ publish, docker_linux_manifests ] + runs-on: windows-2025 env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + name: Restore State + uses: ./.github/actions/cache-restore - - uses: actions/download-artifact@v3 - name: Download native linux packages - with: - name: native-Linux - path: ${{ github.workspace }}/artifacts/packages/native - - - uses: actions/download-artifact@v3 - name: Download native windows packages - with: - name: native-Windows - path: ${{ github.workspace }}/artifacts/packages/native + name: Restore Artifacts + uses: ./.github/actions/artifacts-restore - - uses: actions/download-artifact@v3 - name: Download native macos packages - with: - name: native-macOS - path: ${{ github.workspace }}/artifacts/packages/native + name: Attetstation + if: ${{ github.event_name == 'repository_dispatch' }} + uses: ./.github/actions/artifacts-attest - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' + name: DockerHub Publish Readme + if: ${{ github.event_name == 'repository_dispatch' }} + shell: pwsh + run: dotnet run/docker.dll --target=DockerHubReadmePublish + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: '[Release]' shell: pwsh run: dotnet run/release.dll --target=PublishRelease + - + name: '[Publish Release]' + if: ${{ github.event_name == 'repository_dispatch' }} + uses: peter-evans/repository-dispatch@v4 + with: + token: ${{ secrets.RELEASE_GITHUB_TOKEN }} + repository: ${{ github.repository }} + event-type: publish-release + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ github.event.client_payload.tag }}"}' \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ccdaab0e61..c53b7a4cd7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,6 +8,8 @@ on: paths: - '**' - '!docs/**' + - '!.github/**' + - .github/workflows/codeql-analysis.yml pull_request: branches: @@ -16,12 +18,19 @@ on: paths: - '**' - '!docs/**' + - '!.github/**' + - .github/workflows/codeql-analysis.yml schedule: - cron: '0 12 * * *' permissions: contents: read +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 jobs: analyze: @@ -30,7 +39,7 @@ jobs: contents: read # for actions/checkout to fetch code security-events: write # for github/codeql-action/analyze to upload SARIF results name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -40,39 +49,37 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} - name: Cache cake frosting id: cache-cake - uses: actions/cache@v3.0.11 + uses: actions/cache@v4 with: path: run key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' - + global-json-file: global.json - name: '[Prepare]' if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release + run: dotnet build build/ --configuration=Release - name: '[Build]' shell: pwsh - run: dotnet run/build.dll --target=Build --exclusive + run: dotnet run/build.dll --target=BuildPrepare --exclusive - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a0adf79364..f3874e8c13 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,10 +2,11 @@ name: Verify & Publish Docs on: workflow_dispatch: + repository_dispatch: + types: [ publish-release ] push: branches: - # - main - - 'support/*' + - main paths: - docs/** - package*.json @@ -15,8 +16,7 @@ on: - .github/workflows/docs.yml pull_request: branches: - # - main - - 'support/*' + - main paths: - docs/** - package*.json @@ -25,34 +25,33 @@ on: - mkdocs.yml - .github/workflows/docs.yml env: - DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2 + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 jobs: prepare: name: Prepare Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest] - fail-fast: false + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Cache cake frosting id: cache-cake - uses: actions/cache@v3.0.11 + uses: actions/cache@v4 with: path: run key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - name: Use cached tools id: cache-tools - uses: actions/cache@v3.0.11 + uses: actions/cache@v4 with: path: tools key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} @@ -66,52 +65,38 @@ jobs: - name: Cache Node Modules id: cache-node - uses: actions/cache@v3.0.11 + uses: actions/cache@v4 with: path: ${{ steps.cache-node-dir.outputs.dir }} key: node-${{ runner.os }}-${{ hashFiles('./package-lock.json') }} restore-keys: node-${{ runner.os }} - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' + global-json-file: global.json - - name: '[Prepare]' + name: '[Build]' if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release + run: dotnet build build/ --configuration=Release + - + name: '[Prepare]' + shell: pwsh + run: dotnet run/build.dll --target=BuildPrepare validate: name: Validates Html - needs: [prepare] - runs-on: ubuntu-latest + needs: [ prepare ] + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' + name: Restore State + uses: ./.github/actions/cache-restore - name: '[Build Documentation]' shell: pwsh @@ -121,7 +106,7 @@ jobs: uses: chabad360/htmlproofer@master with: directory: ./artifacts/docs/preview - arguments: --ignore-urls /api/,/docs/ --allow-hash-href --assume-extension --disable-external + arguments: --ignore-urls /api/,/docs/,/5.12.0/ --allow-hash-href --allow-missing-href --assume-extension --disable-external --no-check_external_hash - name: '[Reviewdog Reporter]' id: reporter @@ -130,47 +115,34 @@ jobs: echo "value=$value" >> $GITHUB_OUTPUT - name: '[Remark Lint]' - uses: reviewdog/action-remark-lint@v5.6 + uses: reviewdog/action-remark-lint@v5 with: github_token: ${{ secrets.GITHUB_TOKEN }} reporter: ${{ steps.reporter.outputs.value }} publish: name: Publish docs - needs: [validate] - runs-on: windows-latest + needs: [ validate ] + runs-on: ubuntu-24.04 env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.actor }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v3.0.11 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + name: Restore State + uses: ./.github/actions/cache-restore - - name: Use cached tools - id: cache-tools - uses: actions/cache@v3.0.11 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 - with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' + name: '[Build Schemas]' + shell: pwsh + run: dotnet run/docs.dll --target=GenerateSchemas - name: '[Publish Documentation]' - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'repository_dispatch' }} shell: pwsh run: dotnet run/docs.dll --target=PublishDocs - diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 939f8213ea..ffe858459c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,15 +1,17 @@ -name: Validate Commit - +name: Code Format on: push: branches: - main - 'fix/*' - 'feature/*' + - 'poc/*' - 'support/*' paths: - '**' - '!docs/**' + - '!.github/**' + - .github/workflows/format.yml pull_request: branches: @@ -18,25 +20,34 @@ on: paths: - '**' - '!docs/**' + - '!.github/**' + - .github/workflows/format.yml permissions: contents: read +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + jobs: format: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: DotNet Format steps: - - uses: actions/checkout@v3 + - + name: Checkout + uses: actions/checkout@v5 - name: Setup .NET SDK - uses: actions/setup-dotnet@v3.0.2 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '7.0.x' - dotnet-quality: 'preview' + global-json-file: global.json - - name: Run Format Build solution + name: Run Format 'ci' solution run: dotnet format ./build/ --verify-no-changes - - name: Run Format GitVersion solution + name: Run Format 'GitVersion' solution run: dotnet format ./src/ --exclude **/AddFormats/ --verify-no-changes diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index 18488c5185..12cfa22056 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -1,9 +1,14 @@ -name: Homebrew +name: Publish to Homebrew on: workflow_dispatch: + inputs: + tag-name: + description: 'The git tag name to bump the formula to' + required: true repository_dispatch: - types: [release] + types: [ publish-release ] + permissions: contents: read @@ -14,10 +19,25 @@ jobs: name: Bump Homebrew formula runs-on: macos-latest steps: - - uses: dawidd6/action-homebrew-bump-formula@v3.8.0 - with: - # GitHub token, required, not the default one - token: ${{secrets.RELEASE_GITHUB_TOKEN}} - # Formula name, required - formula: gitversion - tag: ${{ github.event.client_payload.ref }} + - name: Get version + id: get-version + shell: pwsh + run: | + $version = "${{ github.event.client_payload.tag }}" + if ($version -eq "") { + $version = "${{ github.event.inputs.tag-name }}" + } + "version=$version" >> $env:GITHUB_OUTPUT + - + uses: mislav/bump-homebrew-formula-action@v3 + name: Bump Homebrew formula + with: + formula-name: gitversion + tag-name: ${{ steps.get-version.outputs.version }} + download-url: https://github.com/GitTools/GitVersion/archive/refs/tags/${{ steps.get-version.outputs.version }}.tar.gz + commit-message: | + {{formulaName}} {{version}} + + For additional details see https://github.com/GitTools/GitVersion/releases/tag/${{ steps.get-version.outputs.version }} + env: + COMMITTER_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml new file mode 100644 index 0000000000..02d394c8b7 --- /dev/null +++ b/.github/workflows/mkdocs.yml @@ -0,0 +1,54 @@ +name: Markdown Update +on: + push: + +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + +defaults: + run: + shell: pwsh + +jobs: + docs: + name: Update Markdown (embedded snippets) + runs-on: ubuntu-24.04 + steps: + - + name: Checkout + uses: actions/checkout@v5 + if: github.event_name == 'push' + with: + token: ${{ secrets.PUSH_GITHUB_TOKEN }} + - + name: Checkout + uses: actions/checkout@v5 + if: github.event_name == 'pull_request' + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + - + name: Run MarkdownSnippets + run: | + dotnet tool install --global MarkdownSnippets.Tool + mdsnippets --write-header false + working-directory: ${{ github.workspace }}/docs/input + - + name: Check for changes + id: status + run: | + if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT } + - + name: Push changes + run: | + git add --verbose . + git config user.name 'Artur Stolear' + git config user.email 'artur.stolear@gmail.com' + git commit -m 'Docs changes' --allow-empty + git push --force + if: steps.status.outputs.has_changes == '1' diff --git a/.github/workflows/new-cli.yml b/.github/workflows/new-cli.yml new file mode 100644 index 0000000000..6793b7eee4 --- /dev/null +++ b/.github/workflows/new-cli.yml @@ -0,0 +1,56 @@ +name: Build (new-cli) +on: + push: + branches: + - main + - 'fix/*' + - 'feature/*' + - 'poc/*' + - 'support/*' + paths: + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml + + pull_request: + branches: + - main + - 'support/*' + paths: + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml + +permissions: + contents: read + +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + +jobs: + format: + runs-on: ubuntu-24.04 + name: Build & Test (new-cli) + steps: + - + name: Checkout + uses: actions/checkout@v5 + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + - + name: Build 'new-cli' solution + run: dotnet build ./new-cli + - + name: Run Format 'new-cli' solution + run: dotnet format ./new-cli --exclude ~/.nuget/packages --verify-no-changes + - + name: Test 'new-cli' solution + run: dotnet test ./new-cli --no-build --verbosity normal diff --git a/.github/workflows/public-api.yml b/.github/workflows/public-api.yml new file mode 100644 index 0000000000..98af4e21e7 --- /dev/null +++ b/.github/workflows/public-api.yml @@ -0,0 +1,44 @@ +name: Mark public API as shipped + +on: + workflow_dispatch: + repository_dispatch: + types: [ publish-release ] + +defaults: + run: + shell: pwsh + +permissions: + contents: read + +jobs: + homebrew: + permissions: + contents: none + name: Mark public API as shipped + runs-on: ubuntu-24.04 + steps: + - + name: Checkout + uses: actions/checkout@v5 + if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' + with: + token: ${{ secrets.PUSH_GITHUB_TOKEN }} + - + name: Mark public API as shipped + run: ./src/mark-shipped.ps1 + - + name: Check for changes + id: status + run: | + if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT } + - + name: Push changes + run: | + git add --verbose . + git config user.name 'Artur Stolear' + git config user.email 'artur.stolear@gmail.com' + git commit -m 'Mark public API as shipped' --allow-empty + git push --force + if: steps.status.outputs.has_changes == '1' diff --git a/.github/workflows/qodana_analysis.yml b/.github/workflows/qodana_analysis.yml new file mode 100644 index 0000000000..3d7c0e1eca --- /dev/null +++ b/.github/workflows/qodana_analysis.yml @@ -0,0 +1,35 @@ +name: Qodana +on: + workflow_dispatch: + push: + branches: + - main + - 'fix/*' + - 'feature/*' +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - + uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + - + name: 'Qodana Scan' + uses: jetbrains/qodana-action@v2025.2.1 + with: + args: --baseline,qodana.sarif.json + cache-default-branch-only: true + pr-mode: true + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb4e21024c..c663002892 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,28 @@ name: Release on: release: - types: [published] + types: [ published ] jobs: release: - name: Trigger Build flow - runs-on: ubuntu-latest + name: Trigger ci flow + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v3 - - uses: peter-evans/repository-dispatch@v2 + - + name: Checkout + uses: actions/checkout@v5 + - + name: Get version + id: get-version + shell: pwsh + run: | + # Finding the version from release tag + $VERSION="${{ github.ref }}".Replace("refs/tags/", "") + "version=$VERSION" >> $env:GITHUB_OUTPUT + - + uses: peter-evans/repository-dispatch@v4 with: token: ${{ secrets.RELEASE_GITHUB_TOKEN }} repository: ${{ github.repository }} - event-type: release - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' + event-type: ci-release + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ steps.get-version.outputs.version }}"}' \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000..268a3c6c3f --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,43 @@ +name: Stale Issues +on: + workflow_dispatch: + schedule: + - cron: '0 11 * * *' + +permissions: + # contents: write # only for delete-branch option + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-24.04 + steps: + - uses: actions/stale@v10 + with: + operations-per-run: 100 + # set 'stale' label + stale-issue-label: stale + # remove 'stale' label on update + remove-issue-stale-when-updated: true + labels-to-remove-when-unstale: stale + # only stale the issues + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. After 30 days from now, it will be closed if no further + activity occurs. + close-issue-message: > + This issue was closed because it has been stalled for 30 days with no activity. + Thank you for your contributions + days-before-issue-stale: 90 + days-before-issue-close: 30 + # skip issues that have a milestone + exempt-all-issue-milestones: true + # skip those that are assigned + exempt-all-issue-assignees: true + # skip issues with label 'pinned' + exempt-issue-labels: pinned,security,failing test case,help wanted + + # do not stale PRs + days-before-pr-stale: -1 + days-before-pr-close: -1 diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml new file mode 100644 index 0000000000..f6ad004ed9 --- /dev/null +++ b/.github/workflows/winget.yml @@ -0,0 +1,40 @@ +name: Publish to Winget + +on: + workflow_dispatch: + inputs: + tag-name: + description: 'The git tag name to bump the formula to' + required: true + repository_dispatch: + types: [ publish-release ] + +permissions: + contents: read + +jobs: + homebrew: + permissions: + contents: none + name: Bump winget manifest + runs-on: ubuntu-24.04 + steps: + - name: Get version + id: get-version + shell: pwsh + run: | + $version = "${{ github.event.client_payload.tag }}" + if ($version -eq "") { + $version = "${{ github.event.inputs.tag-name }}" + } + + $url = "https://github.com/GitTools/GitVersion/releases/download/%7B0%7D/gitversion-win-%7B1%7D-%7B0%7D.zip" + $urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join " " + + $run_args = "update GitTools.GitVersion --version $version --urls $urls --token ${{ secrets.RELEASE_GITHUB_TOKEN }} --submit" + "version=$version" >> $env:GITHUB_OUTPUT + "run_args=$run_args" >> $env:GITHUB_OUTPUT + + - uses: michidk/run-komac@v2.1.0 + with: + args: '${{ steps.get-version.outputs.run_args }}' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 53a1d1e91a..dfc424aaaa 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ *.dotCover *.orig *~ +msbuild.binlog ## If you have NuGet Package Restore enabled, uncomment this packages/ @@ -60,7 +61,6 @@ TestResults ClientBin stylecop.* ~$* -*~ *.dbmdl site/ Generated_Code #added for RIA/Silverlight projects @@ -83,10 +83,8 @@ Thumbs.db Desktop.ini _NCrunch_GitVersion -GitVersion.sln.ide/ .vs/ Packages/ -site/ /TestResult.xml ################ @@ -94,8 +92,6 @@ site/ ################ .idea -*.sln.iml - #################### # Visual Studio Code @@ -117,7 +113,8 @@ releaseArtifacts .dotnet artifacts !build/artifacts -src/Docker/**/content +build/docker/nuget +src/PublicAPI.empty.txt !**/*.cake .DS_Store @@ -126,9 +123,13 @@ src/Docker/**/content config.wyam.dll config.wyam.hash config.wyam.packages.xml -/tests/integration/core/build -/tests/integration/full/build +/tests/integration/build docs/output # NPM node_modules + +dogfood/ +new-cli/log.txt + +new-cli/logs/ diff --git a/.gitversion.yml b/.gitversion.yml new file mode 100644 index 0000000000..7c62fc859e --- /dev/null +++ b/.gitversion.yml @@ -0,0 +1,7 @@ +workflow: GitFlow/v1 +mode: ManualDeployment +branches: + main: + label: rc + support: + label: beta diff --git a/.markdownlint.json b/.markdownlint.json index 7ab1720b67..08d535e1cb 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,3 +1,4 @@ { - "MD026": false + "MD026": false, + "MD041": false } diff --git a/.remarkrc.yaml b/.remarkrc.yaml index cf4ada6d5f..381dd0220c 100644 --- a/.remarkrc.yaml +++ b/.remarkrc.yaml @@ -21,7 +21,6 @@ plugins: - remark-lint-list-item-bullet-indent - remark-lint-list-item-content-indent - remark-lint-maximum-heading-length: 120 - - remark-lint-no-auto-link-without-protocol - remark-lint-no-blockquote-without-marker - remark-lint-no-consecutive-blank-lines - remark-lint-no-duplicate-definitions @@ -36,7 +35,6 @@ plugins: - remark-lint-no-heading-content-indent - remark-lint-no-heading-indent - remark-lint-no-heading-like-paragraph - - remark-lint-no-inline-padding - remark-lint-no-literal-urls - remark-lint-no-multiple-toplevel-headings - remark-lint-no-reference-like-url diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index a78b5d04a8..e1ab2c4975 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,9 +1,129 @@ +## v6.2.0 + +* The configuration property `label-number-pattern` was removed. The functionality can be still used by changing the label and the branch name regular expression for pull-request branches. + +## v6.0.0 + +### Platforms + +* Drop support for .NET Framework 4.8, .NET Core 3.1 and .NET 5.0. Changed the project targets to .NET 6.0 or later. + +### Caching + +* Refactor caching system in GitVersion to use json files instead of yaml files. This change is not backwards compatible with the old caching system. + +### Configuration changes: + +* The configuration properties `continuous-delivery-fallback-tag`, `tag-number-pattern`, and `tag` were renamed to `continuous-delivery-fallback-label`, `label-number-pattern`, and `label` respectively. `tag-pre-release-weight` and `tag-prefix` remained as they were as they are referring to a Git tag. + +* When using a commit message that matches **both** `*-version-bump-message` and `no-bump-message`, there is no increment for that commit. In other words, `no-bump-message` now takes precedence over `*-version-bump-message`. + +* The fallback version strategy now returns `0.0.0` and is flagged with `ShouldIncrement` equal to `true`. This yields the version `0.1.0` on the `develop` branch (`IncrementStrategy.Minor` by default) and `0.0.1` on the `main` branch (`IncremetnStrategy.Patch` by default). + +* The current branch (child) inherits its configuration from the source (parent) branch if the `increment` strategy is set to `Inherit`. This makes branch configuration recursive, simpler, more intuitive, more flexible, and more robust. + +* Instead of having a single effective configuration, we now have one effective configuration per branch where the increment strategy is not set to `inherit`. + +* The new implementation of the branch configuration inheritance affects per default only the pull-requests, hotfix and feature branches. In this case the next version will be generated like the child branch is not existing and the commits have been made on the source branch. + * The following example illustrates this behavior. On the feature branch the semantic version `1.1.0-just-a-test.1+2` will now be generated instead of version `1.0.0-just-a-test.1+3` previously: + + ```log + * 1f1cfb4 52 minutes ago (HEAD -> feature/just-a-test) + * 1f9654d 54 minutes ago (release/1.1.0) + * be72411 56 minutes ago (develop) + * 14800ff 58 minutes ago (tag: 1.0.0, main) + ``` + +* A new `unknown` branch magic string has been introduced to give the user the possibility to specify the branch configuration for a branch which is not known. A branch is not known if only the regular expression of the branch configuration with the name `unknown` is matching. Please notice that this branch configuration behaves like any other branch configurations. + +* Additional `fallback` branch configuration properties have been introduced at the root to define base properties which will be inherit to the branch configurations. That means if no other branch configuration in the inheritance line defines the given property the fallback property applies. Notice that the inheritance tree can be controlled using the increment strategy property in the branch configuration section. + * The following example illustrates this behavior. The hotfix branch configuration overrides the main branch configuration and the result overrides the fallback branch configuration. + + ```log + * 1f1cfb4 52 minutes ago (HEAD -> hotfix/just-a-test) + * 14800ff 58 minutes ago (tag: 1.0.0, main) + ``` + +* When overriding the configuration with e.g. GitVersion.yaml the software distinguishes between properties who are not existent and properties who are `null`. This is especially important if the user wants to define branch related configuration which are marked with `increment` strategy `Inherit`. + +* Following root configuration properties have been removed: + * continuous-delivery-fallback-tag + +* A new branch related property with name `track-merge-message` has been introduced. Consider we have a `main` branch and a `release/1.0.0` branch and merge changes from `release/1.0.0` to the main branch. In this scenario the merge message will be interpreted as a next version `1.0.0` when `track-merge-message` is set to `true` otherwise `0.0.1`. + +* The pre-release tags are only considered when they are matching with the label name of the branch. This has an effect on the way how the `CommitCountSource` will be determined. + +* The process of increasing the version with bump message when `CommitMessageIncrementing` is enabled and increment strategy is `None` has been changed. + +* A new configuration property with name `version-in-branch-pattern` has been introduced. This setting only applies on branches where the option `is-release-branch` is set to `true`. Please notice that the branch name needs to be defined after the version number by default (instead of `support/lts-2.0.0` please name the branch like `support/2.0.0-lts`). + +* The `is-release-branch` property of the `hotfix` branch setting has been changed from `false` to `true`. If present the hotfix number will be considered now by default. + +* In the GitHub and the Git Flow workflows the `label` property is by default set to an empty string on the `main` branch. This yields to a pre-release version on `main` with an empty tag. Instead of for instance `1.0.1+46` GitVersion generates the full semantic version `1.0.1-46` instead. This behavior can be changed to generate only stable versions (no pre-release version) with setting the label to `null` (Please keep in mind that the `label` property on root needs to be set to `null` as well, otherwise the fallback applies). This change is caused by issue #2347. + +* The `useBranchName` magic string has been removed. Instead use `{BranchName}` for `label`. + +* The `BranchPrefixToTrim` configuration property has been removed. `RegularExpression` is now used to capture named groups instead. + * Default `RegularExpression` for feature branches is changed from `^features?[\/-]` to `^features?[\/-](?<BranchName>.+)` to support using `{BranchName}` out-of-the-box + * Default `RegularExpression` for unknown branches is changed from `.*` to `(?<BranchName>.+)` to support using `{BranchName}` out-of-the-box + +* The `Mainline` mode and the related implementation has been removed completely. The new `Mainline` version strategy should be used instead. + +* The `Mainline` version strategy doesn't support downgrading the increment for calculating the next version. This is the case if e.g. a bump messages has been defined which is lower than the branch increment. + +* The branch related property `is-mainline` in the configuration system has been renamed to `is-main-branch` + +* The versioning mode has been renamed to deployment mode and consists of following values: + * ManualDeployment (previously ContinuousDelivery) + * ContinuousDelivery (previously ContinuousDeployment) + * ContinuousDeployment (new) + +* At the configuration root level, a new array called `strategies` has been introduced, which can consist of on or more following values: + * ConfiguredNextVersion + * MergeMessage + * TaggedCommit + * TrackReleaseBranches + * VersionInBranchName + * Mainline + +* The initialization wizard has been removed. + +* On the `develop`, `release` and `hotfix` branch the introduced branch related property `prevent-increment.when-current-commit-tagged` has been set to `false` to get the incremented instead of the tagged semantic version. + +* When setting the "ignore commits before" parameter to a future value, an exception will occur if no commits are found on the current branch. This behavior mimics that of an empty repository. + +* On the `GitFlow` workflow the increment property has been changed: + * in branch `release` from `None` to `Minor` and + * in branch `hotfix` from `None` to `Patch` + +* On the `GitHubFlow` workflow the increment property has been changed in branch `release` from `None` to `Patch`. + +* When creating a branch with name `hotfix/next` (by using the `GitFlow` workflow) or `release/next` (by the `GitHubFlow` workflow) the resulting version will yield to a patched version per default. + +* If you have a tag `1.0.0` on `main` and branch from `main` to `release/1.0.1` then the next version number will be `1.1.0` when using the `GitFlow` workflow. This behavior is expected (but different compared to the `GitHubFlow` workflow) because on the `GitFlow` workflow you have an addition branch configuration with name hotfix where `is-release-branch` is set to `true`. That means if you want `1.0.1` as a next version you need to branch to `hotfix/1.0.1` or `hotfix/next`. On the other hand if you use the `GitHubFlow` workflow the next version number will be `1.0.1` because the increment on the `release` branch is set to `Patch`. + +* There is a new configuration parameter `semantic-version-format` with default of `Strict`. The behavior of `Strict` is, that every possible non-semver version e.g. `1.2.3.4` is ignored when trying to calculate the next version. So, if you have three-part and four-part version numbers mixed, it will compute the next version on basis of the last found three-part version number, ignoring all four-part numbers. +This is different compared to v5 where per default it was a `Loose` comparison. + +### Legacy Output Variables + +The following legacy output variables have been removed in this version: + +* `BuildMetaDataPadded` +* `LegacySemVer` +* `LegacySemVerPadded` +* `NuGetVersionV2` +* `NuGetVersion` +* `NuGetPreReleaseTagV2` +* `NuGetPreReleaseTag` +* `CommitsSinceVersionSourcePadded` + ## v5.0.0 -* Version numbers in branches other than `release` branches are no longer - considered as a version source by default. Implemented in [#1541][pr-1541]. -* [#1581][pr-1581] folds `GitTools.Core` back into GitVersion to make - maintaining GitVersion easier. +* Version numbers in branches other than `release` branches are no longer + considered as a version source by default. Implemented in [#1541][pr-1541]. +* [#1581][pr-1581] folds `GitTools.Core` back into GitVersion to make + maintaining GitVersion easier. ## v4.0.0 @@ -12,36 +132,38 @@ When using GitFlow, a few things have changed. Hopefully the new settings just work for you -* `develop` has pre-release tag of `alpha` now, not unstable. -* `develop` will bump as soon as a `release` branch is created. -* Look at the [GitFlow examples][gitflow] for details of how it works now. +* `develop` has pre-release tag of `alpha` now, not unstable. +* `develop` will bump as soon as a `release` branch is created. +* Look at the [GitFlow examples][gitflow] for details of how it works now. ### Configuration Changes -* `GitVersionConfig.yaml` is deprecated in favor of `GitVersion.yml`. -* Regular expressions are no longer used as keys in branch config - * We have named branches, and introduced a `regex` config which you can - override. - * The default keys are: `master`, `develop`, `feature`, `release`, `pull-request`, - `hotfix` and `support` - * Just run `GitVersion.exe` in your project directory and it will tell you - what to change your config keys to - * For example, `dev(elop)?(ment)?$` is now just `develop`, we suggest not - overring regular expressions unless you really want to use a different convention. -* `source-branches` added as a configuration option for branches, it helps - GitVersion pick the correct source branch +* `GitVersionConfig.yaml` is deprecated in favor of `GitVersion.yml`. +* Regular expressions are no longer used as keys in branch config + * We have named branches, and introduced a `regex` config which you can + override. + * The default keys are: `master`, `develop`, `feature`, `release`, `pull-request`, + `hotfix` and `support` + * Just run `GitVersion.exe` in your project directory and it will tell you + what to change your config keys to + * For example, `dev(elop)?(ment)?$` is now just `develop`, we suggest not + overring regular expressions unless you really want to use a different convention. +* `source-branches` added as a configuration option for branches, it helps + GitVersion pick the correct source branch ## v3.0.0 -* NextVersion.txt has been deprecated, only `GitVersionConfig.yaml` is supported -* `AssemblyFileSemVer` variable removed, `AssemblyVersioningScheme` configuration - value makes this variable obsolete -* Variables `ClassicVersion` and `ClassicVersionWithTag` removed -* MSBuild task arguments (`AssemblyVersioningScheme`, `DevelopBranchTag`, - `ReleaseBranchTag`, `TagPrefix`, `NextVersion`) have been removed, use - `GitVersionConfig.yaml` instead -* GitVersionTask's `ReleaseDateAttribute` no longer exists +* NextVersion.txt has been deprecated, only `GitVersionConfig.yaml` is supported +* `AssemblyFileSemVer` variable removed, `AssemblyVersioningScheme` configuration + value makes this variable obsolete +* Variables `ClassicVersion` and `ClassicVersionWithTag` removed +* MSBuild task arguments (`AssemblyVersioningScheme`, `DevelopBranchTag`, + `ReleaseBranchTag`, `TagPrefix`, `NextVersion`) have been removed, use + `GitVersionConfig.yaml` instead +* GitVersionTask's `ReleaseDateAttribute` no longer exists [gitflow]: https://gitversion.net/docs/learn/branching-strategies/gitflow-examples_complete + [pr-1541]: https://github.com/GitTools/GitVersion/pull/1541 + [pr-1581]: https://github.com/GitTools/GitVersion/pull/1581 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20248c6335..ac82b46b95 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,10 @@ We love contributions to get started contributing you might need: -* [Get started with git](http://rogerdudler.github.io/git-guide) -* [How to create a pull request](https://help.github.com/articles/using-pull-requests) -* [An issue to work on](https://github.com/GitTools/GitVersion/labels/up-for-grabs) - We are on [Up for grabs](http://up-for-grabs.net/), our up for grabs issues are tagged `up-for-grabs` -* An understanding of our [architecture](http://gitversion.net/docs/learn/how-it-works#architecture) and how [we write tests](#writing-tests) +* [Get started with git](https://rogerdudler.github.io/git-guide) +* [How to create a pull request](https://help.github.com/articles/using-pull-requests) +* [An issue to work on](https://github.com/GitTools/GitVersion/labels/up-for-grabs) - We are on [Up for grabs](https://up-for-grabs.net/), our up for grabs issues are tagged `up-for-grabs` +* An understanding of our [architecture](https://gitversion.net/docs/learn/how-it-works#architecture) and how [we write tests](#writing-tests) Once you know how to create a pull request and have an issue to work on, just post a comment saying you will work on it. If you end up not being able to complete the task, please post another comment so others can pick it up. @@ -14,16 +14,16 @@ Issues are also welcome, [failing tests](#writing-tests) are even more welcome. ## Contribution Guidelines -* Try to use feature branches rather than developing on main. -* Please include tests covering the change. -* The documentation is stored in the repository under the [`docs`](docs) folder. - Have a look at the [documentation readme file](docs/readme.md) for guidance - on how to improve the documentation and please include documentation updates - with your PR. +* Try to use feature branches rather than developing on main. +* Please include tests covering the change. +* The documentation is stored in the repository under the [`docs`](docs) folder. + Have a look at the [documentation readme file](docs/readme.md) for guidance + on how to improve the documentation and please include documentation updates + with your PR. ## How it works -See [how it works](http://gitversion.net/docs/learn/how-it-works/) in GitVersion's documentation +See [how it works](https://gitversion.net/docs/learn/how-it-works) in GitVersion's documentation ## Writing Tests @@ -39,25 +39,38 @@ Find where your issue would logically sit. Or create a new scenario class if it We are currently using NUnit, so just create a descriptive test method and attribute it with `[Test]` -### 3. Use a fixture +### 3. Create a configuration -We have a few fixtures for different scenarios. +We use a builder pattern to create a configuration. You can use the `GitFlowConfigurationBuilder` or `GitHubConfigurationBuilder` or `EmptyConfigurationBuilder` to create a configuration builder. + +```csharp +var configurationBuilder = GitFlowConfigurationBuilder.New; +``` -* `EmptyRepositoryFixture` - Gives you an empty git repo to start with -* `RemoteRepositoryFixture` - A local repo tracking a test remote repository. The remote repo is available through the `Repository` property, the local is accessible via `LocalRepository` -* `BaseGitFlowRepositoryFixture` - A repo setup for GitFlow (has a develop branch checked out ready to go) +We can then customize the configuration by chaining methods of the builder. At the end we build the configuration. -You can use a fixture by just `using` it. Like this +For example: ```csharp -using (var fixture = new EmptyRepositoryFixture(new Config())) -{ -} +var configuration = configurationBuilder + .WithDeploymentMode(DeploymentMode.ContinuousDeployment) + .WithNextVersion("1.0.0") + .Build(); ``` -### 4. Customize config +### 4. Use a fixture -If you are using non-default configuration just modify the `Config` class before creating the fixture +We have a few fixtures for different scenarios. + +* `EmptyRepositoryFixture` - Gives you an empty git repo to start with +* `RemoteRepositoryFixture` - A local repo tracking a test remote repository. The remote repo is available through the `Repository` property, the local is accessible via `LocalRepository` +* `BaseGitFlowRepositoryFixture` - A repo setup for GitFlow (has a develop branch checked out ready to go) + +You can use a fixture by just `using` it. Like this + +```csharp +using var repo = new EmptyRepositoryFixture(); +``` ### 5. Writing the scenario @@ -72,7 +85,7 @@ fixture.Repository.Checkout("feature-test"); fixture.Repository.MakeACommit(); fixture.Repository.MakeCommits(4); -fixture.AssertFullSemver("1.0.1-test.1+5"); +fixture.AssertFullSemver("1.0.1-test.1-5", configuration); ``` The last line is the most important. `AssertFullSemver` will run GitVersion and assert that the full SemVer it calculates is what you expect. @@ -81,47 +94,49 @@ The last line is the most important. `AssertFullSemver` will run GitVersion and Even better include the fix, but a failing test is a great start -## Build / Release Process - -We use Cake for our build and deployment process. The way the build / release process is setup is: - -1. We build releasable artifacts on AppVeyor -2. Login to AppVeyor -3. Deploy the latest main build - ![docs/input/docs/img/release-1-deploy.png](docs/input/docs/img/release-1-deploy.png) -4. Choose GitVersion release, when you press deploy it will create a _non-released_ GitHub release, this _will not_ create a Git tag. This step is so we can validate the release and release notes before pushing the button. - ![docs/input/docs/img/release-2-deploy.png](docs/input/docs/img/release-2-deploy.png) -5. All the artifacts should upload nicely - ![docs/input/docs/img/release-3-deploy.png](docs/input/docs/img/release-3-deploy.png) -6. Head over to GitHub releases, you should have a draft release, download a copy of the release notes - ![docs/input/docs/img/release-4-deploy.png](docs/input/docs/img/release-4-deploy.png) -7. Edit the release and do the following: - 1. Remove the build metadata from the tag and title (the + and everything after it) - 2. Paste the downloaded release notes in, you can clean them up if you want otherwise there may be closed issues which were questions etc. - 3. Tick the pre-release box if it's pre-release - 4. Press Publish -8. Publishing tags (a git tag) the release commit, this will trigger another appveyor build which only builds tags, this build uses deploy.cake. It downloads the artifacts from that GitHub release, then performs the release - -## Docker - -It is a manual release step after the release now, first download the appropriate ZIP and put into a `releaseArtifacts` folder in the GitVersion repository, then run: - -```bash -docker build . --build-arg GitVersionZip=GitVersion_<VERSION>.zip --tag gittools/gitversion -``` +## Release Process + +We use Cake for our build and deployment process. The way the release process is setup is: + +1. We build releasable artifacts with GitHub Actions +2. We create a milestone for the release if it's not already created. Our milestones are named using the semver. + For example `5.12.0` or `6.0.0-beta.2` +3. We move all the closed issues and closed pull requests that are going to be included in the release to the milestone. +4. We check that all the issues and pull requests that are going to be included in the release have a label assigned, + otherwise it will fail the release. +5. We create a release in the GitHub UI, and create a tag and name it using the milestone name. For example `5.12.0` or `6.0.0-beta.2` +6. We specify if the release is a pre-release or latest release in the GitHub UI. +7. We publish the release. +8. The GitHub Actions will create a GitHub release and publish the artifacts to NuGet, Chocolatey, Docker, Homebrew + and other distribution channels. +9. The issues and pull requests will get updated with message specifying in which release it was included. ## Code Style In order to apply the code style defined by by the `.editorconfig` file you can use [`dotnet-format`](https://github.com/dotnet/format). -1. Install [`dotnet-format`](https://github.com/dotnet/format) as a global tool: +Change to the root folder of the GitVersion repository and use the following command to apply the code style: ```shell -dotnet tool install -g dotnet-format +dotnet format ./src/ --exclude **/AddFormats/ ``` -2. Change to the root folder of the GitVersion repository and use the following command to apply the code style: +## Documentation + +The documentation is stored in the repository under the [`docs`](docs) folder. +Have a look at the [documentation readme file](docs/readme.md) for guidance. + +In order to check locally how the documentation looks like you can use the following command: + +```shell +./build.ps1 -Stage docs -Target PreviewDocs +``` + +## Schemas generation + +If there are changes to the GitVersionVariables or to the GitVersionConfiguration, the following command should be executed to update the schema files: ```shell -dotnet format ./ --folder --exclude **/AddFormats/ --fix-codestyle +./build.ps1 -Stage build -Target BuildPrepare +./build.ps1 -Stage docs -Target GenerateSchemas ``` diff --git a/GitReleaseManager.yml b/GitReleaseManager.yml index 438e184523..8e0b3fb546 100644 --- a/GitReleaseManager.yml +++ b/GitReleaseManager.yml @@ -1,21 +1,37 @@ issue-labels-include: -- Breaking change -- Feature -- Bug -- Improvement -- Documentation -- Dependencies +- breaking change +- bug +- dependencies +- documentation +- feature +- improvement issue-labels-exclude: -- Build +- build issue-labels-alias: -- name: Documentation +- name: breaking change + header: Breaking change + plural: Breaking changes +- name: bug + header: Bug + plural: Bugs +- name: dependencies + header: Dependencies + plural: Dependencies +- name: documentation header: Documentation plural: Documentation +- name: feature + header: Features + plural: Features +- name: improvement + header: Improvements + plural: Improvements create: include-sha-section: true sha-section-heading: "SHA256 Hashes of the release artifacts" sha-section-line-format: "- `{1}\t- {0}`" allow-update-to-published: true + include-contributors: true close: use-issue-comments: true issue-comment: |- diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index 8cb4734ffc..0000000000 --- a/GitVersion.yml +++ /dev/null @@ -1,6 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -branches: - main: - tag: beta - support: - tag: beta diff --git a/README.md b/README.md index 9ffab598c6..202043f4b5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![GitVersion – From git log to SemVer in no time][banner] +# ![GitVersion – From git log to SemVer in no time][banner] Versioning when using Git, solved. GitVersion looks at your git history and works out the [Semantic Version][semver] of the commit being built. @@ -6,19 +6,18 @@ works out the [Semantic Version][semver] of the commit being built. [![Build status][azure-pipeline-badge]][azure-pipeline] [![Build status][github-actions-badge]][github-actions] [![codecov][codecov-badge]][codecov] -[![Gitter][gitter-badge]][gitter] - -| Artifact | Stable | | -| :------------------------- | :----------------------------------------------------------------- | - | -| **GitHub Release** | [![GitHub release][gh-rel-badge]][gh-rel] | -| **GitVersion.Portable** | [![Chocolatey][choco-badge]][choco] | -| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | -| **GitVersion.CommandLine** | [![NuGet][gvcl-badge]][gvcl] | -| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask][gitversiontask] before v5.6.0 | -| **Homebrew** | [![homebrew][brew-badge]][brew] | + +| Artifact | Stable | +|:---------------------------|:-------------------------------------------------------------------| +| **GitHub Release** | [![GitHub release][gh-rel-badge]][gh-rel] | +| **GitVersion.Portable** | [![Chocolatey][choco-badge]][choco] | +| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | +| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | +| **Homebrew** | [![homebrew][brew-badge]][brew] | +| **Winget** | [![winget][winget-badge]][winget] | | **Azure Pipeline Task** | [![Azure Pipeline Task][az-pipeline-task-badge]][az-pipeline-task] | -| **Github Action** | [![Github Action][gh-actions-badge]][gh-actions] | -| **Docker** | [![Docker Pulls][dockerhub-badge]][dockerhub] | +| **Github Action** | [![Github Action][gh-actions-badge]][gh-actions] | +| **Docker** | [![Docker Pulls][dockerhub-badge]][dockerhub] | ## Compatibility @@ -26,13 +25,13 @@ GitVersion works on Windows, Linux, and Mac. ## Quick Links -* [Documentation][docs] -* [Contributing][contribute] -* [Why GitVersion][why] -* [Usage][usage] -* [How it works][how] -* [FAQ][faq] -* [Who is using GitVersion][who] +* [Documentation][docs] +* [Contributing][contribute] +* [Why GitVersion][why] +* [Usage][usage] +* [How it works][how] +* [FAQ][faq] +* [Who is using GitVersion][who] ## GitVersion in action! @@ -40,8 +39,8 @@ GitVersion works on Windows, Linux, and Mac. You are seeing: -* Pull requests being built as pre-release builds -* A branch called `release-1.0.0` producing beta v1 packages +* Pull requests being built as pre-release builds +* A branch called `release-1.0.0` producing beta v1 packages ## Icon @@ -49,42 +48,74 @@ You are seeing: designed by [David Chapman][app-icon-author] from The Noun Project. -[semver]: http://semver.org -[gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge -[gitter-badge]: https://badges.gitter.im/Join+Chat.svg -[azure-pipeline]: https://dev.azure.com/GitTools/GitVersion/_build/latest?definitionId=1 -[azure-pipeline-badge]: https://dev.azure.com/GitTools/GitVersion/_apis/build/status/GitTools.GitVersion -[github-actions]: https://github.com/GitTools/GitVersion/actions -[github-actions-badge]: https://github.com/GitTools/GitVersion/workflows/Build/badge.svg -[codecov]: https://codecov.io/gh/GitTools/GitVersion -[codecov-badge]: https://codecov.io/gh/GitTools/GitVersion/branch/main/graph/badge.svg -[docs]: https://gitversion.net/docs/ -[gh-rel]: https://github.com/GitTools/GitVersion/releases/latest -[gh-rel-badge]: https://img.shields.io/github/release/gittools/gitversion.svg?logo=github -[choco]: https://chocolatey.org/packages/GitVersion.Portable -[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg?logo=nuget -[gvt]: https://www.nuget.org/packages/GitVersion.MsBuild -[gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget -[gitversiontask]: https://www.nuget.org/packages/GitVersionTask/ -[gvcl]: https://www.nuget.org/packages/GitVersion.CommandLine -[gvcl-badge]: https://img.shields.io/nuget/v/GitVersion.CommandLine.svg?logo=nuget -[gvgt]: https://www.nuget.org/packages/GitVersion.Tool -[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget -[brew]: https://formulae.brew.sh/formula/gitversion -[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg?logo=homebrew -[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ -[dockerhub-badge]: https://img.shields.io/docker/pulls/gittools/gitversion.svg?logo=docker -[az-pipeline-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools -[az-pipeline-task-badge]: https://img.shields.io/badge/marketplace-gittools.gittools-blue?logo=azure-pipelines -[gh-actions]: https://github.com/marketplace/actions/gittools -[gh-actions-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=github -[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md -[why]: https://gitversion.net/docs/learn/why -[usage]: https://gitversion.net/docs/usage -[how]: https://gitversion.net/docs/learn/how-it-works -[faq]: https://gitversion.net/docs/learn/faq -[who]: https://gitversion.net/docs/learn/who -[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png -[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png -[app-icon]: https://thenounproject.com/term/tree/13389/ -[app-icon-author]: http://thenounproject.com/david.chapman +[semver]: https://semver.org + +[azure-pipeline]: https://dev.azure.com/GitTools/GitVersion/_build/latest?definitionId=1 + +[azure-pipeline-badge]: https://dev.azure.com/GitTools/GitVersion/_apis/build/status/GitTools.GitVersion + +[github-actions]: https://github.com/GitTools/GitVersion/actions + +[github-actions-badge]: https://github.com/GitTools/GitVersion/workflows/CI/badge.svg + +[codecov]: https://codecov.io/gh/GitTools/GitVersion + +[codecov-badge]: https://codecov.io/gh/GitTools/GitVersion/branch/main/graph/badge.svg + +[docs]: https://gitversion.net/docs/ + +[gh-rel]: https://github.com/GitTools/GitVersion/releases/latest + +[gh-rel-badge]: https://img.shields.io/github/release/gittools/gitversion.svg?logo=github + +[choco]: https://chocolatey.org/packages/GitVersion.Portable + +[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg?logo=nuget + +[gvt]: https://www.nuget.org/packages/GitVersion.MsBuild + +[gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget + +[gvgt]: https://www.nuget.org/packages/GitVersion.Tool + +[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget + +[brew]: https://formulae.brew.sh/formula/gitversion + +[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg?logo=homebrew + +[winget]: https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/GitTools/GitVersion + +[winget-badge]: https://img.shields.io/winget/v/GitTools.GitVersion.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMeSURBVHgBrVS9axRREJ/3ds+QRPLtBxolYkRJYSNiKZGoaGdtI+gfIGhCCEgupb2llonYCmJhYZMDaysxClHwQriYXKI5xezOOPM+dt9uLlWyd4/3MW9+M/Obmacg+F486JolgCrs41Osf/95a87vdSjcL3g7jDjc1Dew6Itcl5VSQGTVyUn2/tTu3dvqhZGK1u95OQIH8y3vII7fqn5aNhTFSt87QHD5RhympWi58RciZUMTOtDyYffhgkprL6QAms9I9MmmV319MzXL+yoQWoHw7A34M/4jYS5zcpIzXqM7K+jLUFhVS68fkT+UIU6hUyyCOWVEk2raA9SUAeV4MWFqN2A9tYKit15OJc/DSMMoFOQ6MRoD9lIYib+IzkPd0Q/nrk8ZJ768ewpJq5Hd81FmkWcGuNGMAUxA5nCIl1aGkCYpdJ+6ApWuQah0D5p1mhbvp4xBfu9lacIR8AYyejDj0EZu98hzkqQZJQIuQykq5IqCHDgubQ5yvotGfF7CqOSaOOX1oFwUYa7Ysdh6iUEV5OWZe4aOMnsmgBK+Unl1hZUTFoJGspyR80pm2QvvfaMTcGZimhM8wGdY8Ex39sPpqw/h6MU7Lh9o9U20eU5jTBIXFphIvCcdQ+dh+PJdA3j2xgw0vn3Moog6B2D05hPoOHwEeoYvwernGqS/vu/qG7lv+6BQ89bQen0Jmmt16Bk4Doe4ck6OjbOn9rU9MXYtA9laX4HW9hZUJOmlfMhPZwnMSi6xycFt+PBqBrZ+1gu9IVT40Vz7AYvz3But1UyfEPOC4Fnnh5gdSl9odqc3akLt5TQbWXHy3IiA1xi8L9qASIM5SznxkvywF7RvCD/IC3kdaWKAJiwuTBaMbHJUtflJdmAdYk0uqUkQhWOCcTSVKErDbpYqYIB+iWThMfzeWIFNQ8ukMVyJwEWMAcVFPLX47Db5ms3q15WieYpds/3bSaGx+cc8WUO9FQZXbR/E8isck9AC1LbE8obhixHBsb6Ka16bh7KBwnPtZp0gzvnWNxSlSd4oJi85nxBQkVHjGxRts/nkksFK5/4DGLPsj2fzroIAAAAASUVORK5CYII= + +[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ + +[dockerhub-badge]: https://img.shields.io/docker/pulls/gittools/gitversion.svg?logo=docker + +[az-pipeline-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools + +[az-pipeline-task-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=data:application/pdf;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABJlJREFUWIXFVk1sVFUU/u6dNzOd6fx2ftoGFNIfNa1prCW4ALHsGolIYmjQGH/CwmUXBl2gK0OihoUYE5G40GAEQ7QJ0IobQSEkLYLFH4QabSpUptPpTDs/773pzLvHRTvDm3lvpjOtxpOcTN69557vu+eec+YwIsL/KdK/4aRzz8WupubA4xKDrRZ7LS8yYxPZ4/RDX27dBLa8PLGnu7fjKxBYPee2ijgH8PG6CGwZvOptfbD1pNDqAwcAboUbWOcTeDb4R8CYfS1ZJLTl3zUT2Lr/xkvhVt82Ekb4TSGG9o12OOwc0cQSfp3OQVZLgySwDgLtg1e9nR0tR02w0bPZgofbXcVvt9OKjWGBr8cXIavcwIBjDbKhxTcCMLsgQK92K6GrzQUilKhN4ujeZCuxNUSg8/kxj1coq5aRsAdeCLUEtpm1D4+TVczGkM8Govy9BQYqEuh78WKPx2a9TmioCs4ZRyDYhErNS1YJlfqarGol58RKCCQAWNJYu8Sq5zJjDI3uAAioCJKQgWhCRchvvMjkXypKcmalCviycwuVv2e5Wi0OcHtDVRshGL77SUE0oRbfXxOEa5MpTEVLbQsiAUBeA6pFwMIscPgCFW+ul7TKMHpFQdClQJIYFtMEJWfMDEMSmpXUcnQApzsIgJkSaHJzLGQ0CKEDIYa5ZNGDqd98Lq/qCOQhhHlFNthcsNjsECYMgz4JPncj/F6BqZk08lrNPZEW4okLRQJCWAjceNjCOBzeJtPoNPuscLud0AhgxOF2cswntdWRibKxO9F9M9/03ywSAPEY9DUKAIzB5Q4CbKVgdRLySnC5HCi04WRaQawGcDWTvRyfS+2aGu5bKMIUavOBfZeGALxX2LBZHPAEmw1OQn4LvK5GEJZfN5mWEU3kDXZ6EUS5ZDQxdONkz4fle0zfHNr2fv8qZ+wwANgtjXCHwgZwXxn47CrgWVkej0eiA9NntyfM9ll5V2vbe+ktgN5gYLccDf5Jp8/zFACE/ZLh5rOJXEVgIkJ6fuHAbyd6DlcjaEj9P09tfxOE19Ss49FfjnfvlhfTX4R8ZeApGZF4zvCnU9AlRUE8cgdJFv+kanjMIlAuTx+c6gmGAtcz2XvglW5ORMgkYlCzGRAj5HMiNHO6P1bNf9V5YODgdGtvR/AKGEMkQZiNpRGp8OZLiozUQgyi0ORrbAkcAD44m3royHDq7SNfJh/Tb547tOnu3zH5MxKUi8bme/+Yip8QgqBXTRBSsSgW4rPIUx6CqKg1EyANnYzjdWblveUGnx5o3v/zzdv3jxzaPHHr8+7nMsnkGVq54JKiYP7ubWSyaQiQIRdqkZpGspF3uyIAwAZP2VqV8H25jAJihCWRqTqNS5JzVRp1zYRhJbxLI3pE0TIrK3VP4wapayacPfPEsBD0iv6dq2kyubrP0ggQnn3/dLp0KSd+HHrGM1b4nhvdeSzw5Hkw4KN6yNdGALQDhB0lS5y9A2BMvzQ/uvNY08AFDpCht+ulQZOzNREQsjLOnY7dZgbcit/N1uPn+o96B769BkLAbJ/Ap+Ln+9Nme3pZtRP+1/IPO814AQ1WwqwAAAAASUVORK5CYII= + +[gh-actions]: https://github.com/marketplace/actions/gittools + +[gh-actions-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=github + +[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md + +[why]: https://gitversion.net/docs/learn/why + +[usage]: https://gitversion.net/docs/usage + +[how]: https://gitversion.net/docs/learn/how-it-works + +[faq]: https://gitversion.net/docs/learn/faq + +[who]: https://gitversion.net/docs/learn/who + +[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png + +[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png + +[app-icon]: https://thenounproject.com/term/tree/13389/ + +[app-icon-author]: https://thenounproject.com/david.chapman diff --git a/SECURITY.md b/SECURITY.md index 6e0e279f39..8f44809e2f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,28 +2,28 @@ ## Supported Versions -| Version | Supported | -| --------: | :----------------: | -| 5.x | :white_check_mark: | -| ⋜ 5.x | :x: | +| Version | Supported | +|--------:|:--------------------:| +| 6.x | :white\_check\_mark: | +| < 6.x | :x: | ## Reporting Security Issues ⚠ **Please do not report security vulnerabilities through public GitHub issues.** ⚠ -Instead, please send an email to [security@gitversion.net](mailto:security@gitversion.net). +Instead, please send an email to <security@gitversion.net>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: -* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) -* Full paths of source file(s) related to the manifestation of the issue -* The location of the affected source code (tag/branch/commit or direct URL) -* Any special configuration required to reproduce the issue -* Step-by-step instructions to reproduce the issue -* Proof-of-concept or exploit code (if possible) -* Impact of the issue, including how an attacker might exploit the issue +* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 5f6d29654a..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,124 +0,0 @@ -trigger: - branches: - include: - - main - - fix/* - - feature/* -pr: - branches: - include: - - main - -variables: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true' - DOTNET_CLI_TELEMETRY_OPTOUT: 'true' - -stages: -- stage: Build - displayName: 'Build' - jobs: - - job: Build - strategy: - matrix: - 'Windows': - VM_IMAGE: 'windows-latest' - 'Linux': - VM_IMAGE: 'ubuntu-latest' - 'macOS': - VM_IMAGE: 'macOS-latest' - pool: - vmImage: $(VM_IMAGE) - steps: - - template: .azurepipelines/build.yml -- stage: Test - displayName: 'Unit Test' - dependsOn: [] - jobs: - - job: Test - strategy: - matrix: - 'Windows': - VM_IMAGE: 'windows-latest' - 'Linux': - VM_IMAGE: 'ubuntu-latest' - 'macOS': - VM_IMAGE: 'macOS-latest' - pool: - vmImage: $(VM_IMAGE) - steps: - - template: .azurepipelines/test.yml - -- stage: Artifact_Linux_Test - displayName: 'Artifacts Linux test' - dependsOn: - - Build - - Test - condition: succeeded() - jobs: - - template: .azurepipelines/artifacts-linux-test.yml - parameters: - name: Linux - vmImage: 'ubuntu-latest' - distros: [ alpine.3.12-x64, centos.7-x64, centos.8-x64, debian.9-x64, debian.10-x64, fedora.33-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ] - dotnetVersions: [ '3.1', '5.0' ] - -- stage: Artifact_Windows_Test - displayName: 'Artifacts Windows test' - dependsOn: - - Build - - Test - condition: succeeded() - jobs: - - template: .azurepipelines/artifacts-windows-test.yml - -- stage: Docker - displayName: 'Docker Build & Test' - dependsOn: - - Artifact_Linux_Test - - Artifact_Windows_Test - condition: succeeded() - jobs: - - template: .azurepipelines/docker.yml - parameters: - name: Linux - vmImage: 'ubuntu-latest' - distros: [ alpine.3.12-x64, centos.7-x64, centos.8-x64, debian.9-x64, debian.10-x64, fedora.33-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ] - dotnetVersions: [ '3.1', '5.0' ] - -- stage: Publish - displayName: 'Publish' - dependsOn: - - Artifact_Linux_Test - - Artifact_Windows_Test - condition: succeeded() - jobs: - - job: Publish - pool: - vmImage: windows-latest - strategy: - matrix: - CI: - TASK_NAME: 'CI' - NuGet: - TASK_NAME: 'NuGet' - Chocolatey: - TASK_NAME: 'Chocolatey' - # Documentation: - # TASK_NAME: 'Documentation' - steps: - - template: .azurepipelines/publish.yml - parameters: - taskName: $(TASK_NAME) - -- stage: Release - displayName: 'Release' - dependsOn: - - Docker - - Publish - condition: succeeded() - jobs: - - job: Release - pool: - vmImage: windows-latest - steps: - - template: .azurepipelines/release.yml diff --git a/build.ps1 b/build.ps1 old mode 100644 new mode 100755 index 65007bc6be..0962436bef --- a/build.ps1 +++ b/build.ps1 @@ -1,4 +1,4 @@ -#!/usr/bin/pwsh +#!/usr/bin/env pwsh <# .PARAMETER Stage The build stage to execute. @@ -43,13 +43,30 @@ $Arguments = @{ exclusive=$Exclusive; nuget_useinprocessclient=$true; }.GetEnumerator() | ForEach-Object { - if ($_.value -ne "") { "--{0}=`"{1}`"" -f $_.key, $_.value } + if ($($_.Key -ceq "dryrun") -or ($_.Key -ceq "exclusive")) { + if ($_.Value -eq $true) { + # switches must not be assigned true or false, but must be passed to indicate true. + "--{0}" -f $_.Key + } + } + else { + if ($_.Value -cne "") { + if ($_.Value -as [string] -contains " ") { + $_.Value = "$($_.Value)" # if it contains spaces, enclose it. + } + "--{0}={1}" -f $_.Key, $_.Value + } + } }; +$Arguments | Join-String -Separator " " | Write-Verbose + # Start Cake Write-Host "Running build stage $Stage..." -& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments $ScriptArgs +$cmdline = "& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments $ScriptArgs" +Write-Verbose $cmdline +Invoke-Command -ScriptBlock ([scriptblock]::Create($cmdline)) if ($env:APPVEYOR) { $host.SetShouldExit($LASTEXITCODE) diff --git a/build/.run/Artifacts DotnetTool Test.run.xml b/build/.run/Artifacts DotnetTool Test.run.xml index b79166a340..ffb49db890 100644 --- a/build/.run/Artifacts DotnetTool Test.run.xml +++ b/build/.run/Artifacts DotnetTool Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts DotnetTool Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsDotnetToolTest --arch=amd64 --docker_dotnetversion=6.0 --docker_distro=debian.11" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> + <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsDotnetToolTest --arch=amd64 --dotnet_version=lts-latest --docker_distro=distro-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Artifacts Executable Test.run.xml b/build/.run/Artifacts Executable Test.run.xml index 260a2b5727..85538064f0 100644 --- a/build/.run/Artifacts Executable Test.run.xml +++ b/build/.run/Artifacts Executable Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts Executable Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsExecutableTest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Artifacts MsBuildCore Test.run.xml b/build/.run/Artifacts MsBuildCore Test.run.xml index 1a96f6dce6..8478f08108 100644 --- a/build/.run/Artifacts MsBuildCore Test.run.xml +++ b/build/.run/Artifacts MsBuildCore Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts MsBuildCore Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsMsBuildCoreTest --arch=amd64 --docker_dotnetversion=6.0 --docker_distro=alpine.3.12-x64" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> + <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsMsBuildCoreTest --arch=amd64 --dotnet_version=lts-latest --docker_distro=distro-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Artifacts MsBuildFull Test.run.xml b/build/.run/Artifacts MsBuildFull Test.run.xml index 1720ff0093..537874156c 100644 --- a/build/.run/Artifacts MsBuildFull Test.run.xml +++ b/build/.run/Artifacts MsBuildFull Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts MsBuildFull Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsMsBuildFullTest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Artifacts Native Test.run.xml b/build/.run/Artifacts Native Test.run.xml index 6f799f09dd..b7ea118f83 100644 --- a/build/.run/Artifacts Native Test.run.xml +++ b/build/.run/Artifacts Native Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts Native Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsNativeTest --arch=amd64 --docker_dotnetversion=6.0 --docker_distro=alpine.3.12-x64" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> + <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsNativeTest --arch=amd64 --dotnet_version=lts-latest --docker_distro=distro-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Artifacts Prepare.run.xml b/build/.run/Artifacts Prepare.run.xml index abfa44087a..43c9e42042 100644 --- a/build/.run/Artifacts Prepare.run.xml +++ b/build/.run/Artifacts Prepare.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts Prepare" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsPrepare --docker_dotnetversion=6.0 --docker_distro=alpine.3.12-x64" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> + <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsPrepare --dotnet_version=lts-latest --docker_distro=distro-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Artifacts Test.run.xml b/build/.run/Artifacts Test.run.xml index 00cbcedda2..b9807ea4a4 100644 --- a/build/.run/Artifacts Test.run.xml +++ b/build/.run/Artifacts Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Artifacts Test" type="DotNetProject" factoryName=".NET Project" folderName="Artifacts"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsTest --docker_dotnetversion=6.0 --docker_distro=alpine.3.12-x64" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> + <option name="PROGRAM_PARAMETERS" value="--target=ArtifactsTest --dotnet_version=lts-latest --docker_distro=distro-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Build Docs.run.xml b/build/.run/Build Docs.run.xml index eec6929a0e..43431e74bb 100644 --- a/build/.run/Build Docs.run.xml +++ b/build/.run/Build Docs.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Build Docs" type="DotNetProject" factoryName=".NET Project" folderName="Docs"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs" /> <option name="PROGRAM_PARAMETERS" value="--target=BuildDocs" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/UnitTest (5.0).run.xml b/build/.run/Build Prepare.run.xml similarity index 65% rename from build/.run/UnitTest (5.0).run.xml rename to build/.run/Build Prepare.run.xml index 4b83f40ccd..2e820c42fe 100644 --- a/build/.run/UnitTest (5.0).run.xml +++ b/build/.run/Build Prepare.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="UnitTest (6.0)" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=UnitTest --dotnet_target=net6.0" /> + <configuration default="false" name="Build Prepare" type="DotNetProject" factoryName=".NET Project"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> + <option name="PROGRAM_PARAMETERS" value="--target=BuildPrepare" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Build.run.xml b/build/.run/Build.run.xml index 7a45af8c8f..e178484aae 100644 --- a/build/.run/Build.run.xml +++ b/build/.run/Build.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Build" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=Build" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Clean.run.xml b/build/.run/Clean.run.xml index d1878a9df9..d1c8841cc2 100644 --- a/build/.run/Clean.run.xml +++ b/build/.run/Clean.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Clean" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=Clean" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Code Format.run.xml b/build/.run/Code Format.run.xml index 07647ad72e..560927676b 100644 --- a/build/.run/Code Format.run.xml +++ b/build/.run/Code Format.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Code Format" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=CodeFormat --verbosity=diagnostic" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Default Artifacts.run.xml b/build/.run/Default Artifacts.run.xml index 399102d9b7..fe2a2c7a99 100644 --- a/build/.run/Default Artifacts.run.xml +++ b/build/.run/Default Artifacts.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Default Artifacts" type="DotNetProject" factoryName=".NET Project" folderName="Default"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts-test.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/artifacts" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Default Build.run.xml b/build/.run/Default Build.run.xml index 03bb44b7cd..6abaa465f3 100644 --- a/build/.run/Default Build.run.xml +++ b/build/.run/Default Build.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Default Build" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Default Chores.run.xml b/build/.run/Default Config.run.xml similarity index 63% rename from build/.run/Default Chores.run.xml rename to build/.run/Default Config.run.xml index f2ba56aa12..1d2cb9fab3 100644 --- a/build/.run/Default Chores.run.xml +++ b/build/.run/Default Config.run.xml @@ -1,20 +1,23 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="Default Chores" type="DotNetProject" factoryName=".NET Project" folderName="Default"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/chores.exe" /> +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="Default Config" type="DotNetProject" factoryName=".NET Project" folderName="Default"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/config" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> - <option name="PROJECT_PATH" value="$PROJECT_DIR$/chores/chores.csproj" /> + <option name="PROJECT_PATH" value="$PROJECT_DIR$/config/config.csproj" /> <option name="PROJECT_EXE_PATH_TRACKING" value="1" /> <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Default Docker.run.xml b/build/.run/Default Docker.run.xml index 7b8485d1fe..461aaa85bc 100644 --- a/build/.run/Default Docker.run.xml +++ b/build/.run/Default Docker.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Default Docker" type="DotNetProject" factoryName=".NET Project" folderName="Default"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Default Docs.run.xml b/build/.run/Default Docs.run.xml index 0e9cf652a7..b4ea267b7b 100644 --- a/build/.run/Default Docs.run.xml +++ b/build/.run/Default Docs.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Default Docs" type="DotNetProject" factoryName=".NET Project" folderName="Default"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Default Publish.run.xml b/build/.run/Default Publish.run.xml index c4edb33072..03f349b259 100644 --- a/build/.run/Default Publish.run.xml +++ b/build/.run/Default Publish.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Default Publish" type="DotNetProject" factoryName=".NET Project" folderName="Default"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Docker Build.run.xml b/build/.run/Docker Build.run.xml index 198f574003..b2da1eadd5 100644 --- a/build/.run/Docker Build.run.xml +++ b/build/.run/Docker Build.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Docker Build" type="DotNetProject" factoryName=".NET Project" folderName="Docker"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=DockerBuild --arch amd64 --docker_dotnetversion=6.0 --docker_distro=debian.11" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> + <option name="PROGRAM_PARAMETERS" value="--target=DockerBuild --arch=amd64 --arch=arm64 --dotnet_version=lts-latest --docker_distro=debian.12 --verbosity=diagnostic" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Docker Manifest.run.xml b/build/.run/Docker Manifest.run.xml index eb994a062c..deb625e045 100644 --- a/build/.run/Docker Manifest.run.xml +++ b/build/.run/Docker Manifest.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Docker Manifest" type="DotNetProject" factoryName=".NET Project" folderName="Docker"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=DockerManifest --docker_dotnetversion=6.0 --docker_distro=debian.11" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> + <option name="PROGRAM_PARAMETERS" value="--target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=lts-latest --docker_distro=debian.12" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Docker Publish.run.xml b/build/.run/Docker Publish.run.xml index dbdebe935f..25a5f9d7a7 100644 --- a/build/.run/Docker Publish.run.xml +++ b/build/.run/Docker Publish.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Docker Publish" type="DotNetProject" factoryName=".NET Project" folderName="Docker"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=DockerPublish --arch amd64 --docker_dotnetversion=6.0 --docker_distro=debian.11" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> + <option name="PROGRAM_PARAMETERS" value="--target=DockerPublish --arch=amd64 --arch=arm64 --dotnet_version=lts-latest --docker_distro=debian.12 --verbosity=diagnostic" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Docker Test.run.xml b/build/.run/Docker Test.run.xml index 09f0c21d44..f7664d6759 100644 --- a/build/.run/Docker Test.run.xml +++ b/build/.run/Docker Test.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Docker Test" type="DotNetProject" factoryName=".NET Project" folderName="Docker"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=DockerTest --arch amd64 --docker_dotnetversion=6.0 --docker_distro=debian.11" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> + <option name="PROGRAM_PARAMETERS" value="--target=DockerTest --arch=amd64 --dotnet_version=lts-latest --docker_distro=debian.12" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/DockerHub Readme Publish.run.xml b/build/.run/DockerHub Readme Publish.run.xml new file mode 100644 index 0000000000..4ac6c97d64 --- /dev/null +++ b/build/.run/DockerHub Readme Publish.run.xml @@ -0,0 +1,25 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="DockerHub Readme Publish" type="DotNetProject" factoryName=".NET Project" folderName="Docker"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docker" /> + <option name="PROGRAM_PARAMETERS" value="--target=DockerHubReadmePublish" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> + <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOCKER_PASSWORD" value="" /> + <env name="DOCKER_USERNAME" value="" /> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> + <option name="USE_EXTERNAL_CONSOLE" value="0" /> + <option name="USE_MONO" value="0" /> + <option name="RUNTIME_ARGUMENTS" value="" /> + <option name="PROJECT_PATH" value="$PROJECT_DIR$/docker/docker.csproj" /> + <option name="PROJECT_EXE_PATH_TRACKING" value="1" /> + <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> + <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> + <option name="PROJECT_KIND" value="DotNetCore" /> + <option name="PROJECT_TFM" value="net9.0" /> + <method v="2"> + <option name="Build" /> + </method> + </configuration> +</component> \ No newline at end of file diff --git a/build/.run/Generate Schemas.run.xml b/build/.run/Generate Schemas.run.xml new file mode 100644 index 0000000000..e009ddc54a --- /dev/null +++ b/build/.run/Generate Schemas.run.xml @@ -0,0 +1,24 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="Generate Schemas" type="DotNetProject" factoryName=".NET Project" folderName="Docs"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs" /> + <option name="PROGRAM_PARAMETERS" value="--target=GenerateSchemas" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> + <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> + <option name="USE_EXTERNAL_CONSOLE" value="0" /> + <option name="USE_MONO" value="0" /> + <option name="RUNTIME_ARGUMENTS" value="" /> + <option name="PROJECT_PATH" value="$PROJECT_DIR$/docs/docs.csproj" /> + <option name="PROJECT_EXE_PATH_TRACKING" value="1" /> + <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> + <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> + <option name="PROJECT_KIND" value="DotNetCore" /> + <option name="PROJECT_TFM" value="net9.0" /> + <method v="2"> + <option name="Build" /> + <option name="RunConfigurationTask" enabled="false" run_configuration_name="Build Prepare" run_configuration_type="DotNetProject" /> + </method> + </configuration> +</component> \ No newline at end of file diff --git a/build/.run/Package Archive.run.xml b/build/.run/Package Archive.run.xml index 2133c7a4d1..fa6cca1b56 100644 --- a/build/.run/Package Archive.run.xml +++ b/build/.run/Package Archive.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Package Archive" type="DotNetProject" factoryName=".NET Project" folderName="Package"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=PackageArchive" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,7 +15,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/Package Chocolatey.run.xml b/build/.run/Package Chocolatey.run.xml index c51905b1cb..88b86ef25c 100644 --- a/build/.run/Package Chocolatey.run.xml +++ b/build/.run/Package Chocolatey.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Package Chocolatey" type="DotNetProject" factoryName=".NET Project" folderName="Package"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=PackageChocolatey" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Package Nuget.run.xml b/build/.run/Package Nuget.run.xml index efdbd8bef8..841a3a4fc8 100644 --- a/build/.run/Package Nuget.run.xml +++ b/build/.run/Package Nuget.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Package Nuget" type="DotNetProject" factoryName=".NET Project" folderName="Package"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=PackageNuget" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/PackagePrepare.run.xml b/build/.run/Package Prepare.run.xml similarity index 76% rename from build/.run/PackagePrepare.run.xml rename to build/.run/Package Prepare.run.xml index 225f94e90d..9c72d75e52 100644 --- a/build/.run/PackagePrepare.run.xml +++ b/build/.run/Package Prepare.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Package Prepare" type="DotNetProject" factoryName=".NET Project" folderName="Package"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=PackagePrepare" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Package.run.xml b/build/.run/Package.run.xml index 0cc953e5ca..ecb147deb9 100644 --- a/build/.run/Package.run.xml +++ b/build/.run/Package.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Package" type="DotNetProject" factoryName=".NET Project" folderName="Package"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="--target=Package" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Preview Docs.run.xml b/build/.run/Preview Docs.run.xml index 9068da7671..d0bd79cb9e 100644 --- a/build/.run/Preview Docs.run.xml +++ b/build/.run/Preview Docs.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Preview Docs" type="DotNetProject" factoryName=".NET Project" folderName="Docs"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs" /> <option name="PROGRAM_PARAMETERS" value="--target=PreviewDocs" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Publish Chocolatey.run.xml b/build/.run/Publish Chocolatey.run.xml index 641d36acea..1dae103da1 100644 --- a/build/.run/Publish Chocolatey.run.xml +++ b/build/.run/Publish Chocolatey.run.xml @@ -1,11 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Publish Chocolatey" type="DotNetProject" factoryName=".NET Project" folderName="Publish"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish" /> <option name="PROGRAM_PARAMETERS" value="--target=PublishChocolatey" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> <envs> <env name="NUGET_API_KEY" value="" /> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> @@ -15,9 +16,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Publish Docs.run.xml b/build/.run/Publish Docs.run.xml index 7df9af5017..22ceca648b 100644 --- a/build/.run/Publish Docs.run.xml +++ b/build/.run/Publish Docs.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Publish Docs" type="DotNetProject" factoryName=".NET Project" folderName="Docs"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/docs" /> <option name="PROGRAM_PARAMETERS" value="--target=PublishDocs --force" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Publish Nuget.run.xml b/build/.run/Publish Nuget.run.xml index 2b4af69eb4..1e1bb97cb2 100644 --- a/build/.run/Publish Nuget.run.xml +++ b/build/.run/Publish Nuget.run.xml @@ -1,11 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Publish Nuget" type="DotNetProject" factoryName=".NET Project" folderName="Publish"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/publish" /> <option name="PROGRAM_PARAMETERS" value="--target=PublishNuget" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> <envs> <env name="NUGET_API_KEY" value="" /> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> @@ -15,9 +16,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Publish Release.run.xml b/build/.run/Publish Release.run.xml index ff99047ca0..a6b1e66b5a 100644 --- a/build/.run/Publish Release.run.xml +++ b/build/.run/Publish Release.run.xml @@ -1,9 +1,12 @@ <component name="ProjectRunConfigurationManager"> <configuration default="false" name="Publish Release" type="DotNetProject" factoryName=".NET Project" folderName="Release"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/release.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/release" /> <option name="PROGRAM_PARAMETERS" value="--target=PublishRelease" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/PublishCoverage.run.xml b/build/.run/PublishCoverage.run.xml new file mode 100644 index 0000000000..1b2c752e41 --- /dev/null +++ b/build/.run/PublishCoverage.run.xml @@ -0,0 +1,24 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="PublishCoverage" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> + <option name="PROGRAM_PARAMETERS" value="--target=PublishCoverage --dotnet_version=lts-latest" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> + <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="CODECOV_TOKEN" value="<token>" /> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> + <option name="USE_EXTERNAL_CONSOLE" value="0" /> + <option name="USE_MONO" value="0" /> + <option name="RUNTIME_ARGUMENTS" value="" /> + <option name="PROJECT_PATH" value="$PROJECT_DIR$/build/build.csproj" /> + <option name="PROJECT_EXE_PATH_TRACKING" value="1" /> + <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> + <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> + <option name="PROJECT_KIND" value="DotNetCore" /> + <option name="PROJECT_TFM" value="net9.0" /> + <method v="2"> + <option name="Build" /> + </method> + </configuration> +</component> diff --git a/build/.run/Tools Install.run.xml b/build/.run/SetMatrix.run.xml similarity index 56% rename from build/.run/Tools Install.run.xml rename to build/.run/SetMatrix.run.xml index a93ddf593d..2ee4920e9a 100644 --- a/build/.run/Tools Install.run.xml +++ b/build/.run/SetMatrix.run.xml @@ -1,20 +1,20 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="Tools Install" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/chores.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ToolsInstall" /> +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="SetMatrix" type="DotNetProject" factoryName=".NET Project" folderName="Config"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/config" /> + <option name="PROGRAM_PARAMETERS" value="--target=SetMatrix" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> - <option name="PROJECT_PATH" value="$PROJECT_DIR$/chores/chores.csproj" /> + <option name="PROJECT_PATH" value="$PROJECT_DIR$/config/config.csproj" /> <option name="PROJECT_EXE_PATH_TRACKING" value="1" /> <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/Test.run.xml b/build/.run/Test.run.xml index d5e9c3b1eb..2a2db6d92e 100644 --- a/build/.run/Test.run.xml +++ b/build/.run/Test.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Test" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> <option name="PROGRAM_PARAMETERS" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/UnitTest (3.1).run.xml b/build/.run/UnitTest (8.0).run.xml similarity index 73% rename from build/.run/UnitTest (3.1).run.xml rename to build/.run/UnitTest (8.0).run.xml index c9d30bd0c4..2c39db1e1c 100644 --- a/build/.run/UnitTest (3.1).run.xml +++ b/build/.run/UnitTest (8.0).run.xml @@ -1,7 +1,7 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="UnitTest (3.1)" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=UnitTest --dotnet_target=netcoreapp3.1" /> + <configuration default="false" name="UnitTest (Lts Latest)" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> + <option name="PROGRAM_PARAMETERS" value="--target=UnitTest --dotnet_version=lts-latest" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> <option name="USE_EXTERNAL_CONSOLE" value="0" /> @@ -12,7 +12,7 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> diff --git a/build/.run/UnitTest (4.8).run.xml b/build/.run/UnitTest (9.0).run.xml similarity index 69% rename from build/.run/UnitTest (4.8).run.xml rename to build/.run/UnitTest (9.0).run.xml index bc1829bc99..e9702af0a9 100644 --- a/build/.run/UnitTest (4.8).run.xml +++ b/build/.run/UnitTest (9.0).run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="UnitTest (4.8)" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=UnitTest --dotnet_target=net48" /> +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="UnitTest (9.0)" type="DotNetProject" factoryName=".NET Project" folderName="Unit Test"> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> + <option name="PROGRAM_PARAMETERS" value="--target=UnitTest --dotnet_version=9.0" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/.run/ValidateVersion.run.xml b/build/.run/Validate Version.run.xml similarity index 75% rename from build/.run/ValidateVersion.run.xml rename to build/.run/Validate Version.run.xml index 3f0dfe14e3..527061c25e 100644 --- a/build/.run/ValidateVersion.run.xml +++ b/build/.run/Validate Version.run.xml @@ -1,9 +1,12 @@ -<component name="ProjectRunConfigurationManager"> +<component name="ProjectRunConfigurationManager"> <configuration default="false" name="Validate Version" type="DotNetProject" factoryName=".NET Project"> - <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build.exe" /> - <option name="PROGRAM_PARAMETERS" value="--target=ValidateVersion" /> + <option name="EXE_PATH" value="$PROJECT_DIR$/../run/build" /> + <option name="PROGRAM_PARAMETERS" value="--target=ValidateVersion " /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." /> <option name="PASS_PARENT_ENVS" value="1" /> + <envs> + <env name="DOTNET_ROLL_FORWARD" value="Major" /> + </envs> <option name="USE_EXTERNAL_CONSOLE" value="0" /> <option name="USE_MONO" value="0" /> <option name="RUNTIME_ARGUMENTS" value="" /> @@ -12,9 +15,9 @@ <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> <option name="PROJECT_KIND" value="DotNetCore" /> - <option name="PROJECT_TFM" value="net6.0" /> + <option name="PROJECT_TFM" value="net9.0" /> <method v="2"> <option name="Build" /> </method> </configuration> -</component> +</component> \ No newline at end of file diff --git a/build/CI.sln b/build/CI.sln deleted file mode 100644 index 7489a61f65..0000000000 --- a/build/CI.sln +++ /dev/null @@ -1,64 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{EC2C1EC4-BE56-4CAE-A3EE-4A67EED6BC6C}" -ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Packages.props = Directory.Packages.props - ..\dotnet-tools.json = ..\dotnet-tools.json -EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj", "{1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "common", "common\common.csproj", "{8B04D233-2891-44D8-A7D2-0EAFD38F1F70}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chores", "chores\chores.csproj", "{E8346E70-2A34-460E-90FD-DFD5B15FD476}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "artifacts", "artifacts\artifacts.csproj", "{7162B10E-40A1-44E3-AE5E-E7D1755AADAD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docker", "docker\docker.csproj", "{E32EA41F-4614-4890-8C4D-4E0E2BC3B5D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "publish", "publish\publish.csproj", "{EC09227C-01E6-49E2-A0EF-B91E0CDCA75A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs", "docs\docs.csproj", "{C85F4443-5A37-4230-BC0C-C4436149AAEB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "release", "release\release.csproj", "{8DAB65D8-57E8-4185-96FC-8A7C7373FC23}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}.Release|Any CPU.Build.0 = Release|Any CPU - {8B04D233-2891-44D8-A7D2-0EAFD38F1F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B04D233-2891-44D8-A7D2-0EAFD38F1F70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B04D233-2891-44D8-A7D2-0EAFD38F1F70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B04D233-2891-44D8-A7D2-0EAFD38F1F70}.Release|Any CPU.Build.0 = Release|Any CPU - {E8346E70-2A34-460E-90FD-DFD5B15FD476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8346E70-2A34-460E-90FD-DFD5B15FD476}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8346E70-2A34-460E-90FD-DFD5B15FD476}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8346E70-2A34-460E-90FD-DFD5B15FD476}.Release|Any CPU.Build.0 = Release|Any CPU - {7162B10E-40A1-44E3-AE5E-E7D1755AADAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7162B10E-40A1-44E3-AE5E-E7D1755AADAD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7162B10E-40A1-44E3-AE5E-E7D1755AADAD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7162B10E-40A1-44E3-AE5E-E7D1755AADAD}.Release|Any CPU.Build.0 = Release|Any CPU - {E32EA41F-4614-4890-8C4D-4E0E2BC3B5D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E32EA41F-4614-4890-8C4D-4E0E2BC3B5D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E32EA41F-4614-4890-8C4D-4E0E2BC3B5D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E32EA41F-4614-4890-8C4D-4E0E2BC3B5D1}.Release|Any CPU.Build.0 = Release|Any CPU - {EC09227C-01E6-49E2-A0EF-B91E0CDCA75A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EC09227C-01E6-49E2-A0EF-B91E0CDCA75A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EC09227C-01E6-49E2-A0EF-B91E0CDCA75A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EC09227C-01E6-49E2-A0EF-B91E0CDCA75A}.Release|Any CPU.Build.0 = Release|Any CPU - {C85F4443-5A37-4230-BC0C-C4436149AAEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C85F4443-5A37-4230-BC0C-C4436149AAEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C85F4443-5A37-4230-BC0C-C4436149AAEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C85F4443-5A37-4230-BC0C-C4436149AAEB}.Release|Any CPU.Build.0 = Release|Any CPU - {8DAB65D8-57E8-4185-96FC-8A7C7373FC23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DAB65D8-57E8-4185-96FC-8A7C7373FC23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DAB65D8-57E8-4185-96FC-8A7C7373FC23}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DAB65D8-57E8-4185-96FC-8A7C7373FC23}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/build/CI.sln.DotSettings b/build/CI.sln.DotSettings index f37a772647..98aa4a4f86 100644 --- a/build/CI.sln.DotSettings +++ b/build/CI.sln.DotSettings @@ -1,4 +1,5 @@ -<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> +<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String> <s:Boolean x:Key="/Default/UserDictionary/Words/=Addins/@EntryIndexedValue">True</s:Boolean> - <s:Boolean x:Key="/Default/UserDictionary/Words/=endgroup/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file + <s:Boolean x:Key="/Default/UserDictionary/Words/=endgroup/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/UserDictionary/Words/=opencontainers/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file diff --git a/build/CI.slnx b/build/CI.slnx new file mode 100644 index 0000000000..15846bf628 --- /dev/null +++ b/build/CI.slnx @@ -0,0 +1,70 @@ +<Solution> + <Folder Name="/actions/" /> + <Folder Name="/actions/artifacts-attest/"> + <File Path="../.github/actions/artifacts-attest/action.yml" /> + </Folder> + <Folder Name="/actions/artifacts-restore/"> + <File Path="../.github/actions/artifacts-restore/action.yml" /> + </Folder> + <Folder Name="/actions/cache-restore/"> + <File Path="../.github/actions/cache-restore/action.yml" /> + </Folder> + <Folder Name="/actions/docker-manifests/"> + <File Path="../.github/actions/docker-manifests/action.yml" /> + </Folder> + <Folder Name="/actions/docker-publish/"> + <File Path="../.github/actions/docker-publish/action.yml" /> + </Folder> + <Folder Name="/actions/docker-test/"> + <File Path="../.github/actions/docker-test/action.yml" /> + </Folder> + <Folder Name="/scripts/"> + <File Path="../tests/scripts/test-global-tool.sh" /> + <File Path="../tests/scripts/test-msbuild-task.sh" /> + <File Path="../tests/scripts/test-native-tool.sh" /> + </Folder> + <Folder Name="/sln/"> + <File Path="../.config/dotnet-tools.json" /> + <File Path="../.gitignore" /> + <File Path="../.remarkrc.yaml" /> + <File Path="../global.json" /> + <File Path="../qodana.yaml" /> + <File Path="../package.json" /> + <File Path="../src/mark-shipped.ps1" /> + <File Path="Directory.Build.props" /> + <File Path="Directory.Packages.props" /> + </Folder> + <Folder Name="/workflows/"> + <File Path="../.github/dependabot.yml" /> + <File Path="../.github/workflows/ci.yml" /> + <File Path="../.github/workflows/codeql-analysis.yml" /> + <File Path="../.github/workflows/docs.yml" /> + <File Path="../.github/workflows/format.yml" /> + <File Path="../.github/workflows/homebrew.yml" /> + <File Path="../.github/workflows/mkdocs.yml" /> + <File Path="../.github/workflows/new-cli.yml" /> + <File Path="../.github/workflows/public-api.yml" /> + <File Path="../.github/workflows/release.yml" /> + <File Path="../.github/workflows/stale.yml" /> + <File Path="../.github/workflows/winget.yml" /> + <File Path="../.github/workflows/qodana_analysis.yml" /> + </Folder> + <Folder Name="/workflows/_/"> + <File Path="../.github/workflows/_artifacts_linux.yml" /> + <File Path="../.github/workflows/_artifacts_windows.yml" /> + <File Path="../.github/workflows/_build.yml" /> + <File Path="../.github/workflows/_docker.yml" /> + <File Path="../.github/workflows/_docker_manifests.yml" /> + <File Path="../.github/workflows/_prepare.yml" /> + <File Path="../.github/workflows/_publish.yml" /> + <File Path="../.github/workflows/_unit_tests.yml" /> + </Folder> + <Project Path="artifacts/artifacts.csproj" /> + <Project Path="build/build.csproj" /> + <Project Path="common/common.csproj" /> + <Project Path="config/config.csproj" /> + <Project Path="docker/docker.csproj" /> + <Project Path="docs/docs.csproj" /> + <Project Path="publish/publish.csproj" /> + <Project Path="release/release.csproj" /> +</Solution> diff --git a/build/Directory.Build.props b/build/Directory.Build.props index cf7017fab7..9b2f07e792 100644 --- a/build/Directory.Build.props +++ b/build/Directory.Build.props @@ -1,12 +1,12 @@ -<Project> +<Project> <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net9.0</TargetFramework> <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> <OutputPath>..\..\run\</OutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <Nullable>enable</Nullable> - <LangVersion>10</LangVersion> + <LangVersion>latest</LangVersion> <NoWarn>NU1604</NoWarn> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> @@ -37,5 +37,13 @@ <ItemGroup> <Using Include="Common.Utilities.Constants" Alias="Constants"/> </ItemGroup> + <ItemGroup> + <PackageReference Include="Cake.Compression" /> + <PackageReference Include="Cake.Frosting" /> + <PackageReference Include="Cake.Incubator" /> + <PackageReference Include="Cake.DotNetLocalTools.Module" /> + + <PackageReference Include="Cake.Docker" /> + </ItemGroup> </Project> diff --git a/build/Directory.Packages.props b/build/Directory.Packages.props index e035cee9d4..fc7aee8992 100644 --- a/build/Directory.Packages.props +++ b/build/Directory.Packages.props @@ -1,12 +1,20 @@ -<Project> - <ItemGroup> - <PackageReference Include="Cake.Common" Version="2.2.0" /> - <PackageReference Include="Cake.Compression" Version="0.2.6" /> - <PackageReference Include="Cake.Frosting" Version="2.2.0" /> - <PackageReference Include="Cake.Incubator" Version="7.0.0" /> - <PackageReference Include="Cake.DotNetLocalTools.Module" Version="1.0.2" /> - - <PackageReference Include="Cake.Docker" Version="1.1.2" /> - - </ItemGroup> -</Project> +<Project> + <PropertyGroup> + <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> + </PropertyGroup> + <ItemGroup> + <PackageVersion Include="Cake.Compression" Version="0.4.0" /> + <PackageVersion Include="Cake.Codecov" Version="3.0.0" /> + <PackageVersion Include="Cake.Coverlet" Version="5.1.1" /> + <PackageVersion Include="Cake.Frosting" Version="5.1.0" /> + <PackageVersion Include="Cake.Frosting.Git" Version="5.0.1" /> + <PackageVersion Include="Cake.Http" Version="5.1.0" /> + <PackageVersion Include="Cake.Incubator" Version="10.0.0" /> + <PackageVersion Include="Cake.DotNetLocalTools.Module" Version="3.0.12" /> + <PackageVersion Include="Cake.Docker" Version="1.3.0" /> + <PackageVersion Include="Cake.Json" Version="7.0.1" /> + <PackageVersion Include="Cake.Npx" Version="1.7.0" /> + <PackageVersion Include="Cake.Wyam" Version="2.2.14" /> + <PackageVersion Include="xunit.assert" Version="2.9.3" /> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/build/artifacts/BuildContext.cs b/build/artifacts/BuildContext.cs index 7976846434..6a1c373d95 100644 --- a/build/artifacts/BuildContext.cs +++ b/build/artifacts/BuildContext.cs @@ -1,16 +1,8 @@ -using Common.Utilities; +using Common.Context; namespace Artifacts; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : DockerBuildContext(context) { - public string MsBuildConfiguration { get; set; } = "Release"; - - public bool IsDockerOnLinux { get; set; } - - public IEnumerable<DockerImage> Images { get; set; } = new List<DockerImage>(); - - public BuildContext(ICakeContext context) : base(context) - { - } + public string MsBuildConfiguration { get; } = Constants.DefaultConfiguration; } diff --git a/build/artifacts/BuildLifetime.cs b/build/artifacts/BuildLifetime.cs index 3b404a6700..5b74fe09c0 100644 --- a/build/artifacts/BuildLifetime.cs +++ b/build/artifacts/BuildLifetime.cs @@ -1,36 +1,8 @@ -using Common.Utilities; +using Common.Lifetime; namespace Artifacts; -public class BuildLifetime : BuildLifetimeBase<BuildContext> +public class BuildLifetime : DockerBuildLifetime<BuildContext> { - public override void Setup(BuildContext context) - { - base.Setup(context); - - context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", string.Empty) == "linux"; - - var architecture = context.HasArgument(Arguments.Architecture) ? context.Argument<Architecture>(Arguments.Architecture) : (Architecture?)null; - var dockerRegistry = context.Argument(Arguments.DockerRegistry, DockerRegistry.DockerHub); - var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower(); - var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower(); - - var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion }; - var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro }; - var archs = architecture.HasValue ? new[] { architecture.Value } : Constants.ArchToBuild; - - var registry = dockerRegistry == DockerRegistry.DockerHub ? Constants.DockerHubRegistry : Constants.GitHubContainerRegistry; - context.Images = from version in versions - from distro in distros - from arch in archs - select new DockerImage(distro, version, arch, registry, true); - - context.StartGroup("Build Setup"); - - LogBuildInformation(context); - - context.Information("IsDockerOnLinux: {0}", context.IsDockerOnLinux); - context.Information($"Building for Version: {dotnetVersion}, Distro: {dockerDistro}"); - context.EndGroup(); - } + protected override bool UseBaseImage => true; } diff --git a/build/artifacts/Program.cs b/build/artifacts/Program.cs index 7b88e63bd5..332d44d6b1 100644 --- a/build/artifacts/Program.cs +++ b/build/artifacts/Program.cs @@ -7,5 +7,4 @@ .UseLifetime<BuildLifetime>() .UseTaskLifetime<BuildTaskLifetime>() .UseRootDirectory() - .InstallToolsFromRootManifest() .Run(args); diff --git a/build/artifacts/Tasks/ArtifactsDotnetToolTest.cs b/build/artifacts/Tasks/ArtifactsDotnetToolTest.cs index dc802c4cc6..ebe194aaf6 100644 --- a/build/artifacts/Tasks/ArtifactsDotnetToolTest.cs +++ b/build/artifacts/Tasks/ArtifactsDotnetToolTest.cs @@ -4,9 +4,9 @@ namespace Artifacts.Tasks; [TaskName(nameof(ArtifactsDotnetToolTest))] [TaskDescription("Tests the dotnet global tool in docker container")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] [IsDependentOn(typeof(ArtifactsPrepare))] public class ArtifactsDotnetToolTest : FrostingTask<BuildContext> { @@ -27,7 +27,7 @@ public override void Run(BuildContext context) foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; + if (context.SkipImageTesting(dockerImage)) continue; var cmd = $"{rootPrefix}/scripts/test-global-tool.sh --version {version} --nugetPath {rootPrefix}/nuget --repoPath {rootPrefix}/repo"; diff --git a/build/artifacts/Tasks/ArtifactsExecutableTest.cs b/build/artifacts/Tasks/ArtifactsExecutableTest.cs index 8127f1762a..894f3ba331 100644 --- a/build/artifacts/Tasks/ArtifactsExecutableTest.cs +++ b/build/artifacts/Tasks/ArtifactsExecutableTest.cs @@ -20,7 +20,7 @@ public override void Run(BuildContext context) { var packagesToTest = new[] { - "GitVersion.Commandline", "GitVersion.Portable" + "GitVersion.Portable" }; foreach (var packageToTest in packagesToTest) { @@ -36,10 +36,10 @@ private static void PackageTest(BuildContextBase context, string packageToTest) context.NuGetInstall(packageToTest, new NuGetInstallSettings { - Source = new[] - { + Source = + [ context.MakeAbsolute(Paths.Nuget).FullPath - }, + ], ExcludeVersion = true, Prerelease = true, OutputDirectory = outputDirectory @@ -47,10 +47,7 @@ private static void PackageTest(BuildContextBase context, string packageToTest) var settings = new GitVersionSettings { - OutputTypes = new HashSet<GitVersionOutput> - { - GitVersionOutput.Json - }, + OutputTypes = [GitVersionOutput.Json], ToolPath = outputDirectory.Combine(packageToTest).Combine("tools").CombineWithFilePath("gitversion.exe").FullPath }; var gitVersion = context.GitVersion(settings); diff --git a/build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs b/build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs index 28736a3717..982351ed32 100644 --- a/build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs +++ b/build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs @@ -4,9 +4,9 @@ namespace Artifacts.Tasks; [TaskName(nameof(ArtifactsMsBuildCoreTest))] [TaskDescription("Tests the msbuild package in docker container")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] [IsDependentOn(typeof(ArtifactsPrepare))] public class ArtifactsMsBuildCoreTest : FrostingTask<BuildContext> { @@ -14,7 +14,6 @@ public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.IsDockerOnLinux, $"{nameof(ArtifactsMsBuildCoreTest)} works only on Docker on Linux agents."); - return shouldRun; } @@ -27,21 +26,9 @@ public override void Run(BuildContext context) foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; - - string distro = dockerImage.Distro; - string targetFramework = dockerImage.TargetFramework; - - if (targetFramework == Constants.Version31 && distro == Constants.Centos8) continue; // TODO check why this one fails - targetFramework = targetFramework switch - { - Constants.Version31 => $"netcoreapp{targetFramework}", - Constants.Version50 => $"net{targetFramework}", - Constants.Version60 => $"net{targetFramework}", - _ => targetFramework - }; + if (context.SkipImageTesting(dockerImage)) continue; - var cmd = $"{rootPrefix}/scripts/test-msbuild-task.sh --version {version} --nugetPath {rootPrefix}/nuget --repoPath {rootPrefix}/repo/tests/integration/core --targetframework {targetFramework}"; + var cmd = $"{rootPrefix}/scripts/test-msbuild-task.sh --version {version} --nugetPath {rootPrefix}/nuget --repoPath {rootPrefix}/repo/tests/integration --targetframework net{dockerImage.TargetFramework}"; context.DockerTestArtifact(dockerImage, cmd); } diff --git a/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs b/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs index 2799314e62..f4d34e623e 100644 --- a/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs +++ b/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs @@ -22,42 +22,25 @@ public override void Run(BuildContext context) var nugetSource = context.MakeAbsolute(Paths.Nuget).FullPath; - context.Information("\nTesting msbuild task with dotnet build (for .net core)\n"); - var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion50, Constants.NetVersion60 }; - foreach (var framework in frameworks) + context.Information("\nTesting msbuild task with dotnet build\n"); + foreach (var netVersion in Constants.DotnetVersions) { + var framework = $"net{netVersion}"; var dotnetMsBuildSettings = new DotNetMSBuildSettings(); - dotnetMsBuildSettings.WithProperty("TargetFrameworks", framework); - dotnetMsBuildSettings.WithProperty("TargetFramework", framework); + dotnetMsBuildSettings.SetTargetFramework(framework); dotnetMsBuildSettings.WithProperty("GitVersionMsBuildVersion", version); - var projPath = context.MakeAbsolute(Paths.Integration.Combine("core")); + var projPath = context.MakeAbsolute(Paths.Integration); context.DotNetBuild(projPath.FullPath, new DotNetBuildSettings { Verbosity = DotNetVerbosity.Minimal, Configuration = context.MsBuildConfiguration, MSBuildSettings = dotnetMsBuildSettings, - Sources = new[] { nugetSource } + Sources = [nugetSource] }); - var netcoreExe = Paths.Integration.Combine("core").Combine("build").Combine(framework).CombineWithFilePath("app.dll"); - context.ValidateOutput("dotnet", netcoreExe.FullPath, context.Version.GitVersion.FullSemVer); + var exe = Paths.Integration.Combine("build").Combine(framework).CombineWithFilePath("app.dll"); + context.ValidateOutput("dotnet", exe.FullPath, context.Version.GitVersion.FullSemVer); } - - context.Information("\nTesting msbuild task with msbuild (for full framework)\n"); - - var msBuildSettings = new MSBuildSettings - { - Verbosity = Verbosity.Minimal, - Restore = true - }; - - msBuildSettings.WithProperty("GitVersionMsBuildVersion", version); - msBuildSettings.WithProperty("RestoreSource", nugetSource); - - context.MSBuild("./tests/integration/full", msBuildSettings); - - var fullExe = Paths.Integration.Combine("full").Combine("build").CombineWithFilePath("app.exe"); - context.ValidateOutput(fullExe.FullPath, null, context.Version.GitVersion.FullSemVer); } } diff --git a/build/artifacts/Tasks/ArtifactsNativeTest.cs b/build/artifacts/Tasks/ArtifactsNativeTest.cs index c4234b8687..2812ab76f2 100644 --- a/build/artifacts/Tasks/ArtifactsNativeTest.cs +++ b/build/artifacts/Tasks/ArtifactsNativeTest.cs @@ -4,9 +4,9 @@ namespace Artifacts.Tasks; [TaskName(nameof(ArtifactsNativeTest))] [TaskDescription("Tests the native executables in docker container")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] [IsDependentOn(typeof(ArtifactsPrepare))] public class ArtifactsNativeTest : FrostingTask<BuildContext> { @@ -27,13 +27,15 @@ public override void Run(BuildContext context) foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; + if (context.SkipImageTesting(dockerImage)) continue; - var runtime = dockerImage.Architecture == Architecture.Amd64 ? "linux-x64" : "linux-arm64"; + var runtime = "linux"; if (dockerImage.Distro.StartsWith("alpine")) { - runtime = "linux-musl-x64"; + runtime += "-musl"; } + runtime += dockerImage.Architecture == Architecture.Amd64 ? "-x64" : "-arm64"; + var cmd = $"{rootPrefix}/scripts/test-native-tool.sh --version {version} --repoPath {rootPrefix}/repo --runtime {runtime}"; diff --git a/build/artifacts/Tasks/ArtifactsPrepare.cs b/build/artifacts/Tasks/ArtifactsPrepare.cs index c9075d42da..2e55089920 100644 --- a/build/artifacts/Tasks/ArtifactsPrepare.cs +++ b/build/artifacts/Tasks/ArtifactsPrepare.cs @@ -4,9 +4,9 @@ namespace Artifacts.Tasks; [TaskName(nameof(ArtifactsPrepare))] [TaskDescription("Pulls the docker images needed for testing the artifacts")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] public class ArtifactsPrepare : FrostingTask<BuildContext> { public override bool ShouldRun(BuildContext context) @@ -21,7 +21,7 @@ public override void Run(BuildContext context) { foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; + if (context.SkipImageTesting(dockerImage)) continue; context.DockerPullImage(dockerImage); } } diff --git a/build/artifacts/Tasks/ArtifactsTest.cs b/build/artifacts/Tasks/ArtifactsTest.cs index 36cd154310..763aeb45e9 100644 --- a/build/artifacts/Tasks/ArtifactsTest.cs +++ b/build/artifacts/Tasks/ArtifactsTest.cs @@ -4,9 +4,9 @@ namespace Artifacts.Tasks; [TaskName(nameof(ArtifactsTest))] [TaskDescription("Tests packages in docker container")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] [IsDependentOn(typeof(ArtifactsNativeTest))] [IsDependentOn(typeof(ArtifactsDotnetToolTest))] [IsDependentOn(typeof(ArtifactsMsBuildCoreTest))] diff --git a/build/artifacts/Tasks/Default.cs b/build/artifacts/Tasks/Default.cs index 69d435c477..702a604678 100644 --- a/build/artifacts/Tasks/Default.cs +++ b/build/artifacts/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Artifacts.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/build/Build.csproj.DotSettings b/build/build/Build.csproj.DotSettings index f2dffae8e9..aea068abc3 100644 --- a/build/build/Build.csproj.DotSettings +++ b/build/build/Build.csproj.DotSettings @@ -1,3 +1,3 @@ -<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> +<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=tasks_005Cpackage/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=tasks_005Ctest/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file diff --git a/build/build/BuildContext.cs b/build/build/BuildContext.cs index b36f9149c6..2580b482fd 100644 --- a/build/build/BuildContext.cs +++ b/build/build/BuildContext.cs @@ -3,15 +3,15 @@ namespace Build; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : BuildContextBase(context) { - public string MsBuildConfiguration { get; set; } = "Release"; + public string MsBuildConfiguration { get; set; } = Constants.DefaultConfiguration; public readonly Dictionary<PlatformFamily, string[]> NativeRuntimes = new() { - [PlatformFamily.Windows] = new[] { "win-x64", "win-x86", "win-arm64" }, - [PlatformFamily.Linux] = new[] { "linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64" }, - [PlatformFamily.OSX] = new[] { "osx-x64", "osx-arm64" }, + [PlatformFamily.Windows] = ["win-x64", "win-arm64"], + [PlatformFamily.Linux] = ["linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64"], + [PlatformFamily.OSX] = ["osx-x64", "osx-arm64"], }; public bool EnabledUnitTests { get; set; } @@ -19,8 +19,4 @@ public class BuildContext : BuildContextBase public Credentials? Credentials { get; set; } public DotNetMSBuildSettings MsBuildSettings { get; } = new(); - - public BuildContext(ICakeContext context) : base(context) - { - } } diff --git a/build/build/BuildLifetime.cs b/build/build/BuildLifetime.cs index 10dd99c4b4..5f0f0dc943 100644 --- a/build/build/BuildLifetime.cs +++ b/build/build/BuildLifetime.cs @@ -1,31 +1,36 @@ using Build.Utilities; +using Common.Lifetime; using Common.Utilities; namespace Build; public class BuildLifetime : BuildLifetimeBase<BuildContext> { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { - base.Setup(context); + base.Setup(context, info); - context.MsBuildConfiguration = context.Argument(Arguments.Configuration, "Release"); + context.MsBuildConfiguration = context.Argument(Arguments.Configuration, Constants.DefaultConfiguration); context.EnabledUnitTests = context.IsEnabled(EnvVars.EnabledUnitTests); context.Credentials = Credentials.GetCredentials(context); - SetMsBuildSettingsVersion(context); + if (context.Version is not null) + { + SetMsBuildSettingsVersion(context); + } context.StartGroup("Build Setup"); LogBuildInformation(context); - context.Information("Configuration: {0}", context.MsBuildConfiguration); + context.Information($"Configuration: {context.MsBuildConfiguration}"); context.EndGroup(); } private static void SetMsBuildSettingsVersion(BuildContext context) { var msBuildSettings = context.MsBuildSettings; - var version = context.Version!; + ArgumentNullException.ThrowIfNull(context.Version); + var version = context.Version; msBuildSettings.SetVersion(version.SemVersion); msBuildSettings.SetAssemblyVersion(version.Version); @@ -37,5 +42,8 @@ private static void SetMsBuildSettingsVersion(BuildContext context) msBuildSettings.WithProperty("RepositoryCommit", version.GitVersion.Sha); msBuildSettings.WithProperty("NoPackageAnalysis", "true"); msBuildSettings.WithProperty("UseSharedCompilation", "false"); + + // https://github.com/dotnet/docs/issues/37674 + msBuildSettings.WithProperty("IncludeSourceRevisionInInformationalVersion", "false"); } } diff --git a/build/build/Program.cs b/build/build/Program.cs index 2ff100dcab..815289da5e 100644 --- a/build/build/Program.cs +++ b/build/build/Program.cs @@ -7,6 +7,5 @@ .UseLifetime<BuildLifetime>() .UseTaskLifetime<BuildTaskLifetime>() .UseRootDirectory() - .InstallToolsFromRootManifest() - .InstallNugetTool(Tools.NugetCmd, Tools.Versions[Tools.NugetCmd]) + .InstallNugetTool(Tools.CodecovUploaderCmd, Tools.Versions[Tools.CodecovUploaderCmd]) .Run(args); diff --git a/build/build/Tasks/Build.cs b/build/build/Tasks/Build.cs index ecd13f75d3..15b716ca5f 100644 --- a/build/build/Tasks/Build.cs +++ b/build/build/Tasks/Build.cs @@ -5,18 +5,18 @@ namespace Build.Tasks; [TaskName(nameof(Build))] [TaskDescription("Builds the solution")] [IsDependentOn(typeof(Clean))] -[IsDependentOn(typeof(CodeFormat))] +// [IsDependentOn(typeof(CodeFormat))] public sealed class Build : FrostingTask<BuildContext> { public override void Run(BuildContext context) { context.Information("Builds solution..."); - const string sln = "./src/GitVersion.sln"; + const string sln = "./src/GitVersion.slnx"; context.DotNetRestore(sln, new DotNetRestoreSettings { Verbosity = DotNetVerbosity.Minimal, - Sources = new[] { "https://api.nuget.org/v3/index.json" }, + Sources = [Constants.NugetOrgUrl], MSBuildSettings = context.MsBuildSettings }); diff --git a/build/build/Tasks/BuildPrepare.cs b/build/build/Tasks/BuildPrepare.cs new file mode 100644 index 0000000000..4eff4d38c7 --- /dev/null +++ b/build/build/Tasks/BuildPrepare.cs @@ -0,0 +1,42 @@ +using Common.Utilities; + +namespace Build.Tasks; + +[TaskName(nameof(BuildPrepare))] +[TaskDescription("Builds the solution")] +[IsDependentOn(typeof(Clean))] +public sealed class BuildPrepare : FrostingTask<BuildContext> +{ + public override void Run(BuildContext context) + { + context.Information("Builds solution..."); + + const string sln = "./src/GitVersion.slnx"; + context.DotNetRestore(sln, + new() + { + Verbosity = DotNetVerbosity.Minimal, + Sources = [Constants.NugetOrgUrl], + }); + + context.DotNetBuild("./src/GitVersion.App/GitVersion.App.csproj", + new() + { + Verbosity = DotNetVerbosity.Minimal, + Configuration = Constants.DefaultConfiguration, + OutputDirectory = Paths.Tools.Combine("gitversion"), + Framework = $"net{Constants.DotnetLtsLatest}", + NoRestore = true, + }); + + context.DotNetBuild("./src/GitVersion.Schema/GitVersion.Schema.csproj", + new() + { + Verbosity = DotNetVerbosity.Minimal, + Configuration = Constants.DefaultConfiguration, + OutputDirectory = Paths.Tools.Combine("schema"), + Framework = $"net{Constants.DotnetLtsLatest}", + NoRestore = true, + }); + } +} diff --git a/build/build/Tasks/Default.cs b/build/build/Tasks/Default.cs index 57b473ee58..42a99a37ee 100644 --- a/build/build/Tasks/Default.cs +++ b/build/build/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Build.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/build/Tasks/Package.cs b/build/build/Tasks/Package.cs index 00386c7320..38fefc0f80 100644 --- a/build/build/Tasks/Package.cs +++ b/build/build/Tasks/Package.cs @@ -5,6 +5,4 @@ namespace Build.Tasks; [IsDependentOn(typeof(PackageChocolatey))] [IsDependentOn(typeof(PackageNuget))] [IsDependentOn(typeof(PackageArchive))] -public class Package : FrostingTask<BuildContext> -{ -} +public class Package : FrostingTask<BuildContext>; diff --git a/build/build/Tasks/Package/PackageArchive.cs b/build/build/Tasks/Package/PackageArchive.cs index dadde1c36e..9e79b8852b 100644 --- a/build/build/Tasks/Package/PackageArchive.cs +++ b/build/build/Tasks/Package/PackageArchive.cs @@ -12,7 +12,7 @@ public override void Run(BuildContext context) { context.EnsureDirectoryExists(Paths.Native); - var platform = context.Environment.Platform.Family; + var platform = context.Platform; var runtimes = context.NativeRuntimes[platform]; foreach (var runtime in runtimes) diff --git a/build/build/Tasks/Package/PackageChocolatey.cs b/build/build/Tasks/Package/PackageChocolatey.cs index 81c3dcec60..22f68b5b01 100644 --- a/build/build/Tasks/Package/PackageChocolatey.cs +++ b/build/build/Tasks/Package/PackageChocolatey.cs @@ -21,21 +21,51 @@ public override void Run(BuildContext context) { context.EnsureDirectoryExists(Paths.Nuget); - var portableNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.Portable.nuspec"); - if (!context.FileExists(portableNuspecFile)) - return; - var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinPortable).FullPath; + var portableSettings = GetChocolateyPackSettings(context, "GitVersion.Portable"); + portableSettings.Files = context.GetFiles(artifactPath + "/**/*.*") + .Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) + .ToArray(); + + context.ChocolateyPack(portableSettings); + + var metaPackageSettings = GetChocolateyPackSettings(context, "GitVersion"); + metaPackageSettings.Files = context.GetFiles(artifactPath + "/**/*.txt") + .Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) + .ToArray(); + + metaPackageSettings.Dependencies = + [ + new ChocolateyNuSpecDependency { Id = "GitVersion.Portable", Version = context.Version?.ChocolateyVersion } + ]; + + context.ChocolateyPack(metaPackageSettings); + } + + private static ChocolateyPackSettings GetChocolateyPackSettings(BuildContextBase context, string id) + { var chocolateySettings = new ChocolateyPackSettings { - LimitOutput = true, - Version = context.Version?.SemVersion, + Id = id, + Version = context.Version?.ChocolateyVersion, + Title = "GitVersion", + Description = "Derives SemVer information from a repository following GitFlow or GitHubFlow.", + Authors = ["GitTools and Contributors"], + Owners = ["GitTools and Contributors"], + Copyright = $"Copyright GitTools {DateTime.Now.Year}", + DocsUrl = new Uri("https://gitversion.net/docs/"), + LicenseUrl = new Uri("https://opensource.org/license/mit/"), + ProjectUrl = new Uri("https://github.com/GitTools/GitVersion"), + ProjectSourceUrl = new Uri("https://github.com/GitTools/GitVersion"), + IconUrl = new Uri("https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/Color/icon_100x100.png"), + RequireLicenseAcceptance = false, + Tags = ["Git", "Versioning", "GitVersion", "GitFlowVersion", "GitFlow", "GitHubFlow", "SemVer"], + ReleaseNotes = [$"https://github.com/GitTools/GitVersion/releases/tag/%7Bcontext.Version?.ChocolateyVersion}" + ], OutputDirectory = Paths.Nuget, - Files = context.GetFiles(artifactPath + "/**/*.*") - .Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) - .ToArray() + LimitOutput = true, }; - context.ChocolateyPack(portableNuspecFile, chocolateySettings); + return chocolateySettings; } } diff --git a/build/build/Tasks/Package/PackageNuget.cs b/build/build/Tasks/Package/PackageNuget.cs index ace94548b3..300c32848f 100644 --- a/build/build/Tasks/Package/PackageNuget.cs +++ b/build/build/Tasks/Package/PackageNuget.cs @@ -1,12 +1,10 @@ using Cake.Common.Tools.DotNet.Pack; -using Cake.Common.Tools.NuGet.Pack; using Common.Utilities; namespace Build.Tasks; [TaskName(nameof(PackageNuget))] [TaskDescription("Creates the nuget packages")] -[IsDependentOn(typeof(PackagePrepare))] public class PackageNuget : FrostingTask<BuildContext> { public override void Run(BuildContext context) @@ -14,7 +12,6 @@ public override void Run(BuildContext context) context.EnsureDirectoryExists(Paths.Nuget); PackageWithCli(context); - PackageUsingNuspec(context); } private static void PackageWithCli(BuildContext context) { @@ -28,39 +25,10 @@ private static void PackageWithCli(BuildContext context) // GitVersion.MsBuild, global tool & core context.DotNetPack("./src/GitVersion.Core", settings); - settings.ArgumentCustomization = arg => arg.Append("/p:PackAsTool=true"); + settings.ArgumentCustomization = arg => arg.Append("-p:PackAsTool=true").Append("-p:BuildInParallel=false"); context.DotNetPack("./src/GitVersion.App", settings); - settings.ArgumentCustomization = arg => arg.Append("/p:IsPackaging=true"); + settings.ArgumentCustomization = arg => arg.Append("-p:IsPackaging=true"); context.DotNetPack("./src/GitVersion.MsBuild", settings); } - private static void PackageUsingNuspec(BuildContextBase context) - { - var cmdlineNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.CommandLine.nuspec"); - if (!context.FileExists(cmdlineNuspecFile)) - return; - - var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinCmdline).FullPath; - var version = context.Version; - var gitVersion = version?.GitVersion; - var nugetSettings = new NuGetPackSettings - { - // KeepTemporaryNuSpecFile = true, - Version = version?.NugetVersion, - NoPackageAnalysis = true, - OutputDirectory = Paths.Nuget, - Repository = new NuGetRepository - { - Branch = gitVersion?.BranchName, - Commit = gitVersion?.Sha - }, - Files = context.GetFiles(artifactPath + "/**/*.*") - .Select(file => new NuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) - .Concat(context.GetFiles("docs/**/package_icon.png").Select(file => new NuSpecContent { Source = file.FullPath, Target = "package_icon.png" })) - .Concat(context.GetFiles("build/nuspec/README.md").Select(file => new NuSpecContent { Source = file.FullPath, Target = "README.md" })) - .ToArray() - }; - - context.NuGetPack(cmdlineNuspecFile, nugetSettings); - } } diff --git a/build/build/Tasks/Package/PackagePrepare.cs b/build/build/Tasks/Package/PackagePrepare.cs index 646d2dea3e..096384779f 100644 --- a/build/build/Tasks/Package/PackagePrepare.cs +++ b/build/build/Tasks/Package/PackagePrepare.cs @@ -15,11 +15,6 @@ public override void Run(BuildContext context) var sourceDir = Paths.Native.Combine(PlatformFamily.Windows.ToString()).Combine("win-x64"); var sourceFiles = context.GetFiles(sourceDir + "/*.*"); - var cmdlineDir = Paths.ArtifactsBinCmdline.Combine("tools"); - - context.EnsureDirectoryExists(cmdlineDir); - context.CopyFiles(sourceFiles, cmdlineDir); - var portableDir = Paths.ArtifactsBinPortable.Combine("tools"); context.EnsureDirectoryExists(portableDir); @@ -30,7 +25,7 @@ public override void Run(BuildContext context) private static void PackPrepareNative(BuildContext context) { // publish single file for all native runtimes (self contained) - var platform = context.Environment.Platform.Family; + var platform = context.Platform; var runtimes = context.NativeRuntimes[platform]; foreach (var runtime in runtimes) @@ -39,22 +34,24 @@ private static void PackPrepareNative(BuildContext context) // testing windows and macos artifacts, the linux is tested with docker if (platform == PlatformFamily.Linux) continue; - if (runtime.EndsWith("arm64")) continue; - context.Information("Validating native lib:"); - var nativeExe = outputPath.CombineWithFilePath(context.IsOnWindows ? "gitversion.exe" : "gitversion"); - context.ValidateOutput(nativeExe.FullPath, "/showvariable FullSemver", context.Version?.GitVersion?.FullSemVer); + if (context.IsRunningOnAmd64() && runtime.EndsWith("x64") || context.IsRunningOnArm64() && runtime.EndsWith("arm64")) + { + context.Information("Validating native lib:"); + var nativeExe = outputPath.CombineWithFilePath(context.IsOnWindows ? "gitversion.exe" : "gitversion"); + context.ValidateOutput(nativeExe.FullPath, "/showvariable FullSemver", context.Version?.GitVersion?.FullSemVer); + } } } private static DirectoryPath PackPrepareNative(BuildContext context, string runtime) { - var platform = context.Environment.Platform.Family; + var platform = context.Platform; var outputPath = Paths.Native.Combine(platform.ToString().ToLower()).Combine(runtime); var settings = new DotNetPublishSettings { - Framework = Constants.NetVersion60, + Framework = $"net{Constants.DotnetLtsLatest}", Runtime = runtime, NoRestore = false, Configuration = context.MsBuildConfiguration, @@ -65,12 +62,6 @@ private static DirectoryPath PackPrepareNative(BuildContext context, string runt SelfContained = true }; - // workaround for https://github.com/dotnet/runtime/issues/49508 - if (runtime == "osx-arm64") - { - settings.ArgumentCustomization = arg => arg.Append("/p:OsxArm64=true"); - } - context.DotNetPublish("./src/GitVersion.App/GitVersion.App.csproj", settings); return outputPath; diff --git a/build/build/Tasks/Test.cs b/build/build/Tasks/Test.cs index e8bf15f20a..e659371ec8 100644 --- a/build/build/Tasks/Test.cs +++ b/build/build/Tasks/Test.cs @@ -3,6 +3,4 @@ namespace Build.Tasks; [TaskName(nameof(Test))] [TaskDescription("(CI only) Run the tests and publish the results")] [IsDependentOn(typeof(PublishCoverage))] -public class Test : FrostingTask<BuildContext> -{ -} +public class Test : FrostingTask<BuildContext>; diff --git a/build/build/Tasks/Test/PublishCoverage.cs b/build/build/Tasks/Test/PublishCoverage.cs index 1273c881da..6f754c72d6 100644 --- a/build/build/Tasks/Test/PublishCoverage.cs +++ b/build/build/Tasks/Test/PublishCoverage.cs @@ -12,14 +12,16 @@ public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.IsOnWindows, $"{nameof(PublishCoverage)} works only on Windows agents."); - shouldRun &= context.ShouldRun(context.IsOnMainOrSupportBranchOriginalRepo, $"{nameof(PublishCoverage)} works only for on main or release branch original repository."); + shouldRun &= context.ShouldRun(context.IsReleaseBranchOriginalRepo, $"{nameof(PublishCoverage)} works only for main or release branch, original repository."); return shouldRun; } public override void Run(BuildContext context) { - var coverageFiles = context.GetFiles($"{Paths.TestOutput}/*.coverage.*.xml"); + var coverageFiles = context + .GetFiles($"{Paths.TestOutput}/*.coverage.*.xml") + .Select(file => context.MakeRelative(file).ToString()).ToArray(); var token = context.Credentials?.CodeCov?.Token; if (string.IsNullOrEmpty(token)) @@ -27,13 +29,10 @@ public override void Run(BuildContext context) throw new InvalidOperationException("Could not resolve CodeCov token."); } - foreach (var coverageFile in coverageFiles) + context.Codecov(new CodecovSettings { - context.Codecov(new CodecovSettings - { - Files = new[] { coverageFile.ToString() }, - Token = token - }); - } + Files = coverageFiles, + Token = token + }); } } diff --git a/build/build/Tasks/Test/UnitTest.cs b/build/build/Tasks/Test/UnitTest.cs index a21367d852..e66f91b2e9 100644 --- a/build/build/Tasks/Test/UnitTest.cs +++ b/build/build/Tasks/Test/UnitTest.cs @@ -8,7 +8,7 @@ namespace Build.Tasks; [TaskName(nameof(UnitTest))] [TaskDescription("Run the unit tests")] -[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion50, Constants.NetVersion60, Constants.CoreFxVersion31, Constants.FullFxVersion48)] +[DotnetArgument] [IsDependentOn(typeof(Build))] public class UnitTest : FrostingTask<BuildContext> { @@ -16,15 +16,19 @@ public class UnitTest : FrostingTask<BuildContext> public override void Run(BuildContext context) { - var dotnetTarget = context.Argument(Arguments.DotnetTarget, string.Empty); - var frameworks = new[] { Constants.CoreFxVersion31, Constants.FullFxVersion48, Constants.NetVersion50, Constants.NetVersion60 }; - if (!string.IsNullOrWhiteSpace(dotnetTarget)) + var dotnetVersion = context.Argument(Arguments.DotnetVersion, string.Empty); + var frameworks = Constants.DotnetVersions; + if (!string.IsNullOrWhiteSpace(dotnetVersion)) { - if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase)) + if (string.Equals(dotnetVersion, "lts-latest", StringComparison.OrdinalIgnoreCase)) { - throw new Exception($"Dotnet Target {dotnetTarget} is not supported at the moment"); + dotnetVersion = Constants.DotnetLtsLatest; } - frameworks = new[] { dotnetTarget }; + if (!frameworks.Contains(dotnetVersion, StringComparer.OrdinalIgnoreCase)) + { + throw new Exception($"Dotnet Target {dotnetVersion} is not supported at the moment"); + } + frameworks = [dotnetVersion]; } foreach (var framework in frameworks) @@ -48,12 +52,12 @@ public override void OnError(Exception exception, BuildContext context) public override void Finally(BuildContext context) { var testResultsFiles = context.GetFiles($"{Paths.TestOutput}/*.results.xml"); - if (!context.IsAzurePipelineBuild || !testResultsFiles.Any()) return; + if (!context.IsAzurePipelineBuild || testResultsFiles.Count == 0) return; var data = new AzurePipelinesPublishTestResultsData { TestResultsFiles = testResultsFiles.ToArray(), - Platform = context.Environment.Platform.Family.ToString(), + Platform = context.Platform.ToString(), TestRunner = AzurePipelinesTestRunnerType.JUnit }; context.BuildSystem().AzurePipelines.Commands.PublishTestResults(data); @@ -62,21 +66,18 @@ public override void Finally(BuildContext context) private static void TestProjectForTarget(BuildContext context, FilePath project, string framework) { var testResultsPath = Paths.TestOutput; - var projectName = $"{project.GetFilenameWithoutExtension()}.{framework}"; + var projectName = $"{project.GetFilenameWithoutExtension()}.net{framework}"; var settings = new DotNetTestSettings { - Framework = framework, + Framework = $"net{framework}", NoBuild = true, NoRestore = true, Configuration = context.MsBuildConfiguration, + TestAdapterPath = new(".") }; - if (!context.IsRunningOnMacOs()) - { - settings.TestAdapterPath = new DirectoryPath("."); - var resultsPath = context.MakeAbsolute(testResultsPath.CombineWithFilePath($"{projectName}.results.xml")); - settings.Loggers = new[] { $"junit;LogFilePath={resultsPath}" }; - } + var resultsPath = context.MakeAbsolute(testResultsPath.CombineWithFilePath($"{projectName}.results.xml")); + settings.Loggers = [$"junit;LogFilePath={resultsPath}"]; var coverletSettings = new CoverletSettings { @@ -84,14 +85,9 @@ private static void TestProjectForTarget(BuildContext context, FilePath project, CoverletOutputFormat = CoverletOutputFormat.cobertura, CoverletOutputDirectory = testResultsPath, CoverletOutputName = $"{projectName}.coverage.xml", - Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitTools.Testing]*" } + Exclude = ["[GitVersion*.Tests]*", "[GitTools.Testing]*"] }; - if (string.Equals(framework, Constants.FullFxVersion48)) - { - settings.Filter = context.IsRunningOnUnix() ? $"TestCategory!={Constants.NoMono}" : $"TestCategory!={Constants.NoNet48}"; - } - context.DotNetTest(project.FullPath, settings, coverletSettings); } } diff --git a/build/build/Tasks/ValidateVersion.cs b/build/build/Tasks/ValidateVersion.cs index c0545f18f3..e88866ffca 100644 --- a/build/build/Tasks/ValidateVersion.cs +++ b/build/build/Tasks/ValidateVersion.cs @@ -1,4 +1,3 @@ -using Build.Utilities; using Common.Utilities; namespace Build.Tasks; @@ -10,7 +9,8 @@ public class ValidateVersion : FrostingTask<BuildContext> { public override void Run(BuildContext context) { - var gitversionTool = context.GetGitVersionToolLocation(); - context.ValidateOutput("dotnet", $"\"{gitversionTool}\" -version", context.Version!.GitVersion!.InformationalVersion!); + ArgumentNullException.ThrowIfNull(context.Version); + var gitVersionTool = context.GetGitVersionToolLocation(); + context.ValidateOutput("dotnet", $"\"{gitVersionTool}\" -version", context.Version.GitVersion.InformationalVersion); } } diff --git a/build/build/Utilities/ContextExtensions.cs b/build/build/Utilities/ContextExtensions.cs deleted file mode 100644 index edb9b99846..0000000000 --- a/build/build/Utilities/ContextExtensions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Build.Utilities; - -public static class ContextExtensions -{ - public static FilePath? GetGitVersionToolLocation(this BuildContext context) => - context.GetFiles($"src/GitVersion.App/bin/{context.MsBuildConfiguration}/{Constants.NetVersion60}/gitversion.dll").SingleOrDefault(); -} diff --git a/build/build/Utilities/Credentials.cs b/build/build/Utilities/Credentials.cs index 9735ef2e63..058ccde33a 100644 --- a/build/build/Utilities/Credentials.cs +++ b/build/build/Utilities/Credentials.cs @@ -4,10 +4,10 @@ namespace Build.Utilities; public class Credentials { - public CodeCovCredentials? CodeCov { get; private set; } + public CodeCovCredentials? CodeCov { get; private init; } public static Credentials GetCredentials(ICakeContext context) => new() { - CodeCov = new CodeCovCredentials(context.EnvironmentVariable("CODECOV_TOKEN")), + CodeCov = new(context.EnvironmentVariable("CODECOV_TOKEN")), }; } diff --git a/build/build/build.csproj b/build/build/build.csproj index 55494cff57..7f35470aa1 100644 --- a/build/build/build.csproj +++ b/build/build/build.csproj @@ -7,7 +7,7 @@ <ProjectReference Include="..\common\common.csproj" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Cake.Codecov" Version="1.0.1" /> - <PackageReference Include="Cake.Coverlet" Version="2.5.4" /> + <PackageReference Include="Cake.Codecov" /> + <PackageReference Include="Cake.Coverlet" /> </ItemGroup> </Project> diff --git a/build/chores/BuildContext.cs b/build/chores/BuildContext.cs deleted file mode 100644 index 92660009f3..0000000000 --- a/build/chores/BuildContext.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Chores; - -public class BuildContext : FrostingContext -{ - public BuildContext(ICakeContext context) : base(context) - { - } -} diff --git a/build/chores/Startup.cs b/build/chores/Startup.cs deleted file mode 100644 index d326a2531c..0000000000 --- a/build/chores/Startup.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Common.Lifetime; -using Microsoft.Extensions.DependencyInjection; - -namespace Chores; - -public class Startup : IFrostingStartup -{ - public void Configure(IServiceCollection services) - { - services.UseLifetime<BuildLifetime>(); - services.UseTaskLifetime<BuildTaskLifetime>(); - } -} diff --git a/build/chores/Tasks/Default.cs b/build/chores/Tasks/Default.cs deleted file mode 100644 index 0df4f50886..0000000000 --- a/build/chores/Tasks/Default.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Chores.Tasks; - -[TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} diff --git a/build/chores/Tasks/ToolsInstall.cs b/build/chores/Tasks/ToolsInstall.cs deleted file mode 100644 index fdbec90d67..0000000000 --- a/build/chores/Tasks/ToolsInstall.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Cake.Json; -using Newtonsoft.Json.Linq; - -namespace Chores.Tasks; - -[TaskName(nameof(ToolsInstall))] -[TaskDescription("Install dotnet global tools to 'tools' folder")] -public class ToolsInstall : FrostingTask<BuildContext> -{ - public override void Run(BuildContext context) - { - var json = context.ParseJsonFromFile("dotnet-tools.json"); - var jToken = json["tools"]; - if (jToken == null) return; - - var tools = jToken.Select(x => (JProperty)x).ToDictionary(x => x.Name, x => x.Value["version"]?.Value<string>()); - foreach (var (toolName, version) in tools) - { - // context.DotNetTool($"tool update --tool-path {context.Configuration.GetToolPath()} --version {version} {toolName}"); - } - } -} diff --git a/build/chores/Tasks/ToolsUpdate.cs b/build/chores/Tasks/ToolsUpdate.cs deleted file mode 100644 index fdc5156789..0000000000 --- a/build/chores/Tasks/ToolsUpdate.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Cake.Json; -using Newtonsoft.Json.Linq; - -namespace Chores.Tasks; - -[TaskName(nameof(ToolsUpdate))] -[TaskDescription("Update dotnet local tools")] -public class ToolsUpdate : FrostingTask<BuildContext> -{ - public override void Run(BuildContext context) - { - var json = context.ParseJsonFromFile("dotnet-tools.json"); - var jToken = json["tools"]; - if (jToken != null) - { - var tools = jToken.Select(x => ((JProperty)x).Name).ToArray(); - foreach (var tool in tools) - { - context.DotNetTool($"tool update --local {tool}"); - } - } - } -} diff --git a/build/common/Addins/Cake.Coverlet/ArgumentsProcessor.cs b/build/common/Addins/Cake.Coverlet/ArgumentsProcessor.cs deleted file mode 100644 index 89059e2f77..0000000000 --- a/build/common/Addins/Cake.Coverlet/ArgumentsProcessor.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Cake.Coverlet; - -namespace Common.Addins.Cake.Coverlet; - -internal static class ArgumentsProcessor -{ - public static ProcessArgumentBuilder ProcessMSBuildArguments( - CoverletSettings settings, - ICakeEnvironment cakeEnvironment, - ProcessArgumentBuilder builder, - FilePath project) - { - builder.AppendMSBuildProperty(nameof(CoverletSettings.CollectCoverage), settings.CollectCoverage.ToString()); - builder.AppendPropertyList(nameof(CoverletSettings.CoverletOutputFormat), SplitFlagEnum(settings.CoverletOutputFormat)); - - if (settings.Threshold.HasValue) - { - if (settings.Threshold > 100) - { - throw new Exception("Threshold Percentage cannot be set as greater than 100%"); - } - - builder.AppendMSBuildProperty(nameof(CoverletSettings.Threshold), settings.Threshold.ToString()!); - - if (settings.ThresholdType != ThresholdType.NotSet) - { - builder.AppendPropertyList(nameof(CoverletSettings.ThresholdType), SplitFlagEnum(settings.ThresholdType)); - } - } - - if (settings.CoverletOutputDirectory != null && string.IsNullOrEmpty(settings.CoverletOutputName)) - { - var directoryPath = settings.CoverletOutputDirectory - .MakeAbsolute(cakeEnvironment).FullPath; - - builder.AppendMSBuildPropertyQuoted("CoverletOutput", directoryPath); - } - else if (!string.IsNullOrEmpty(settings.CoverletOutputName)) - { - var dir = settings.CoverletOutputDirectory ?? project.GetDirectory(); - var directoryPath = dir.MakeAbsolute(cakeEnvironment).FullPath; - - var filepath = FilePath.FromString(settings.OutputTransformer(settings.CoverletOutputName, directoryPath)); - - builder.AppendMSBuildPropertyQuoted("CoverletOutput", filepath.MakeAbsolute(cakeEnvironment).FullPath); - } - - if (settings.ExcludeByFile.Count > 0) - { - builder.AppendPropertyList(nameof(CoverletSettings.ExcludeByFile), settings.ExcludeByFile); - } - - - if (settings.Include.Count > 0) - { - builder.AppendPropertyList(nameof(CoverletSettings.Include), settings.Include); - } - - - if (settings.Exclude.Count > 0) - { - builder.AppendPropertyList(nameof(CoverletSettings.Exclude), settings.Exclude); - } - - if (settings.ExcludeByAttribute.Count > 0) - { - builder.AppendPropertyList(nameof(CoverletSettings.ExcludeByAttribute), settings.ExcludeByAttribute); - } - - if (settings.MergeWithFile != null && settings.MergeWithFile.GetExtension() == ".json") - { - builder.AppendMSBuildPropertyQuoted("MergeWith", settings.MergeWithFile.MakeAbsolute(cakeEnvironment).FullPath); - } - - if (settings.IncludeTestAssembly.HasValue) - { - builder.AppendMSBuildProperty(nameof(CoverletSettings.IncludeTestAssembly), settings.IncludeTestAssembly.Value ? bool.TrueString : bool.FalseString); - } - - return builder; - } - - public static ProcessArgumentBuilder ProcessToolArguments( - CoverletSettings settings, - ICakeEnvironment cakeEnvironment, - ProcessArgumentBuilder builder, - FilePath project) - { - builder.AppendSwitch("--format", SplitFlagEnum(settings.CoverletOutputFormat)); - - if (settings.Threshold.HasValue) - { - if (settings.Threshold > 100) - { - throw new Exception("Threshold Percentage cannot be set as greater than 100%"); - } - - builder.AppendSwitch(nameof(CoverletSettings.Threshold), settings.Threshold.ToString()); - - if (settings.ThresholdType != ThresholdType.NotSet) - { - builder.AppendSwitchQuoted("--threshold-type", SplitFlagEnum(settings.ThresholdType)); - } - } - - if (settings.CoverletOutputDirectory != null && string.IsNullOrEmpty(settings.CoverletOutputName)) - { - var directoryPath = settings.CoverletOutputDirectory - .MakeAbsolute(cakeEnvironment).FullPath; - - builder.AppendSwitchQuoted("--output", directoryPath); - } - else if (!string.IsNullOrEmpty(settings.CoverletOutputName)) - { - var dir = settings.CoverletOutputDirectory ?? project.GetDirectory(); - var directoryPath = dir.MakeAbsolute(cakeEnvironment).FullPath; - - var filepath = FilePath.FromString(settings.OutputTransformer(settings.CoverletOutputName, directoryPath)); - - builder.AppendSwitchQuoted("--output", filepath.MakeAbsolute(cakeEnvironment).FullPath); - } - - if (settings.ExcludeByFile.Count > 0) - { - builder.AppendSwitchQuoted("--exclude-by-file", settings.ExcludeByFile); - } - - if (settings.ExcludeByAttribute.Count > 0) - { - builder.AppendSwitchQuoted("--exclude-by-attribute", settings.ExcludeByAttribute); - } - - if (settings.Exclude.Count > 0) - { - builder.AppendSwitchQuoted("--exclude", settings.Exclude); - } - - if (settings.Include.Count > 0) - { - builder.AppendSwitchQuoted("--include", settings.Include); - } - - if (settings.MergeWithFile != null && settings.MergeWithFile.GetExtension() == ".json") - { - builder.AppendSwitchQuoted("--merge-with", settings.MergeWithFile.MakeAbsolute(cakeEnvironment).FullPath); - } - - if (settings.IncludeTestAssembly.HasValue) - { - builder.AppendSwitch("--include-test-assembly", settings.IncludeTestAssembly.Value ? bool.TrueString : bool.FalseString); - } - - return builder; - } - - private static IEnumerable<string> SplitFlagEnum(Enum @enum) => @enum.ToString("g").Split(',').Select(s => s.ToLowerInvariant()); -} diff --git a/build/common/Addins/Cake.Coverlet/BuilderExtension.cs b/build/common/Addins/Cake.Coverlet/BuilderExtension.cs deleted file mode 100644 index ff552820b9..0000000000 --- a/build/common/Addins/Cake.Coverlet/BuilderExtension.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Common.Addins.Cake.Coverlet; - -internal static class BuilderExtension -{ - internal static ProcessArgumentBuilder AppendMSBuildProperty(this ProcessArgumentBuilder builder, string propertyName, string value) - { - builder.AppendSwitch($"/property:{propertyName}", "=", value); - return builder; - } - - internal static ProcessArgumentBuilder AppendMSBuildPropertyQuoted(this ProcessArgumentBuilder builder, string propertyName, string value) - { - builder.AppendSwitchQuoted($"/property:{propertyName}", "=", value); - return builder; - } - - internal static ProcessArgumentBuilder AppendPropertyList(this ProcessArgumentBuilder builder, string propertyName, IEnumerable<string> values) - { - builder.Append($"/property:{propertyName}=\\\"{string.Join(",", values.Select(s => s.Trim()))}\\\""); - return builder; - } - - internal static ProcessArgumentBuilder AppendSwitchQuoted(this ProcessArgumentBuilder builder, string @switch, IEnumerable<string> values) - { - foreach (var type in values.Select(s => s.Trim())) - { - builder.AppendSwitchQuoted(@switch, type); - } - return builder; - } - - internal static ProcessArgumentBuilder AppendSwitch(this ProcessArgumentBuilder builder, string @switch, IEnumerable<string> values) - { - foreach (var type in values.Select(s => s.Trim())) - { - builder.AppendSwitch(@switch, type); - } - return builder; - } -} diff --git a/build/common/Addins/Cake.Docker/Constants.cs b/build/common/Addins/Cake.Docker/Constants.cs new file mode 100644 index 0000000000..1545461c0c --- /dev/null +++ b/build/common/Addins/Cake.Docker/Constants.cs @@ -0,0 +1,12 @@ +namespace Common.Addins.Cake.Docker; + +/// <summary> +/// Constants +/// </summary> +public static class Constants +{ + /// <summary> + /// Used with <see cref="AutoPropertyAttribute.Format"/> when a bool argument defaults to true. + /// </summary> + public const string BoolWithTrueDefaultFormat = "--{0}={1}"; +} diff --git a/build/common/Addins/Cake.Docker/DockerBuildXBuildSettings.cs b/build/common/Addins/Cake.Docker/DockerBuildXBuildSettings.cs new file mode 100644 index 0000000000..ef196c408e --- /dev/null +++ b/build/common/Addins/Cake.Docker/DockerBuildXBuildSettings.cs @@ -0,0 +1,199 @@ +#nullable disable +namespace Common.Addins.Cake.Docker; + +/// <summary> +/// Settings for docker buildx build. +/// </summary> +public sealed class DockerBuildXBuildSettings : AutoToolSettings +{ + /// <summary> + /// Add a custom host-to-IP mapping (format: "host:ip") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] AddHost { get; set; } + /// <summary> + /// Allow extra privileged entitlement (e.g., "network.host", "security.insecure") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Allow { get; set; } + /// <summary> + /// Set build-time variables + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] BuildArg { get; set; } + /// <summary> + /// Additional build contexts (e.g., name=path) + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] BuildContext { get; set; } + /// <summary> + /// Override the configured builder instance + /// </summary> + public string Builder { get; set; } + /// <summary> + /// External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] CacheFrom { get; set; } + /// <summary> + /// Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] CacheTo { get; set; } + /// <summary> + /// Optional parent cgroup for the container + /// </summary> + public string CgroupParent { get; set; } + /// <summary> + /// Compress the build context using gzip + /// </summary> + public bool? Compress { get; set; } + /// <summary> + /// Limit the CPU CFS (Completely Fair Scheduler) period + /// </summary> + public long? CpuPeriod { get; set; } + /// <summary> + /// Limit the CPU CFS (Completely Fair Scheduler) quota + /// </summary> + public long? CpuQuota { get; set; } + /// <summary> + /// CPUs in which to allow execution (0-3, 0,1) + /// </summary> + public string CpusetCpus { get; set; } + /// <summary> + /// MEMs in which to allow execution (0-3, 0,1) + /// </summary> + public string CpusetMems { get; set; } + /// <summary> + /// CPU shares (relative weight) + /// </summary> + public long? CpuShares { get; set; } + /// <summary> + /// Skip image verification + /// </summary> + [AutoProperty(Format = Constants.BoolWithTrueDefaultFormat)] + public bool? DisableContentTrust { get; set; } + /// <summary> + /// Name of the Dockerfile (default: "PATH/Dockerfile") + /// </summary> + public string File { get; set; } + /// <summary> + /// Always remove intermediate containers + /// </summary> + public bool? ForceRm { get; set; } + /// <summary> + /// Write the image ID to the file + /// </summary> + public string Iidfile { get; set; } + /// <summary> + /// Container isolation technology + /// </summary> + public string Isolation { get; set; } + /// <summary> + /// Set metadata for an image + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Label { get; set; } + /// <summary> + /// Shorthand for "--output=type=docker" + /// </summary> + public bool Load { get; set; } + /// <summary> + /// Memory limit + /// </summary> + public string Memory { get; set; } + /// <summary> + /// Swap limit equal to memory plus swap: '-1' to enable unlimited swap + /// </summary> + public string MemorySwap { get; set; } + /// <summary> + /// Write build result metadata to the file + /// </summary> + public string MetadataFile { get; set; } + /// <summary> + /// Set the networking mode for the "RUN" instructions during build (default "default") + /// </summary> + public string Network { get; set; } + /// <summary> + /// Do not use cache when building the image + /// </summary> + public bool NoCache { get; set; } + /// <summary> + /// Do not cache specified stages + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] NoCacheFilter { get; set; } + /// <summary> + /// Output destination (format: "type=local,dest=path") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Output { get; set; } + /// <summary> + /// Set target platform for build + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Platform { get; set; } + /// <summary> + /// Set type of progress output ("auto", "plain", "tty"). Use plain to show container output (default "auto") + /// </summary> + public string Progress { get; set; } + /// <summary> + /// Always attempt to pull all referenced images + /// </summary> + public bool Pull { get; set; } + /// <summary> + /// Shorthand for "--output=type=registry" + /// </summary> + public bool Push { get; set; } + /// <summary> + /// Suppress the build output and print image ID on success + /// </summary> + public bool Quiet { get; set; } + /// <summary> + /// Remove intermediate containers after a successful build + /// </summary> + [AutoProperty(Format = Constants.BoolWithTrueDefaultFormat)] + public bool? Rm { get; set; } + /// <summary> + /// Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Secret { get; set; } + /// <summary> + /// Security options + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] SecurityOpt { get; set; } + /// <summary> + /// Size of "/dev/shm" + /// </summary> + public string ShmSize { get; set; } + /// <summary> + /// Squash newly built layers into a single new layer + /// </summary> + public bool? Squash { get; set; } + /// <summary> + /// SSH agent socket or keys to expose to the build (format: "default|<id>[=<socket>|<key>[,<key>]]") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Ssh { get; set; } + /// <summary> + /// Name and optionally a tag (format: "name:tag") + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Tag { get; set; } + /// <summary> + /// Set the target build stage to build. + /// </summary> + public string Target { get; set; } + /// <summary> + /// Ulimit options (default []) + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Ulimit { get; set; } + /// <summary> + /// Set annotation for new image + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Annotation { get; set; } +} diff --git a/build/common/Addins/Cake.Docker/DockerBuildXImageToolsCreateSettings.cs b/build/common/Addins/Cake.Docker/DockerBuildXImageToolsCreateSettings.cs new file mode 100644 index 0000000000..7306e7f246 --- /dev/null +++ b/build/common/Addins/Cake.Docker/DockerBuildXImageToolsCreateSettings.cs @@ -0,0 +1,36 @@ +#nullable disable +namespace Common.Addins.Cake.Docker; + +/// <summary> +/// Settings for docker buildx imagetools create. +/// </summary> +public sealed class DockerBuildXImageToolsCreateSettings : AutoToolSettings +{ + /// <summary> + /// Append to existing manifest + /// </summary> + public bool Append { get; set; } + /// <summary> + /// Override the configured builder instance + /// </summary> + public string Builder { get; set; } + /// <summary> + /// Show final image instead of pushing + /// </summary> + public bool DryRun { get; set; } + /// <summary> + /// Read source descriptor from file + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] File { get; set; } + /// <summary> + /// Set reference for new image + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Tag { get; set; } + /// <summary> + /// Set annotation for new image + /// </summary> + [AutoProperty(AutoArrayType = AutoArrayType.List)] + public string[] Annotation { get; set; } +} diff --git a/build/common/Addins/GitVersion/GitVersion.cs b/build/common/Addins/GitVersion/GitVersion.cs index 833cb5c387..a6fd1d1bc1 100644 --- a/build/common/Addins/GitVersion/GitVersion.cs +++ b/build/common/Addins/GitVersion/GitVersion.cs @@ -45,11 +45,6 @@ public sealed class GitVersion /// </summary> public string? BuildMetaData { get; set; } - /// <summary> - /// Gets or sets the build metadata padded. - /// </summary> - public string? BuildMetaDataPadded { get; set; } - /// <summary> /// Gets or sets the major version. /// </summary> @@ -65,16 +60,6 @@ public sealed class GitVersion /// </summary> public string? SemVer { get; set; } - /// <summary> - /// Gets or sets the legacy Semantic Version. - /// </summary> - public string? LegacySemVer { get; set; } - - /// <summary> - /// Gets or sets the padded legacy Semantic Version. - /// </summary> - public string? LegacySemVerPadded { get; set; } - /// <summary> /// Gets or sets the assembly Semantic Version. /// </summary> @@ -105,26 +90,11 @@ public sealed class GitVersion /// </summary> public string? Sha { get; set; } - /// <summary> - /// Gets or sets the NuGet version for v2. - /// </summary> - public string? NuGetVersionV2 { get; set; } - - /// <summary> - /// Gets or sets the NuGet version. - /// </summary> - public string? NuGetVersion { get; set; } - /// <summary> /// Gets or sets the commits since version source. /// </summary> public int? CommitsSinceVersionSource { get; set; } - /// <summary> - /// Gets or sets the commits since version source padded. - /// </summary> - public string? CommitsSinceVersionSourcePadded { get; set; } - /// <summary> /// Gets or sets the commit date. /// </summary> diff --git a/build/common/Addins/GitVersion/GitVersionAliases.cs b/build/common/Addins/GitVersion/GitVersionAliases.cs index 0d4d292ea2..16ccd229d2 100644 --- a/build/common/Addins/GitVersion/GitVersionAliases.cs +++ b/build/common/Addins/GitVersion/GitVersionAliases.cs @@ -54,10 +54,7 @@ public static class GitVersionAliases [CakeMethodAlias] public static GitVersion GitVersion(this ICakeContext context) { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } + ArgumentNullException.ThrowIfNull(context); return GitVersion(context, new GitVersionSettings()); } @@ -104,10 +101,7 @@ public static GitVersion GitVersion(this ICakeContext context) [CakeMethodAlias] public static GitVersion GitVersion(this ICakeContext context, GitVersionSettings settings) { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } + ArgumentNullException.ThrowIfNull(context); var gitVersionRunner = new GitVersionRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log); return gitVersionRunner.Run(settings); diff --git a/build/common/Addins/GitVersion/GitVersionOutput.cs b/build/common/Addins/GitVersion/GitVersionOutput.cs index b34683d490..d9605864be 100644 --- a/build/common/Addins/GitVersion/GitVersionOutput.cs +++ b/build/common/Addins/GitVersion/GitVersionOutput.cs @@ -13,5 +13,7 @@ public enum GitVersionOutput /// <summary> /// Outputs to the stdout in a way usable by a detected build server. /// </summary> - BuildServer + BuildServer, + File, + DotEnv } diff --git a/build/common/Addins/GitVersion/GitVersionRunner.cs b/build/common/Addins/GitVersion/GitVersionRunner.cs index 8581c8c283..7da7defc4d 100644 --- a/build/common/Addins/GitVersion/GitVersionRunner.cs +++ b/build/common/Addins/GitVersion/GitVersionRunner.cs @@ -6,9 +6,9 @@ namespace Common.Addins.GitVersion; /// <summary> /// The GitVersion runner. /// </summary> -public sealed class GitVersionRunner : Tool<GitVersionSettings> +public sealed partial class GitVersionRunner : Tool<GitVersionSettings> { - private readonly ICakeLog log; + private readonly ICakeLog _log; /// <summary> /// Initializes a new instance of the <see cref="GitVersionRunner"/> class. @@ -23,7 +23,7 @@ public GitVersionRunner( ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, - ICakeLog log) : base(fileSystem, environment, processRunner, tools) => this.log = log; + ICakeLog log) : base(fileSystem, environment, processRunner, tools) => this._log = log; /// <summary> /// Runs GitVersion and processes the results. @@ -32,31 +32,27 @@ public GitVersionRunner( /// <returns>A task with the GitVersion results.</returns> public GitVersion Run(GitVersionSettings settings) { - if (settings == null) - { - throw new ArgumentNullException(nameof(settings)); - } + ArgumentNullException.ThrowIfNull(settings); var output = string.Empty; Run(settings, GetArguments(settings), new ProcessSettings { RedirectStandardOutput = true }, process => { output = string.Join("\n", process.GetStandardOutput()); - if (log.Verbosity < Verbosity.Diagnostic) + if (this._log.Verbosity >= Verbosity.Diagnostic) return; + var regex = ParseErrorRegex(); + var errors = regex.Matches(output) + .SelectMany(match => new[] { match.Groups[1].Value, match.Groups[2].Value }); + foreach (var error in errors) { - var errors = Regex.Matches(output, @"( *ERROR:? [^\n]*)\n([^\n]*)").Cast<Match>() - .SelectMany(match => new[] { match.Groups[1].Value, match.Groups[2].Value }); - foreach (var error in errors) - { - log.Error(error); - } + this._log.Error(error); } }); if (!settings.OutputTypes.Contains(GitVersionOutput.Json)) return new GitVersion(); - var jsonStartIndex = output.IndexOf("{", StringComparison.Ordinal); - var jsonEndIndex = output.IndexOf("}", StringComparison.Ordinal); + var jsonStartIndex = output.IndexOf('{'); + var jsonEndIndex = output.IndexOf('}'); var json = output.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex + 1); return JsonConvert.DeserializeObject<GitVersion>(json) ?? new GitVersion(); @@ -71,6 +67,7 @@ private ProcessArgumentBuilder GetArguments(GitVersionSettings settings) builder.Append("-output"); builder.Append("json"); } + if (settings.OutputTypes.Contains(GitVersionOutput.BuildServer)) { builder.Append("-output"); @@ -119,7 +116,8 @@ private ProcessArgumentBuilder GetArguments(GitVersionSettings settings) } else { - log.Warning("If you leave the branch name for GitVersion unset, it will fallback to the default branch for the repository."); + this._log.Warning( + "If you leave the branch name for GitVersion unset, it will fallback to the default branch for the repository."); } if (!string.IsNullOrWhiteSpace(settings.Commit)) @@ -146,13 +144,14 @@ private ProcessArgumentBuilder GetArguments(GitVersionSettings settings) builder.Append("-nofetch"); } - var verbosity = settings.Verbosity ?? log.Verbosity; + var verbosity = settings.Verbosity ?? this._log.Verbosity; if (verbosity != Verbosity.Normal) { builder.Append("-verbosity"); builder.Append(verbosity.ToString()); } + return builder; } @@ -166,5 +165,14 @@ private ProcessArgumentBuilder GetArguments(GitVersionSettings settings) /// Gets the possible names of the tool executable. /// </summary> /// <returns>The tool executable name.</returns> - protected override IEnumerable<string> GetToolExecutableNames() => new[] { "GitVersion.exe", "dotnet-gitversion", "dotnet-gitversion.exe", "gitversion" }; + protected override IEnumerable<string> GetToolExecutableNames() => + [ + "GitVersion.exe", + "dotnet-gitversion", + "dotnet-gitversion.exe", + "gitversion" + ]; + + [GeneratedRegex(@"( *ERROR:? [^\n]*)\n([^\n]*)")] + private static partial Regex ParseErrorRegex(); } diff --git a/build/common/Addins/GitVersion/GitVersionSettings.cs b/build/common/Addins/GitVersion/GitVersionSettings.cs index 688a32a34e..db44b1aac3 100644 --- a/build/common/Addins/GitVersion/GitVersionSettings.cs +++ b/build/common/Addins/GitVersion/GitVersionSettings.cs @@ -13,7 +13,7 @@ public sealed class GitVersionSettings : ToolSettings /// <summary> /// Gets or sets the output type. /// </summary> - public HashSet<GitVersionOutput> OutputTypes { get; set; } = new() { GitVersionOutput.Json }; + public HashSet<GitVersionOutput> OutputTypes { get; set; } = [GitVersionOutput.Json]; /// <summary> /// Gets or sets a value indicating whether to update all the AssemblyInfo files. diff --git a/build/common/Context/DockerBuildContext.cs b/build/common/Context/DockerBuildContext.cs new file mode 100644 index 0000000000..d78a57642b --- /dev/null +++ b/build/common/Context/DockerBuildContext.cs @@ -0,0 +1,13 @@ +using Common.Utilities; + +namespace Common.Context; + +public class DockerBuildContext(ICakeContext context) : BuildContextBase(context) +{ + public bool IsDockerOnLinux { get; set; } + + public IEnumerable<DockerImage> Images { get; set; } = new List<DockerImage>(); + public DockerRegistry DockerRegistry { get; set; } + public ICollection<Architecture> Architectures { get; set; } = new List<Architecture>(); +} + diff --git a/build/common/Lifetime/BuildLifetimeBase.cs b/build/common/Lifetime/BuildLifetimeBase.cs new file mode 100644 index 0000000000..98a431ef65 --- /dev/null +++ b/build/common/Lifetime/BuildLifetimeBase.cs @@ -0,0 +1,91 @@ +using Cake.Incubator.LoggingExtensions; +using Common.Addins.GitVersion; +using Common.Utilities; + +namespace Common.Lifetime; + +public class BuildLifetimeBase<T> : FrostingLifetime<T> where T : BuildContextBase +{ + public override void Setup(T context, ISetupContext info) + { + var buildSystem = context.BuildSystem(); + context.IsLocalBuild = buildSystem.IsLocalBuild; + context.IsAzurePipelineBuild = buildSystem.IsRunningOnAzurePipelines; + context.IsGitHubActionsBuild = buildSystem.IsRunningOnGitHubActions; + + context.IsPullRequest = buildSystem.IsPullRequest; + context.BranchName = context.GetBranchName(); + context.RepositoryName = context.GetRepositoryName(); + context.IsOriginalRepo = context.IsOriginalRepo(); + context.IsMainBranch = context.IsMainBranch(); + context.IsSupportBranch = context.IsSupportBranch(); + context.IsTagged = context.IsTagged(); + + context.IsOnWindows = context.IsRunningOnWindows(); + context.IsOnLinux = context.IsRunningOnLinux(); + context.IsOnMacOS = context.IsRunningOnMacOs(); + + if (info.TargetTask.Name == "BuildPrepare") + { + context.Information("Running BuildPrepare..."); + return; + } + + var gitVersionPath = context.GetGitVersionDotnetToolLocation(); + if (gitVersionPath is null || !context.FileExists(gitVersionPath)) + { + throw new FileNotFoundException("Failed to locate the Release build of gitversion.dll in ./tools/gitversion. Try running \"./build.ps1 -Stage build -Target BuildPrepare\""); + } + + var gitVersionSettings = new GitVersionSettings + { + OutputTypes = [GitVersionOutput.Json, GitVersionOutput.BuildServer], + ToolPath = context.Tools.Resolve(["dotnet.exe", "dotnet"]), + ArgumentCustomization = args => args.Prepend(gitVersionPath.FullPath) + }; + + var gitVersion = context.GitVersion(gitVersionSettings); + + context.Version = BuildVersion.Calculate(gitVersion); + } + public override void Teardown(T context, ITeardownContext info) + { + context.StartGroup("Build Teardown"); + try + { + context.Information("Starting Teardown..."); + + LogBuildInformation(context); + + context.Information("Finished running tasks."); + } + catch (Exception exception) + { + context.Error(exception.Dump()); + } + context.EndGroup(); + } + protected void LogBuildInformation(T context) + { + if (context.HasArgument(Arguments.Target)) + { + context.Information($"Target: {context.Argument<string>(Arguments.Target)}"); + } + if (context.Version is not null) + { + context.Information($"Version: {context.Version.SemVersion}"); + } + context.Information($"Build Agent: {context.GetBuildAgent()}"); + context.Information($"OS: {context.GetOS()}"); + context.Information($"Pull Request: {context.IsPullRequest}"); + context.Information($"Repository Name: {context.RepositoryName}"); + context.Information($"Original Repository: {context.IsOriginalRepo}"); + context.Information($"Branch Name: {context.BranchName}"); + context.Information($"Main Branch: {context.IsMainBranch}"); + context.Information($"Support Branch: {context.IsSupportBranch}"); + context.Information($"Tagged: {context.IsTagged}"); + context.Information($"IsStableRelease: {context.IsStableRelease}"); + context.Information($"IsTaggedPreRelease: {context.IsTaggedPreRelease}"); + context.Information($"IsInternalPreRelease: {context.IsInternalPreRelease}"); + } +} diff --git a/build/common/Lifetime/DockerBuildLifetime.cs b/build/common/Lifetime/DockerBuildLifetime.cs new file mode 100644 index 0000000000..73e1412518 --- /dev/null +++ b/build/common/Lifetime/DockerBuildLifetime.cs @@ -0,0 +1,54 @@ +using Common.Context; +using Common.Utilities; + +namespace Common.Lifetime; + +public abstract class DockerBuildLifetime<TContext> : BuildLifetimeBase<TContext> + where TContext : DockerBuildContext +{ + protected virtual bool UseBaseImage => false; + + public override void Setup(TContext context, ISetupContext info) + { + base.Setup(context, info); + + context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", string.Empty) == "linux"; + + var dockerRegistry = context.Argument(Arguments.DockerRegistry, DockerRegistry.DockerHub); + var dotnetVersion = context.Argument(Arguments.DotnetVersion, string.Empty).ToLower(); + var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower(); + + var versions = string.IsNullOrWhiteSpace(dotnetVersion) + ? Constants.DotnetVersions + : string.Equals(dotnetVersion, "lts-latest", StringComparison.OrdinalIgnoreCase) + ? [Constants.DotnetLtsLatest] + : [dotnetVersion]; + + var distros = string.IsNullOrWhiteSpace(dockerDistro) + ? Constants.DockerDistros + : string.Equals(dockerDistro, "distro-latest", StringComparison.OrdinalIgnoreCase) + ? [Constants.AlpineLatest] + : [dockerDistro]; + + var architectures = context.HasArgument(Arguments.Architecture) ? context.Arguments<Architecture>(Arguments.Architecture) : Constants.ArchToBuild; + var platformArch = context.IsRunningOnAmd64() ? Architecture.Amd64 : Architecture.Arm64; + + var registry = dockerRegistry == DockerRegistry.DockerHub ? Constants.DockerHubRegistry : Constants.GitHubContainerRegistry; + + context.DockerRegistry = dockerRegistry; + context.Architectures = architectures; + context.Images = from version in versions + from distro in distros + from arch in architectures + select new DockerImage(distro, version, arch, registry, UseBaseImage); + + context.StartGroup("Build Setup"); + + LogBuildInformation(context); + + context.Information($"IsDockerOnLinux: {context.IsDockerOnLinux}"); + context.Information($"Building for Version: {dotnetVersion}, Distro: {dockerDistro}, Architecture: {platformArch}"); + context.EndGroup(); + } +} + diff --git a/build/common/Utilities/Arguments.cs b/build/common/Utilities/Arguments.cs index 57231705f9..92fd222839 100644 --- a/build/common/Utilities/Arguments.cs +++ b/build/common/Utilities/Arguments.cs @@ -5,8 +5,7 @@ public class Arguments public const string Target = "target"; public const string Configuration = "configuration"; public const string Architecture = "arch"; - public const string DotnetTarget = "dotnet_target"; + public const string DotnetVersion = "dotnet_version"; public const string DockerRegistry = "docker_registry"; - public const string DockerDotnetVersion = "docker_dotnetversion"; public const string DockerDistro = "docker_distro"; } diff --git a/build/common/Utilities/BuildContextBase.cs b/build/common/Utilities/BuildContextBase.cs index ff67d773bc..93be1fc1b6 100644 --- a/build/common/Utilities/BuildContextBase.cs +++ b/build/common/Utilities/BuildContextBase.cs @@ -2,13 +2,12 @@ namespace Common.Utilities; public class BuildContextBase : FrostingContext { - protected BuildContextBase(ICakeContext context) : base(context) - { - } + protected BuildContextBase(ICakeContext context) : base(context) => Platform = context.Environment.Platform.Family; + public PlatformFamily Platform { get; set; } public BuildVersion? Version { get; set; } - public bool IsOriginalRepo { get; set; } public string BranchName { get; set; } = string.Empty; + public string RepositoryName { get; set; } = string.Empty; public bool IsMainBranch { get; set; } public bool IsSupportBranch { get; set; } public bool IsPullRequest { get; set; } @@ -19,7 +18,8 @@ protected BuildContextBase(ICakeContext context) : base(context) public bool IsOnWindows { get; set; } public bool IsOnLinux { get; set; } public bool IsOnMacOS { get; set; } - public bool IsOnMainOrSupportBranchOriginalRepo => !IsLocalBuild && IsOriginalRepo && (IsMainBranch || IsSupportBranch) && !IsPullRequest; - public bool IsStableRelease => IsOnMainOrSupportBranchOriginalRepo && IsTagged; - public bool IsPreRelease => IsOnMainOrSupportBranchOriginalRepo && !IsTagged; + public bool IsReleaseBranchOriginalRepo => !IsLocalBuild && IsOriginalRepo && (IsMainBranch || IsSupportBranch) && !IsPullRequest; + public bool IsStableRelease => IsReleaseBranchOriginalRepo && IsTagged && Version?.IsPreRelease == false; + public bool IsTaggedPreRelease => IsReleaseBranchOriginalRepo && IsTagged && Version?.IsPreRelease == true; + public bool IsInternalPreRelease => IsReleaseBranchOriginalRepo && IsGitHubActionsBuild; } diff --git a/build/common/Utilities/BuildLifetimeBase.cs b/build/common/Utilities/BuildLifetimeBase.cs deleted file mode 100644 index f117462390..0000000000 --- a/build/common/Utilities/BuildLifetimeBase.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Cake.Incubator.LoggingExtensions; -using Common.Addins.GitVersion; - -namespace Common.Utilities; - -public class BuildLifetimeBase<T> : FrostingLifetime<T> where T : BuildContextBase -{ - public override void Setup(T context) - { - var buildSystem = context.BuildSystem(); - context.IsLocalBuild = buildSystem.IsLocalBuild; - context.IsAzurePipelineBuild = buildSystem.IsRunningOnAzurePipelines; - context.IsGitHubActionsBuild = buildSystem.IsRunningOnGitHubActions; - - context.IsPullRequest = buildSystem.IsPullRequest; - context.BranchName = context.GetBranchName(); - context.IsOriginalRepo = context.IsOriginalRepo(); - context.IsMainBranch = context.IsMainBranch(); - context.IsSupportBranch = context.IsSupportBranch(); - context.IsTagged = context.IsTagged(); - - context.IsOnWindows = context.IsRunningOnWindows(); - context.IsOnLinux = context.IsRunningOnLinux(); - context.IsOnMacOS = context.IsRunningOnMacOs(); - - var gitVersion = context.GitVersion(new GitVersionSettings - { - OutputTypes = new HashSet<GitVersionOutput> { GitVersionOutput.Json, GitVersionOutput.BuildServer } - }); - - context.Version = BuildVersion.Calculate(gitVersion); - } - public override void Teardown(T context, ITeardownContext info) - { - context.StartGroup("Build Teardown"); - try - { - context.Information("Starting Teardown..."); - - context.Information("Pull Request: {0}", context.IsPullRequest); - context.Information("Original Repo: {0}", context.IsOriginalRepo); - context.Information("Branch Name: {0}", context.BranchName); - context.Information("Main Branch: {0}", context.IsMainBranch); - context.Information("Support Branch: {0}", context.IsSupportBranch); - context.Information("Tagged: {0}", context.IsTagged); - - context.Information("Finished running tasks."); - } - catch (Exception exception) - { - context.Error(exception.Dump()); - } - context.EndGroup(); - } - protected void LogBuildInformation(T context) - { - if (context.HasArgument(Arguments.Target)) - { - context.Information("Target: {0}", context.Argument<string>(Arguments.Target)); - } - context.Information("Version: {0}", context.Version?.SemVersion); - context.Information("Build Agent: {0}", context.GetBuildAgent()); - context.Information("OS: {0}", context.GetOS()); - context.Information("Pull Request: {0}", context.IsPullRequest); - context.Information("Original Repo: {0}", context.IsOriginalRepo); - context.Information("Branch Name: {0}", context.BranchName); - context.Information("Main Branch: {0}", context.IsMainBranch); - context.Information("Support Branch: {0}", context.IsSupportBranch); - context.Information("Tagged: {0}", context.IsTagged); - } -} diff --git a/build/common/Utilities/CakeHostExtensions.cs b/build/common/Utilities/CakeHostExtensions.cs index 5b8681122f..43b964c8b1 100644 --- a/build/common/Utilities/CakeHostExtensions.cs +++ b/build/common/Utilities/CakeHostExtensions.cs @@ -12,7 +12,7 @@ public static CakeHost UseRootDirectory(this CakeHost host) public static CakeHost InstallToolsFromRootManifest(this CakeHost host) { - host = host.UseModule<LocalToolsModule>().InstallToolsFromManifest(Extensions.GetRootDirectory().CombineWithFilePath("dotnet-tools.json").FullPath); + host = host.UseModule<LocalToolsModule>().InstallToolsFromManifest(Extensions.GetRootDirectory().CombineWithFilePath(".config/dotnet-tools.json").FullPath); return host; } diff --git a/build/common/Utilities/Constants.cs b/build/common/Utilities/Constants.cs index 18da2c45d0..49eac5f818 100644 --- a/build/common/Utilities/Constants.cs +++ b/build/common/Utilities/Constants.cs @@ -1,25 +1,19 @@ +// ReSharper disable MemberCanBePrivate.Global namespace Common.Utilities; -public class Constants +public static class Constants { public const string RepoOwner = "GitTools"; public const string Repository = "GitVersion"; - public const string Version60 = "6.0"; - public const string Version50 = "5.0"; - public const string Version31 = "3.1"; + public const string DotnetLtsLatest = "8.0"; + public static readonly string[] DotnetVersions = [DotnetLtsLatest, "9.0"]; - public const string NetVersion50 = "net5.0"; - public const string NetVersion60 = "net6.0"; - public const string CoreFxVersion31 = "netcoreapp3.1"; - public const string FullFxVersion48 = "net48"; + public const string DefaultBranch = "main"; + public const string DefaultConfiguration = "Release"; - public const string NoMono = "NoMono"; - public const string NoNet48 = "NoNet48"; - - public static readonly string[] VersionsToBuild = { Version60, Version50, Version31 }; - public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 }; - public static readonly string[] DistrosToSkip = { Alpine312, Alpine313, Alpine314, Centos7 }; + public static readonly Architecture[] ArchToBuild = [Architecture.Amd64, Architecture.Arm64]; + public static readonly string[] Architectures = [nameof(Architecture.Amd64), nameof(Architecture.Arm64)]; public const string DockerBaseImageName = "gittools/build-images"; public const string DockerImageName = "gittools/gitversion"; @@ -28,36 +22,25 @@ public class Constants public const string GitHub = "github"; public const string DockerHubRegistry = "docker.io"; public const string GitHubContainerRegistry = "ghcr.io"; - - public const string Arm64 = "arm64"; - public const string Amd64 = "amd64"; - - public const string Alpine312 = "alpine.3.12"; - public const string Alpine313 = "alpine.3.13"; - public const string Alpine314 = "alpine.3.14"; - public const string Centos7 = "centos.7"; - public const string Centos8 = "centos.8"; - public const string Debian9 = "debian.9"; - public const string Debian10 = "debian.10"; - public const string Debian11 = "debian.11"; - public const string Fedora33 = "fedora.33"; - public const string Ubuntu1804 = "ubuntu.18.04"; - public const string Ubuntu2004 = "ubuntu.20.04"; - public const string DockerDistroLatest = Debian10; - public static readonly string[] DockerDistrosToBuild = - { - Alpine312, - Alpine313, - Alpine314, - Centos7, - Centos8, - Debian9, - Debian10, - Debian11, - Fedora33, - Ubuntu1804, - Ubuntu2004 - }; + public static readonly string[] DockerRegistries = [DockerHub, GitHub]; + + public const string AlpineLatest = "alpine.3.22"; + public const string CentosLatest = "centos.stream.9"; + public const string DebianLatest = "debian.12"; + public const string FedoraLatest = "fedora.42"; + public const string UbuntuLatest = "ubuntu.24.04"; + + public const string DockerDistroLatest = DebianLatest; + + public static readonly string[] DockerDistros = + [ + AlpineLatest, + CentosLatest, + DebianLatest, + FedoraLatest, + UbuntuLatest, + "ubuntu.22.04" + ]; public const string NugetOrgUrl = "https://api.nuget.org/v3/index.json"; public const string GithubPackagesUrl = "https://nuget.pkg.github.com/gittools/index.json"; public const string ChocolateyUrl = "https://push.chocolatey.org/"; diff --git a/build/common/Utilities/ContextExtensions.cs b/build/common/Utilities/ContextExtensions.cs index 552f01aa84..049420f969 100644 --- a/build/common/Utilities/ContextExtensions.cs +++ b/build/common/Utilities/ContextExtensions.cs @@ -1,32 +1,12 @@ -using Cake.Common.Tools.DotNet.Test; -using Cake.Coverlet; -using Common.Addins.Cake.Coverlet; +using System.Runtime.InteropServices; +using Cake.Common.Build.AzurePipelines; using Xunit; +using ProcessArchitecture = System.Runtime.InteropServices.Architecture; namespace Common.Utilities; public static class ContextExtensions { - public static void DotNetTest( - this ICakeContext context, - FilePath project, - DotNetTestSettings settings, - CoverletSettings coverletSettings) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - var currentCustomization = settings.ArgumentCustomization; - settings.ArgumentCustomization = (args) => ArgumentsProcessor.ProcessMSBuildArguments( - coverletSettings, - context.Environment, - currentCustomization?.Invoke(args) ?? args, - project); - - context.DotNetTest(project.FullPath, settings); - } - public static IEnumerable<string> ExecuteCommand(this ICakeContext context, FilePath exe, string? args, DirectoryPath? workDir = null) { var processSettings = new ProcessSettings { Arguments = args, RedirectStandardOutput = true }; @@ -34,6 +14,7 @@ public static IEnumerable<string> ExecuteCommand(this ICakeContext context, File { processSettings.WorkingDirectory = workDir; } + context.StartProcess(exe, processSettings, out var redirectedOutput); return redirectedOutput.ToList(); } @@ -52,29 +33,14 @@ public static void GitPushBranch(this ICakeContext context, DirectoryPath reposi public static bool IsOriginalRepo(this ICakeContext context) { - var buildSystem = context.BuildSystem(); - string repositoryName = string.Empty; - if (buildSystem.IsRunningOnAppVeyor) - { - repositoryName = buildSystem.AppVeyor.Environment.Repository.Name; - } - else if (buildSystem.IsRunningOnAzurePipelines) - { - repositoryName = buildSystem.AzurePipelines.Environment.Repository.RepoName; - } - else if (buildSystem.IsRunningOnGitHubActions) - { - repositoryName = buildSystem.GitHubActions.Environment.Workflow.Repository; - } - context.Information("Repository Name: {0}", repositoryName); - + var repositoryName = context.GetRepositoryName(); return !string.IsNullOrWhiteSpace(repositoryName) && StringComparer.OrdinalIgnoreCase.Equals("gittools/GitVersion", repositoryName); } public static bool IsMainBranch(this ICakeContext context) { var repositoryBranch = GetBranchName(context); - return !string.IsNullOrWhiteSpace(repositoryBranch) && StringComparer.OrdinalIgnoreCase.Equals("main", repositoryBranch); + return !string.IsNullOrWhiteSpace(repositoryBranch) && StringComparer.OrdinalIgnoreCase.Equals(Constants.DefaultBranch, repositoryBranch); } public static bool IsSupportBranch(this ICakeContext context) @@ -116,6 +82,12 @@ public static string GetOS(this ICakeContext context) return string.Empty; } + public static bool IsRunningOnAmd64(this ICakeContext _) + => RuntimeInformation.ProcessArchitecture == ProcessArchitecture.X64; + + public static bool IsRunningOnArm64(this ICakeContext _) => + RuntimeInformation.ProcessArchitecture == ProcessArchitecture.Arm64; + public static string GetBuildAgent(this ICakeContext context) { var buildSystem = context.BuildSystem(); @@ -132,30 +104,27 @@ public static string GetBuildAgent(this ICakeContext context) public static void StartGroup(this ICakeContext context, string title) { var buildSystem = context.BuildSystem(); - var startGroup = "[group]"; if (buildSystem.IsRunningOnAzurePipelines) { - startGroup = "##[group]"; + context.AzurePipelines().Commands.StartGroup(context, title); } else if (buildSystem.IsRunningOnGitHubActions) { - startGroup = "::group::"; + context.GitHubActions().Commands.StartGroup(title); } - context.Information($"{startGroup}{title}"); } + public static void EndGroup(this ICakeContext context) { var buildSystem = context.BuildSystem(); - var endgroup = "[endgroup]"; if (buildSystem.IsRunningOnAzurePipelines) { - endgroup = "##[endgroup]"; + context.AzurePipelines().Commands.EndGroup(context); } else if (buildSystem.IsRunningOnGitHubActions) { - endgroup = "::endgroup::"; + context.GitHubActions().Commands.EndGroup(); } - context.Information($"{endgroup}"); } public static bool ShouldRun(this ICakeContext context, bool criteria, string skipMessage) @@ -182,6 +151,39 @@ public static string GetBranchName(this ICakeContext context) { repositoryBranch = buildSystem.GitHubActions.Environment.Workflow.Ref.Replace("refs/heads/", ""); } + return repositoryBranch; } + + public static string GetRepositoryName(this ICakeContext context) + { + var buildSystem = context.BuildSystem(); + string repositoryName = string.Empty; + if (buildSystem.IsRunningOnAppVeyor) + { + repositoryName = buildSystem.AppVeyor.Environment.Repository.Name; + } + else if (buildSystem.IsRunningOnAzurePipelines) + { + repositoryName = buildSystem.AzurePipelines.Environment.Repository.RepoName; + } + else if (buildSystem.IsRunningOnGitHubActions) + { + repositoryName = buildSystem.GitHubActions.Environment.Workflow.Repository; + } + + return repositoryName; + } + + private static void StartGroup(this IAzurePipelinesCommands _, ICakeContext context, string title) => context.Information("##[group]{0}", title); + + private static void EndGroup(this IAzurePipelinesCommands _, ICakeContext context) => context.Information("##[endgroup]"); + + public static FilePath? GetGitVersionToolLocation(this ICakeContext context) => + context.GetFiles($"src/GitVersion.App/bin/{Constants.DefaultConfiguration}/net{Constants.DotnetLtsLatest}/gitversion.dll").SingleOrDefault(); + public static FilePath? GetGitVersionDotnetToolLocation(this ICakeContext context) => + context.MakeAbsolute(Paths.Tools.Combine("gitversion").CombineWithFilePath("gitversion.dll")); + + public static FilePath? GetSchemaDotnetToolLocation(this ICakeContext context) => + context.MakeAbsolute(Paths.Tools.Combine("schema").CombineWithFilePath("schema.dll")); } diff --git a/build/common/Utilities/DockerContextExtensions.cs b/build/common/Utilities/DockerContextExtensions.cs index 15a9f82e52..0c8443c1f8 100644 --- a/build/common/Utilities/DockerContextExtensions.cs +++ b/build/common/Utilities/DockerContextExtensions.cs @@ -1,4 +1,6 @@ using Xunit; +using DockerBuildXBuildSettings = Common.Addins.Cake.Docker.DockerBuildXBuildSettings; +using DockerBuildXImageToolsCreateSettings = Common.Addins.Cake.Docker.DockerBuildXImageToolsCreateSettings; namespace Common.Utilities; @@ -7,15 +9,32 @@ public enum Architecture Arm64, Amd64 } + public static class DockerContextExtensions { - public static bool SkipArm64Image(this ICakeContext context, DockerImage dockerImage) + private static readonly string[] Annotations = + [ + "org.opencontainers.image.authors=GitTools Maintainers", + "org.opencontainers.image.vendor=GitTools", + "org.opencontainers.image.licenses=MIT", + "org.opencontainers.image.source=https://github.com/GitTools/GitVersion.git", + "org.opencontainers.image.documentation=https://gitversion.net/docs/usage/docker", + $"org.opencontainers.image.created={DateTime.UtcNow:O}", + ]; + + public static bool SkipImageTesting(this ICakeContext context, DockerImage dockerImage) { - if (dockerImage.Architecture != Architecture.Arm64) return false; - if (!Constants.DistrosToSkip.Contains(dockerImage.Distro)) return false; + var (distro, targetFramework, architecture, _, _) = dockerImage; - context.Information($"Skipping Target: {dockerImage.TargetFramework}, Distro: {dockerImage.Distro}, Arch: {dockerImage.Architecture}"); - return true; + switch (architecture) + { + case Architecture.Amd64: + case Architecture.Arm64 when context.IsRunningOnArm64(): + return false; + default: + context.Information($"Skipping Target: {targetFramework}, Distro: {distro}, Arch: {architecture}"); + return true; + } } public static void DockerBuildImage(this BuildContextBase context, DockerImage dockerImage) @@ -26,74 +45,128 @@ public static void DockerBuildImage(this BuildContextBase context, DockerImage d context.Information($"Building image: {dockerImage}"); - var workDir = Paths.Src.Combine("Docker"); + var workDir = Paths.Build.Combine("docker"); var tags = context.GetDockerTags(dockerImage, arch); var suffix = arch.ToSuffix(); - var platforms = new List<string> { $"linux/{suffix}" }; + var imageSuffix = $"({distro}-{context.Version.NugetVersion}-{targetFramework}-{suffix})"; + var baseNameSuffix = $"{registry}/{Constants.DockerBaseImageName}:{distro}-runtime-{targetFramework}-{suffix}"; + var description = $"org.opencontainers.image.description=GitVersion images {imageSuffix}"; + var baseName = $"org.opencontainers.image.base.name={baseNameSuffix}"; + var version = $"org.opencontainers.image.version={context.Version.NugetVersion}"; + var revision = $"org.opencontainers.image.revision={context.Version.GitVersion.Sha}"; + var source = $"org.opencontainers.image.source=https://github.com/GitTools/GitVersion/blob/{context.Version.GitVersion.Sha}/build/docker/Dockerfile"; - var buildSettings = new DockerImageBuildSettings + var buildSettings = new DockerBuildXBuildSettings { Rm = true, + Pull = true, + // NoCache = true, Tag = tags.ToArray(), + Platform = [$"linux/{suffix}"], + Output = ["type=docker,oci-mediatypes=true"], File = workDir.CombineWithFilePath("Dockerfile").FullPath, - BuildArg = new[] - { - $"contentFolder=/content", + BuildArg = + [ + "nugetFolder=/nuget", $"REGISTRY={registry}", $"DOTNET_VERSION={targetFramework}", $"DISTRO={distro}", $"VERSION={context.Version.NugetVersion}" - }, - Pull = true, - Platform = string.Join(",", platforms), + ], + Label = + [ + "maintainers=GitTools Maintainers", + .. Annotations, + baseName, + version, + source, + revision, + description + ], + Annotation = + [ + .. Annotations, + baseName, + version, + source, + revision, + description + ] }; - context.DockerBuild(buildSettings, workDir.ToString(), "--output type=docker"); + context.DockerBuildXBuild(buildSettings, workDir.ToString()); } - public static void DockerPushImage(this BuildContextBase context, DockerImage dockerImage) + public static void DockerBuildXBuild(this ICakeContext context, DockerBuildXBuildSettings settings, + DirectoryPath target) { - var tags = context.GetDockerTags(dockerImage, dockerImage.Architecture); - foreach (var tag in tags) - { - context.DockerPush(tag); - } + ArgumentNullException.ThrowIfNull(context); + var runner = context.CreateRunner<DockerBuildXBuildSettings>(); + runner.Run("buildx build", settings, [target.ToString().EscapeProcessArgument()]); } - public static void DockerCreateManifest(this BuildContextBase context, DockerImage dockerImage, bool skipArm64Image) + public static void DockerManifest(this BuildContextBase context, DockerImage dockerImage) { + ArgumentNullException.ThrowIfNull(context.Version); var manifestTags = context.GetDockerTags(dockerImage); foreach (var tag in manifestTags) { - var manifestCreateSettings = new DockerManifestCreateSettings { Amend = true }; var amd64Tag = $"{tag}-{Architecture.Amd64.ToSuffix()}"; - if (skipArm64Image) - { - context.DockerManifestCreate(manifestCreateSettings, tag, amd64Tag); - } - else - { - var arm64Tag = $"{tag}-{Architecture.Arm64.ToSuffix()}"; - context.DockerManifestCreate(manifestCreateSettings, tag, amd64Tag, arm64Tag); - } + var arm64Tag = $"{tag}-{Architecture.Arm64.ToSuffix()}"; + + var settings = GetManifestSettings(dockerImage, context.Version, tag); + context.DockerBuildXImageToolsCreate(settings, [amd64Tag, arm64Tag]); } } - public static void DockerPushManifest(this BuildContextBase context, DockerImage dockerImage) + public static void DockerBuildXImageToolsCreate(this ICakeContext context, + DockerBuildXImageToolsCreateSettings settings, + IEnumerable<string>? target = null) { - var manifestTags = context.GetDockerTags(dockerImage); - foreach (var tag in manifestTags) + ArgumentNullException.ThrowIfNull(context); + var runner = context.CreateRunner<DockerBuildXImageToolsCreateSettings>(); + runner.Run("buildx imagetools create", settings, target?.ToArray() ?? []); + } + + private static GenericDockerRunner<TSettings> CreateRunner<TSettings>(this ICakeContext context) + where TSettings : AutoToolSettings, new() => + new(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); + + public static void DockerPushImage(this BuildContextBase context, DockerImage dockerImage) + { + var tags = context.GetDockerTags(dockerImage, dockerImage.Architecture); + foreach (var tag in tags) { - context.DockerManifestPush(new DockerManifestPushSettings { Purge = true }, tag); + context.DockerPush(tag); } } + public static DockerBuildXImageToolsCreateSettings GetManifestSettings(DockerImage dockerImage, BuildVersion buildVersion, string tag) + { + var imageSuffix = $"({dockerImage.Distro}-{buildVersion.NugetVersion}-{dockerImage.TargetFramework})"; + var description = $"org.opencontainers.image.description=GitVersion images {imageSuffix}"; + var version = $"org.opencontainers.image.version={buildVersion.NugetVersion}"; + var revision = $"org.opencontainers.image.revision={buildVersion.GitVersion.Sha}"; + var settings = new DockerBuildXImageToolsCreateSettings + { + Tag = [tag], + Annotation = + [ + .. Annotations.Select(a => "index:" + a).ToArray(), + $"index:{description}", + $"index:{version}", + $"index:{revision}" + ] + }; + return settings; + } + public static void DockerPullImage(this ICakeContext context, DockerImage dockerImage) { var tag = $"{dockerImage.DockerImageName()}:{dockerImage.Distro}-sdk-{dockerImage.TargetFramework}"; var platform = $"linux/{dockerImage.Architecture.ToString().ToLower()}"; - context.DockerPull(new DockerImagePullSettings { Platform = platform }, tag); + context.DockerPull(new() { Platform = platform }, tag); } public static void DockerTestImage(this BuildContextBase context, DockerImage dockerImage) @@ -101,7 +174,7 @@ public static void DockerTestImage(this BuildContextBase context, DockerImage do var tags = context.GetDockerTags(dockerImage, dockerImage.Architecture); foreach (var tag in tags) { - context.DockerTestRun(tag, dockerImage.Architecture, "/repo", "/showvariable", "FullSemver"); + context.DockerTestRun(tag, dockerImage.Architecture, "/repo", "/showvariable", "FullSemver", "/nocache"); } } @@ -111,73 +184,46 @@ public static void DockerTestArtifact(this BuildContextBase context, DockerImage context.DockerTestRun(tag, dockerImage.Architecture, "sh", cmd); } - private static void DockerBuild( - this ICakeContext context, - DockerImageBuildSettings settings, - string path, params string[] args) - { - GenericDockerRunner<DockerImageBuildSettings> genericDockerRunner = - new(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); - - string str; - switch (string.IsNullOrEmpty(path)) - { - case false: - { - string str2 = path.Trim(); - str = str2.Length <= 1 || !str2.StartsWith("\"") || !str2.EndsWith("\"") ? "\"" + path + "\"" : path; - break; - } - default: - str = path; - break; - } - var additional = args.Concat(new[] { str }).ToArray(); - genericDockerRunner.Run("buildx build", settings, additional); - } - - private static void DockerTestRun(this BuildContextBase context, string image, Architecture arch, string command, params string[] args) + private static void DockerTestRun(this BuildContextBase context, string image, Architecture arch, string command, + params string[] args) { + ArgumentNullException.ThrowIfNull(context.Version?.GitVersion.FullSemVer); var settings = GetDockerRunSettings(context, arch); context.Information($"Testing image: {image}"); - var output = context.DockerRunImage(settings, image, command, args); + var output = context.DockerRun(settings, image, command, args); context.Information("Output : " + output); - Assert.Contains(context.Version?.GitVersion.FullSemVer, output); + Assert.Contains(context.Version.GitVersion.FullSemVer, output); } - private static IEnumerable<string> GetDockerTags(this BuildContextBase context, DockerImage dockerImage, Architecture? arch = null) + + private static IEnumerable<string> GetDockerTags(this BuildContextBase context, DockerImage dockerImage, + Architecture? arch = null) { var name = dockerImage.DockerImageName(); var distro = dockerImage.Distro; var targetFramework = dockerImage.TargetFramework; - if (context.Version == null) return Enumerable.Empty<string>(); + if (context.Version == null) return []; var tags = new List<string> { $"{name}:{context.Version.Version}-{distro}-{targetFramework}", $"{name}:{context.Version.SemVersion}-{distro}-{targetFramework}", }; - if (distro == Constants.DockerDistroLatest && targetFramework == Constants.Version50) + if (distro == Constants.DockerDistroLatest && targetFramework == Constants.DotnetLtsLatest) { - tags.AddRange(new[] - { - $"{name}:{context.Version.Version}", - $"{name}:{context.Version.SemVersion}", - - $"{name}:{context.Version.Version}-{distro}", - $"{name}:{context.Version.SemVersion}-{distro}" - }); + tags.Add($"{name}:{context.Version.SemVersion}"); if (context.IsStableRelease) { - tags.AddRange(new[] - { + tags.AddRange( + [ + $"{name}:{context.Version.Version}", $"{name}:latest", $"{name}:latest-{targetFramework}", $"{name}:latest-{distro}", $"{name}:latest-{distro}-{targetFramework}", - }); + ]); } } @@ -185,9 +231,11 @@ private static IEnumerable<string> GetDockerTags(this BuildContextBase context, var suffix = arch.Value.ToSuffix(); return tags.Select(x => $"{x}-{suffix}").Distinct(); - } - private static string DockerImageName(this DockerImage image) => $"{image.Registry}/{(image.UseBaseImage ? Constants.DockerBaseImageName : Constants.DockerImageName)}"; + + private static string DockerImageName(this DockerImage image) => + $"{image.Registry}/{(image.UseBaseImage ? Constants.DockerBaseImageName : Constants.DockerImageName)}"; + private static DockerContainerRunSettings GetDockerRunSettings(this BuildContextBase context, Architecture arch) { var currentDir = context.MakeAbsolute(context.Directory(".")); @@ -195,56 +243,34 @@ private static DockerContainerRunSettings GetDockerRunSettings(this BuildContext var settings = new DockerContainerRunSettings { Rm = true, - Volume = new[] - { + Volume = + [ $"{currentDir}:{root}/repo", $"{currentDir}/tests/scripts:{root}/scripts", $"{currentDir}/artifacts/packages/nuget:{root}/nuget", - $"{currentDir}/artifacts/packages/native:{root}/native", - }, + $"{currentDir}/artifacts/packages/native:{root}/native" + ], Platform = $"linux/{arch.ToString().ToLower()}" }; if (context.IsAzurePipelineBuild) { - settings.Env = new[] - { + settings.Env = + [ "TF_BUILD=true", $"BUILD_SOURCEBRANCH={context.EnvironmentVariable("BUILD_SOURCEBRANCH")}" - }; + ]; } + if (context.IsGitHubActionsBuild) { - settings.Env = new[] - { + settings.Env = + [ "GITHUB_ACTIONS=true", $"GITHUB_REF={context.EnvironmentVariable("GITHUB_REF")}" - }; + ]; } return settings; } - private static string DockerRunImage(this ICakeContext context, DockerContainerRunSettings settings, string image, string command, params string[] args) - { - if (string.IsNullOrEmpty(image)) - { - throw new ArgumentNullException(nameof(image)); - } - var runner = new GenericDockerRunner<DockerContainerRunSettings>(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); - List<string> arguments = new() - { - image - }; - if (!string.IsNullOrEmpty(command)) - { - arguments.Add(command); - if (args.Length > 0) - { - arguments.AddRange(args); - } - } - - var result = runner.RunWithResult("run", settings, r => r.ToArray(), arguments.ToArray()); - return string.Join("\n", result); - } } diff --git a/build/common/Utilities/Extensions.cs b/build/common/Utilities/Extensions.cs index a4e10948dc..5691ef09fa 100644 --- a/build/common/Utilities/Extensions.cs +++ b/build/common/Utilities/Extensions.cs @@ -2,6 +2,9 @@ namespace Common.Utilities; public static class Extensions { + private static readonly char[] CharsThatRequireQuoting = [' ', '"']; + private static readonly char[] CharsThatRequireEscaping = ['\\', '"']; + public static IEnumerable<Type> FindAllDerivedTypes(this Assembly assembly, Type baseType) => from type in assembly.GetExportedTypes() let info = type.GetTypeInfo() @@ -10,10 +13,7 @@ where baseType.IsAssignableFrom(type) && info.IsClass && !info.IsAbstract public static string GetTaskDescription(this Type task) { - if (task is null) - { - throw new ArgumentNullException(nameof(task)); - } + ArgumentNullException.ThrowIfNull(task); var attribute = task.GetCustomAttribute<TaskDescriptionAttribute>(); return attribute != null ? attribute.Description : string.Empty; @@ -21,10 +21,7 @@ public static string GetTaskDescription(this Type task) public static string GetTaskName(this Type task) { - if (task is null) - { - throw new ArgumentNullException(nameof(task)); - } + ArgumentNullException.ThrowIfNull(task); var attribute = task.GetCustomAttribute<TaskNameAttribute>(); return attribute != null ? attribute.Name : task.Name; @@ -32,13 +29,10 @@ public static string GetTaskName(this Type task) public static string GetTaskArguments(this Type task) { - if (task is null) - { - throw new ArgumentNullException(nameof(task)); - } + ArgumentNullException.ThrowIfNull(task); var attributes = task.GetCustomAttributes<TaskArgumentAttribute>().ToArray(); - if (attributes.Any()) + if (attributes.Length != 0) { var arguments = attributes.Select(attribute => $"[--{attribute.Name} ({string.Join(" | ", attribute.PossibleValues)})]"); return string.Join(" ", arguments); @@ -60,4 +54,54 @@ public static DirectoryPath GetRootDirectory() } public static string ToSuffix(this Architecture arch) => arch.ToString().ToLower(); + + /// <summary> + /// Escapes arbitrary values so that the process receives the exact string you intend and injection is impossible. + /// Spec: https://msdn.microsoft.com/en-us/library/bb776391.aspx + /// </summary> + public static string EscapeProcessArgument(this string literalValue, bool alwaysQuote = false) + { + if (string.IsNullOrEmpty(literalValue)) return "\"\""; + + if (literalValue.IndexOfAny(CharsThatRequireQuoting) == -1) // Happy path + { + if (!alwaysQuote) return literalValue; + if (literalValue[^1] != '\\') return "\"" + literalValue + "\""; + } + + var sb = new StringBuilder(literalValue.Length + 8).Append('"'); + + var nextPosition = 0; + while (true) + { + var nextEscapeChar = literalValue.IndexOfAny(CharsThatRequireEscaping, nextPosition); + if (nextEscapeChar == -1) break; + + sb.Append(literalValue, nextPosition, nextEscapeChar - nextPosition); + nextPosition = nextEscapeChar + 1; + + switch (literalValue[nextEscapeChar]) + { + case '"': + sb.Append("\\\""); + break; + case '\\': + var numBackslashes = 1; + while (nextPosition < literalValue.Length && literalValue[nextPosition] == '\\') + { + numBackslashes++; + nextPosition++; + } + if (nextPosition == literalValue.Length || literalValue[nextPosition] == '"') + numBackslashes <<= 1; + + for (; numBackslashes != 0; numBackslashes--) + sb.Append('\\'); + break; + } + } + + sb.Append(literalValue, nextPosition, literalValue.Length - nextPosition).Append('"'); + return sb.ToString(); + } } diff --git a/build/common/Utilities/Models.cs b/build/common/Utilities/Models.cs index 3811de6b29..a90d493e16 100644 --- a/build/common/Utilities/Models.cs +++ b/build/common/Utilities/Models.cs @@ -1,3 +1,4 @@ +using Cake.Incubator.AssertExtensions; using Common.Addins.GitVersion; namespace Common.Utilities; @@ -10,28 +11,43 @@ public record GitHubCredentials(string Token, string? UserName = null); public record NugetCredentials(string ApiKey); +public record DockerHubCredentials(string Username, string Password); + public record ChocolateyCredentials(string ApiKey); -public record BuildVersion(GitVersion GitVersion, string? Version, string? Milestone, string? SemVersion, string? NugetVersion) +public record BuildVersion(GitVersion GitVersion, string? Version, string? Milestone, string? SemVersion, string? NugetVersion, string? ChocolateyVersion, bool IsPreRelease) { public static BuildVersion Calculate(GitVersion gitVersion) { var version = gitVersion.MajorMinorPatch; - var semVersion = gitVersion.LegacySemVer; - var nugetVersion = gitVersion.LegacySemVer; + var semVersion = gitVersion.SemVer; + var nugetVersion = gitVersion.SemVer; + var chocolateyVersion = gitVersion.MajorMinorPatch; + + if (!string.IsNullOrWhiteSpace(gitVersion.PreReleaseTag)) + { + // Chocolatey does not support pre-release tags with dots, so we replace them with dashes + // if the pre-release tag is a number, we add a "a" prefix to the pre-release tag + // the trick should be removed when Chocolatey supports semver 2.0 + var prefix = int.TryParse(gitVersion.PreReleaseLabel, out _) ? "a" : string.Empty; + chocolateyVersion += $"-{prefix}{gitVersion.PreReleaseTag?.Replace(".", "-")}"; + } if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaData)) { semVersion += $"-{gitVersion.BuildMetaData}"; + chocolateyVersion += $"-{gitVersion.BuildMetaData}"; nugetVersion += $".{gitVersion.BuildMetaData}"; } - return new BuildVersion( + return new( GitVersion: gitVersion, Version: version, - Milestone: version, + Milestone: semVersion, SemVersion: semVersion, - NugetVersion: nugetVersion?.ToLowerInvariant() + NugetVersion: nugetVersion?.ToLowerInvariant(), + ChocolateyVersion: chocolateyVersion?.ToLowerInvariant(), + IsPreRelease: !gitVersion.PreReleaseLabel.IsNullOrEmpty() ); } } diff --git a/build/common/Utilities/Paths.cs b/build/common/Utilities/Paths.cs index b3e366e76f..311512578c 100644 --- a/build/common/Utilities/Paths.cs +++ b/build/common/Utilities/Paths.cs @@ -8,16 +8,15 @@ public class Paths public static readonly DirectoryPath Src = Root.Combine("src"); public static readonly DirectoryPath Docs = Root.Combine("docs"); public static readonly DirectoryPath Build = Root.Combine("build"); + public static readonly DirectoryPath Schemas = Root.Combine("schemas"); + public static readonly DirectoryPath Tools = Root.Combine("tools"); public static readonly DirectoryPath Integration = Root.Combine("tests").Combine("integration"); - public static readonly DirectoryPath Nuspec = Build.Combine("nuspec"); - public static readonly DirectoryPath TestOutput = Artifacts.Combine("test-results"); public static readonly DirectoryPath Packages = Artifacts.Combine("packages"); public static readonly DirectoryPath ArtifactsDocs = Artifacts.Combine("docs"); public static readonly DirectoryPath Native = Packages.Combine("native"); public static readonly DirectoryPath Nuget = Packages.Combine("nuget"); - public static readonly DirectoryPath ArtifactsBinCmdline = Packages.Combine("prepare").Combine("cmdline"); public static readonly DirectoryPath ArtifactsBinPortable = Packages.Combine("prepare").Combine("portable"); } diff --git a/build/common/Utilities/TaskArgumentsAttribute.cs b/build/common/Utilities/TaskArgumentsAttribute.cs index 97da6a2c9c..658f84a3d1 100644 --- a/build/common/Utilities/TaskArgumentsAttribute.cs +++ b/build/common/Utilities/TaskArgumentsAttribute.cs @@ -5,13 +5,28 @@ namespace Common.Utilities; /// </summary> /// <seealso cref="Attribute" /> [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] -public class TaskArgumentAttribute : Attribute +public class TaskArgumentAttribute(string name, params string[] possibleValues) : Attribute { - public string Name { get; set; } - public string[] PossibleValues { get; set; } - public TaskArgumentAttribute(string name, params string[] possibleValues) - { - Name = name; - PossibleValues = possibleValues; - } + public string Name { get; } = name; + public string[] PossibleValues { get; } = possibleValues; } + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] +public class DotnetArgumentAttribute() + : TaskArgumentAttribute(Arguments.DotnetVersion, Constants.DotnetVersions); + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] +public class DockerDotnetArgumentAttribute() + : TaskArgumentAttribute(Arguments.DotnetVersion, Constants.DotnetVersions); + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] +public class DockerDistroArgumentAttribute() + : TaskArgumentAttribute(Arguments.DockerDistro, Constants.DockerDistros); + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] +public class DockerRegistryArgumentAttribute() + : TaskArgumentAttribute(Arguments.DockerRegistry, Constants.DockerRegistries); + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] +public class ArchitectureArgumentAttribute() + : TaskArgumentAttribute(Arguments.Architecture, Constants.Architectures); diff --git a/build/common/Utilities/Tools.cs b/build/common/Utilities/Tools.cs index 62ea1268b1..96aa0e5a60 100644 --- a/build/common/Utilities/Tools.cs +++ b/build/common/Utilities/Tools.cs @@ -2,10 +2,10 @@ namespace Common.Utilities; public class Tools { - public const string NugetCmd = "NuGet.CommandLine"; + public const string CodecovUploaderCmd = "CodecovUploader"; public static readonly Dictionary<string, string> Versions = new() { - { NugetCmd, "6.1.0" }, + { CodecovUploaderCmd, "0.8.0" } }; } diff --git a/build/common/common.csproj b/build/common/common.csproj index e9da2e2d31..37e57f80fc 100644 --- a/build/common/common.csproj +++ b/build/common/common.csproj @@ -6,8 +6,8 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Cake.Coverlet" Version="2.5.4" /> - <PackageReference Include="xunit.assert" Version="2.4.1" /> + <PackageReference Include="Cake.Coverlet" /> + <PackageReference Include="xunit.assert" /> </ItemGroup> </Project> diff --git a/build/config/BuildContext.cs b/build/config/BuildContext.cs new file mode 100644 index 0000000000..c8887be92f --- /dev/null +++ b/build/config/BuildContext.cs @@ -0,0 +1,3 @@ +namespace Config; + +public class BuildContext(ICakeContext context) : FrostingContext(context); diff --git a/build/chores/BuildLifetime.cs b/build/config/BuildLifetime.cs similarity index 78% rename from build/chores/BuildLifetime.cs rename to build/config/BuildLifetime.cs index 12dc380a02..33ed36b447 100644 --- a/build/chores/BuildLifetime.cs +++ b/build/config/BuildLifetime.cs @@ -1,10 +1,10 @@ using Common.Utilities; -namespace Chores; +namespace Config; public class BuildLifetime : FrostingLifetime<BuildContext> { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { context.StartGroup("Build Setup"); context.EndGroup(); diff --git a/build/chores/Program.cs b/build/config/Program.cs similarity index 63% rename from build/chores/Program.cs rename to build/config/Program.cs index e25d09e313..fa7f0858c3 100644 --- a/build/chores/Program.cs +++ b/build/config/Program.cs @@ -1,6 +1,5 @@ -using Chores; +using Config; return new CakeHost() .UseContext<BuildContext>() - .UseStartup<Startup>() .Run(args); diff --git a/build/config/Tasks/Default.cs b/build/config/Tasks/Default.cs new file mode 100644 index 0000000000..d0856394ee --- /dev/null +++ b/build/config/Tasks/Default.cs @@ -0,0 +1,4 @@ +namespace Config.Tasks; + +[TaskDescription("Shows this output")] +public class Default : Common.Tasks.Default; diff --git a/build/config/Tasks/SetMatrix.cs b/build/config/Tasks/SetMatrix.cs new file mode 100644 index 0000000000..666757cfa5 --- /dev/null +++ b/build/config/Tasks/SetMatrix.cs @@ -0,0 +1,20 @@ +using Cake.Json; + +namespace Config.Tasks; + +public class SetMatrix : FrostingTask<BuildContext> +{ + public override void Run(BuildContext context) + { + if (context.BuildSystem().IsRunningOnGitHubActions) + { + context.GitHubActions().Commands.SetOutputParameter("docker_distros", context.SerializeJson(Constants.DockerDistros)); + context.GitHubActions().Commands.SetOutputParameter("dotnet_versions", context.SerializeJson(Constants.DotnetVersions)); + } + else + { + context.Information("Docker Distros: {0}", context.SerializeJson(Constants.DockerDistros)); + context.Information("Dotnet Versions: {0}", context.SerializeJson(Constants.DotnetVersions)); + } + } +} diff --git a/build/chores/chores.csproj b/build/config/config.csproj similarity index 58% rename from build/chores/chores.csproj rename to build/config/config.csproj index 7795f57080..b668fa8eff 100644 --- a/build/chores/chores.csproj +++ b/build/config/config.csproj @@ -1,12 +1,12 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <AssemblyName>chores</AssemblyName> - <RootNamespace>Chores</RootNamespace> + <RootNamespace>Config</RootNamespace> + <PackageId>config</PackageId> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\common\common.csproj" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Cake.Json" Version="7.0.1" /> + <PackageReference Include="Cake.Json" /> </ItemGroup> </Project> diff --git a/build/docker/BuildContext.cs b/build/docker/BuildContext.cs index df8ba0067a..6c00a3458b 100644 --- a/build/docker/BuildContext.cs +++ b/build/docker/BuildContext.cs @@ -1,15 +1,9 @@ -using Common.Utilities; +using Common.Context; +using Docker.Utilities; namespace Docker; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : DockerBuildContext(context) { - public bool IsDockerOnLinux { get; set; } - - public IEnumerable<DockerImage> Images { get; set; } = new List<DockerImage>(); - public DockerRegistry DockerRegistry { get; set; } - - public BuildContext(ICakeContext context) : base(context) - { - } + public Credentials? Credentials { get; set; } } diff --git a/build/docker/BuildLifetime.cs b/build/docker/BuildLifetime.cs index d5703a06f9..2097f3b333 100644 --- a/build/docker/BuildLifetime.cs +++ b/build/docker/BuildLifetime.cs @@ -1,37 +1,14 @@ -using Common.Utilities; +using Common.Lifetime; +using Docker.Utilities; namespace Docker; -public class BuildLifetime : BuildLifetimeBase<BuildContext> +public class BuildLifetime : DockerBuildLifetime<BuildContext> { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { - base.Setup(context); + base.Setup(context, info); - context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", "") == "linux"; - - var architecture = context.HasArgument(Arguments.Architecture) ? context.Argument<Architecture>(Arguments.Architecture) : (Architecture?)null; - var dockerRegistry = context.Argument(Arguments.DockerRegistry, DockerRegistry.DockerHub); - var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower(); - var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower(); - - var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion }; - var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro }; - var archs = architecture.HasValue ? new[] { architecture.Value } : Constants.ArchToBuild; - - var registry = dockerRegistry == DockerRegistry.DockerHub ? Constants.DockerHubRegistry : Constants.GitHubContainerRegistry; - context.DockerRegistry = dockerRegistry; - context.Images = from version in versions - from distro in distros - from arch in archs - select new DockerImage(distro, version, arch, registry, false); - - context.StartGroup("Build Setup"); - - LogBuildInformation(context); - - context.Information("IsDockerOnLinux: {0}", context.IsDockerOnLinux); - context.Information($"Building for Version: {dotnetVersion}, Distro: {dockerDistro}"); - context.EndGroup(); + context.Credentials = Credentials.GetCredentials(context); } } diff --git a/src/Docker/Dockerfile b/build/docker/Dockerfile similarity index 68% rename from src/Docker/Dockerfile rename to build/docker/Dockerfile index ab0b41c847..aa95e656a6 100644 --- a/src/Docker/Dockerfile +++ b/build/docker/Dockerfile @@ -1,19 +1,20 @@ ARG REGISTRY='docker.io' -ARG DISTRO='debian-9' -ARG DOTNET_VERSION='3.1' -ARG VERSION='5.5.1' +ARG DISTRO='debian.12' +ARG DOTNET_VERSION='8.0' +ARG VERSION='6.4.0' FROM $REGISTRY/gittools/build-images:$DISTRO-sdk-$DOTNET_VERSION as installer -ARG contentFolder +ARG nugetFolder ARG VERSION -WORKDIR /app -COPY $contentFolder/ ./ +WORKDIR /nuget +COPY $nugetFolder/ ./ RUN dotnet tool install GitVersion.Tool --version $VERSION --tool-path /tools --add-source . FROM $REGISTRY/gittools/build-images:$DISTRO-runtime-$DOTNET_VERSION WORKDIR /tools COPY --from=installer /tools . +RUN git config --global --add safe.directory '*' ENTRYPOINT ["/tools/dotnet-gitversion"] diff --git a/build/docker/Program.cs b/build/docker/Program.cs index bf96d1c410..829e813ba4 100644 --- a/build/docker/Program.cs +++ b/build/docker/Program.cs @@ -7,5 +7,4 @@ .UseLifetime<BuildLifetime>() .UseTaskLifetime<BuildTaskLifetime>() .UseRootDirectory() - .InstallToolsFromRootManifest() .Run(args); diff --git a/build/docker/Tasks/Default.cs b/build/docker/Tasks/Default.cs index 57deb33a47..c414fa6931 100644 --- a/build/docker/Tasks/Default.cs +++ b/build/docker/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Docker.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/docker/Tasks/DockerBuild.cs b/build/docker/Tasks/DockerBuild.cs index d4a486fb09..da6586c776 100644 --- a/build/docker/Tasks/DockerBuild.cs +++ b/build/docker/Tasks/DockerBuild.cs @@ -4,10 +4,10 @@ namespace Docker.Tasks; [TaskName(nameof(DockerBuild))] [TaskDescription("Build the docker images containing the GitVersion Tool")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] -[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] +[ArchitectureArgument] public class DockerBuild : FrostingTask<BuildContext> { public override bool ShouldRun(BuildContext context) @@ -21,13 +21,12 @@ public override bool ShouldRun(BuildContext context) public override void Run(BuildContext context) { var tool = Paths.Nuget.CombineWithFilePath("GitVersion.Tool*"); - var dest = Paths.Src.Combine("Docker").Combine("content"); + var dest = Paths.Build.Combine("docker").Combine("nuget"); context.EnsureDirectoryExists(dest); context.CopyFiles(tool.FullPath, dest); foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; context.DockerBuildImage(dockerImage); } } diff --git a/build/docker/Tasks/DockerHubReadmePublish.cs b/build/docker/Tasks/DockerHubReadmePublish.cs new file mode 100644 index 0000000000..1cb840118c --- /dev/null +++ b/build/docker/Tasks/DockerHubReadmePublish.cs @@ -0,0 +1,136 @@ +using Cake.Http; +using Cake.Json; +using Common.Utilities; + +namespace Docker.Tasks; + +[TaskName(nameof(DockerHubReadmePublish))] +[IsDependentOn(typeof(DockerHubReadmePublishInternal))] +[TaskDescription("Publish the DockerHub updated README.md")] +public class DockerHubReadmePublish : FrostingTask<BuildContext>; + +[TaskName(nameof(DockerHubReadmePublishInternal))] +[TaskDescription("Publish the DockerHub updated README.md")] +public class DockerHubReadmePublishInternal : AsyncFrostingTask<BuildContext> +{ + public override bool ShouldRun(BuildContext context) + { + var shouldRun = true; + if (context.DockerRegistry == DockerRegistry.DockerHub) + { + shouldRun &= context.ShouldRun(context.IsStableRelease, $"{nameof(DockerHubReadmePublish)} works only for tagged releases."); + } + + return shouldRun; + } + + public override async Task RunAsync(BuildContext context) + { + ArgumentNullException.ThrowIfNull(context.Credentials?.DockerHub); + var readme = GetReadmeContent(context); + + context.Information("Publishing README.md to DockerHub"); + + context.Information("Logging in to DockerHub"); + var response = await context.HttpPostAsync("https://hub.docker.com/v2/users/login", settings => + { + var credentials = context.Credentials.DockerHub; + settings + .SetContentType("application/json") + .SetJsonRequestBody(new { username = credentials.Username, password = credentials.Password }); + }); + + context.Information("Updating README.md on DockerHub"); + context.HttpPatch("https://hub.docker.com/v2/repositories/gittools/gitversion", settings => + { + var token = context.ParseJson(response).Value<string>("token"); + settings + .SetContentType("application/json") + .SetAuthorization("JWT", token!) + .SetJsonRequestBody(new { full_description = readme }); + }); + context.Information("README.md updated on DockerHub"); + } + + private static string GetReadmeContent(BuildContextBase context) + { + ArgumentNullException.ThrowIfNull(context.Version); + var version = context.Version.GitVersion.MajorMinorPatch; + const string distro = Constants.AlpineLatest; + const string dotnetVersion = Constants.DotnetLtsLatest; + var tag = $"{version}-{distro}-{dotnetVersion}"; + // language=markdown + var readme = $""" +# GitVersion + +![GitVersion – From git log to SemVer in no time][banner] + +Versioning when using Git, solved. GitVersion looks at your git history and works out the [Semantic Version][semver] of the commit being built. + +This repository contains the Docker images for [GitVersion][website]. Source code can be found at [src](https://github.com/GitTools/GitVersion) + +## Usage + +The recommended image to run is `alpine`, as they are the smallest Docker images we provide. This will execute GitVersion for the current working directory (`$(pwd)`) on Linux and Unix or powershell on Windows: + +```sh +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag} /repo +``` + +The following command will execute GitVersion for the current working directory (`%CD%`) on Windows with CMD: + +```sh +docker run --rm -v "%CD%:/repo" gittools/gitversion:{tag} /repo +``` + +Note that the path `/repo` needs to be passed as an argument since the `gitversion` executable within the container is not aware of the fact that it's running inside a container. + +### CI Agents + +If you are running GitVersion on a CI agent, you may need to specify environment variables to allow GitVersion to work correctly. +For example, on Azure DevOps you may need to set the following environment variables: + +```sh +docker run --rm -v "$(pwd):/repo" --env TF_BUILD=true --env BUILD_SOURCEBRANCH=$(Build.SourceBranch) gittools/gitversion:{tag} /repo +``` + +On GitHub Actions, you may need to set the following environment variables: + +```sh +docker run --rm -v "$(pwd):/repo" --env GITHUB_ACTIONS=true --env GITHUB_REF=$(GITHUB_REF) gittools/gitversion:{tag} /repo +``` + +### Tags + +Most of the tags we provide have both arm64 and amd64 variants. If you need to pull a architecture specific tag you can do that like: + +```sh +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag}-amd64 /repo +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag}-arm64 /repo +``` + +## Quick Links + +* [Documentation][docs] +* [Contributing][contribute] +* [Why GitVersion][why] +* [Usage][usage] +* [How it works][how] +* [FAQ][faq] +* [Who is using GitVersion][who] + +[website]: https://gitversion.net +[docs]: https://gitversion.net/docs/ +[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md +[why]: https://gitversion.net/docs/learn/why +[usage]: https://gitversion.net/docs/usage +[how]: https://gitversion.net/docs/learn/how-it-works +[faq]: https://gitversion.net/docs/learn/faq +[who]: https://gitversion.net/docs/learn/who +[src]: https://github.com/GitTools/GitVersion +[semver]: https://semver.org +[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png +"""; + return readme; + } +} diff --git a/build/docker/Tasks/DockerManifest.cs b/build/docker/Tasks/DockerManifest.cs index efc7b9171c..ae099f781b 100644 --- a/build/docker/Tasks/DockerManifest.cs +++ b/build/docker/Tasks/DockerManifest.cs @@ -4,9 +4,9 @@ namespace Docker.Tasks; [TaskName(nameof(DockerManifest))] [TaskDescription("Publish the docker manifest containing the images for amd64 and arm64")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] [IsDependentOn(typeof(DockerManifestInternal))] public class DockerManifest : FrostingTask<BuildContext> { @@ -30,11 +30,11 @@ public override bool ShouldRun(BuildContext context) if (context.DockerRegistry == DockerRegistry.GitHub) { - shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsPreRelease, $"{nameof(DockerPublish)} to GitHub Package Registry works only for releases."); + shouldRun &= context.ShouldRun(context.IsInternalPreRelease, $"{nameof(DockerPublish)} to GitHub Package Registry works only internal releases."); } if (context.DockerRegistry == DockerRegistry.DockerHub) { - shouldRun &= context.ShouldRun(context.IsStableRelease, $"{nameof(DockerPublish)} DockerHub works only for tagged releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsTaggedPreRelease, $"{nameof(DockerPublish)} to DockerHub works only for tagged releases."); } return shouldRun; @@ -44,10 +44,8 @@ public override void Run(BuildContext context) { foreach (var group in context.Images.GroupBy(x => new { x.Distro, x.TargetFramework })) { - var amd64DockerImage = group.First(x => x.Architecture == Architecture.Amd64); - var arm64DockerImage = group.First(x => x.Architecture == Architecture.Arm64); - context.DockerCreateManifest(amd64DockerImage, context.SkipArm64Image(arm64DockerImage)); - context.DockerPushManifest(amd64DockerImage); + var dockerImage = group.First(); + context.DockerManifest(dockerImage); } } } diff --git a/build/docker/Tasks/DockerPublish.cs b/build/docker/Tasks/DockerPublish.cs index a065f81729..b230a4d59c 100644 --- a/build/docker/Tasks/DockerPublish.cs +++ b/build/docker/Tasks/DockerPublish.cs @@ -4,10 +4,10 @@ namespace Docker.Tasks; [TaskName(nameof(DockerPublish))] [TaskDescription("Publish the docker images containing the GitVersion Tool")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] -[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] +[ArchitectureArgument] [IsDependentOn(typeof(DockerPublishInternal))] public class DockerPublish : FrostingTask<BuildContext> { @@ -31,11 +31,11 @@ public override bool ShouldRun(BuildContext context) shouldRun &= context.ShouldRun(context.IsDockerOnLinux, $"{nameof(DockerPublish)} works only on Docker on Linux agents."); if (context.DockerRegistry == DockerRegistry.GitHub) { - shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsPreRelease, $"{nameof(DockerPublish)} to GitHub Package Registry works only for releases."); + shouldRun &= context.ShouldRun(context.IsInternalPreRelease, $"{nameof(DockerPublish)} to GitHub Package Registry works only for internal releases."); } if (context.DockerRegistry == DockerRegistry.DockerHub) { - shouldRun &= context.ShouldRun(context.IsStableRelease, $"{nameof(DockerPublish)} DockerHub works only for tagged releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsTaggedPreRelease, $"{nameof(DockerPublish)} to DockerHub works only for tagged releases."); } return shouldRun; @@ -45,7 +45,6 @@ public override void Run(BuildContext context) { foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; context.DockerPushImage(dockerImage); } } diff --git a/build/docker/Tasks/DockerTest.cs b/build/docker/Tasks/DockerTest.cs index e06616ea95..3acc68372a 100644 --- a/build/docker/Tasks/DockerTest.cs +++ b/build/docker/Tasks/DockerTest.cs @@ -4,10 +4,10 @@ namespace Docker.Tasks; [TaskName(nameof(DockerTest))] [TaskDescription("Test the docker images containing the GitVersion Tool")] -[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)] -[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)] -[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)] -[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)] +[DockerRegistryArgument] +[DockerDotnetArgument] +[DockerDistroArgument] +[ArchitectureArgument] [IsDependentOn(typeof(DockerBuild))] public class DockerTest : FrostingTask<BuildContext> { @@ -23,7 +23,7 @@ public override void Run(BuildContext context) { foreach (var dockerImage in context.Images) { - if (context.SkipArm64Image(dockerImage)) continue; + if (context.SkipImageTesting(dockerImage)) continue; context.DockerTestImage(dockerImage); } } diff --git a/build/docker/Utilities/Credentials.cs b/build/docker/Utilities/Credentials.cs new file mode 100644 index 0000000000..2f32094dd6 --- /dev/null +++ b/build/docker/Utilities/Credentials.cs @@ -0,0 +1,15 @@ +using Common.Utilities; + +namespace Docker.Utilities; + +public class Credentials +{ + public DockerHubCredentials? DockerHub { get; private init; } + + public static Credentials GetCredentials(ICakeContext context) => new() + { + DockerHub = new( + context.EnvironmentVariable("DOCKER_USERNAME"), + context.EnvironmentVariable("DOCKER_PASSWORD")), + }; +} diff --git a/build/docker/docker.csproj b/build/docker/docker.csproj index 4b1cccd25e..c7f9a603c9 100644 --- a/build/docker/docker.csproj +++ b/build/docker/docker.csproj @@ -6,4 +6,13 @@ <ItemGroup> <ProjectReference Include="..\common\common.csproj" /> </ItemGroup> + <ItemGroup> + <PackageReference Include="Cake.Http" /> + <PackageReference Include="Cake.Json" /> + </ItemGroup> + <ItemGroup> + <Compile Remove="content\**" /> + <EmbeddedResource Remove="content\**" /> + <None Remove="content\**" /> + </ItemGroup> </Project> diff --git a/build/docs/BuildContext.cs b/build/docs/BuildContext.cs index ca79d42541..c3b8efd477 100644 --- a/build/docs/BuildContext.cs +++ b/build/docs/BuildContext.cs @@ -4,13 +4,9 @@ namespace Docs; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : BuildContextBase(context) { public bool ForcePublish { get; set; } public Credentials? Credentials { get; set; } public WyamSettings? WyamSettings { get; set; } - - public BuildContext(ICakeContext context) : base(context) - { - } } diff --git a/build/docs/BuildLifetime.cs b/build/docs/BuildLifetime.cs index 34511e584a..db7ab45317 100644 --- a/build/docs/BuildLifetime.cs +++ b/build/docs/BuildLifetime.cs @@ -1,4 +1,5 @@ using Cake.Wyam; +using Common.Lifetime; using Common.Utilities; using Docs.Utilities; @@ -6,9 +7,9 @@ namespace Docs; public class BuildLifetime : BuildLifetimeBase<BuildContext> { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { - base.Setup(context); + base.Setup(context, info); context.Credentials = Credentials.GetCredentials(context); context.ForcePublish = context.HasArgument("force"); @@ -19,14 +20,18 @@ public override void Setup(BuildContext context) Theme = "Samson", OutputPath = context.MakeAbsolute(Paths.ArtifactsDocs.Combine("preview")), RootPath = context.MakeAbsolute(Paths.Docs), - ConfigurationFile = context.MakeAbsolute(Paths.Docs.CombineWithFilePath("config.wyam")), Settings = new Dictionary<string, object> { { "BaseEditUrl", "https://github.com/gittools/GitVersion/tree/main/docs/input/" }, { "SourceFiles", context.MakeAbsolute(Paths.Src) + "/**/{!bin,!obj,!packages,!*.Tests,!GitTools.*,}/**/*.cs" }, { "Title", "GitVersion" }, - { "IncludeGlobalNamespace", false } - } + { "IncludeGlobalNamespace", false }, + { "IgnoreFolders", "**/mdsource" } + }, + EnvironmentVariables = new Dictionary<string, string> + { + { "DOTNET_ROLL_FORWARD", "Major" }, + }, }; context.StartGroup("Build Setup"); diff --git a/build/docs/Tasks/Default.cs b/build/docs/Tasks/Default.cs index 86555fbb28..9413406fc1 100644 --- a/build/docs/Tasks/Default.cs +++ b/build/docs/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Docs.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/docs/Tasks/GenerateSchemas.cs b/build/docs/Tasks/GenerateSchemas.cs new file mode 100644 index 0000000000..ffa1d1804f --- /dev/null +++ b/build/docs/Tasks/GenerateSchemas.cs @@ -0,0 +1,22 @@ +using Common.Utilities; + +namespace Docs.Tasks; + +[TaskName(nameof(GenerateSchemas))] +[TaskDescription("Generate schemas")] +public sealed class GenerateSchemas : FrostingTask<BuildContext> +{ + public override void Run(BuildContext context) + { + ArgumentNullException.ThrowIfNull(context.Version); + var schemaTool = context.GetSchemaDotnetToolLocation(); + var gitVersion = context.Version.GitVersion; + var version = $"{gitVersion.Major}.{gitVersion.Minor}"; + var schemaTargetDir = context.MakeAbsolute(Paths.Root.Combine("schemas")); + context.EnsureDirectoryExists(schemaTargetDir); + context.Information($"Schema tool: {schemaTool}"); + context.Information($"Schema target dir: {schemaTargetDir}"); + context.Information($"Schema version: {version}"); + context.DotNetExecute(schemaTool, $"--Version {version} --OutputDirectory {schemaTargetDir}"); + } +} diff --git a/build/docs/Tasks/PreviewDocs.cs b/build/docs/Tasks/PreviewDocs.cs index a25084e268..a9734dd97c 100644 --- a/build/docs/Tasks/PreviewDocs.cs +++ b/build/docs/Tasks/PreviewDocs.cs @@ -20,8 +20,13 @@ public override void Run(BuildContext context) { if (context.WyamSettings is not null) { + var schemaTargetDir = Paths.ArtifactsDocs.Combine("preview").Combine("schemas"); + context.EnsureDirectoryExists(schemaTargetDir); + context.CopyDirectory(Paths.Schemas, schemaTargetDir); + context.WyamSettings.Preview = true; context.WyamSettings.Watch = true; + context.WyamSettings.NoClean = true; context.WyamSettings.Settings.Add("Host", "gittools.github.io"); context.Wyam(context.WyamSettings); } diff --git a/build/docs/Tasks/PublishDocs.cs b/build/docs/Tasks/PublishDocs.cs index d9f1c7d06b..7fa1ce3c9a 100644 --- a/build/docs/Tasks/PublishDocs.cs +++ b/build/docs/Tasks/PublishDocs.cs @@ -1,4 +1,5 @@ using Cake.Git; +using Cake.Npx; using Cake.Wyam; using Common.Utilities; @@ -27,7 +28,7 @@ public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.DirectoryExists(Paths.Docs), "Wyam documentation directory is missing"); - shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsPreRelease || context.ForcePublish, $"{nameof(PublishDocs)} works only for releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.ForcePublish, $"{nameof(PublishDocs)} works only for releases."); return shouldRun; } @@ -58,7 +59,7 @@ private static bool AnyDocsChanged(ICakeContext context) var filesChanged = context.GitDiff(Paths.Root, sourceCommit.Sha); const string path = "docs/"; - var docFileChanged = filesChanged.Any(file => file.OldPath.StartsWith(path) || file.Path.StartsWith(path) || file.Path.Contains("config.wyam")); + var docFileChanged = filesChanged.Any(file => file.OldPath.StartsWith(path) || file.Path.StartsWith(path)); return docFileChanged; } @@ -68,7 +69,7 @@ private static void PublishDocumentation(BuildContext context) var sourceCommit = context.GitLogTip("./"); var publishFolder = context.MakeAbsolute(Paths.ArtifactsDocs.Combine("_published").Combine(DateTime.Now.ToString("yyyyMMdd_HHmmss"))); - context.Information("Publishing Folder: {0}", publishFolder); + context.Information($"Publishing Folder: {publishFolder}"); context.Information("Getting publish branch..."); context.GitClone($"https://github.com/%7BConstants.RepoOwner%7D/%7BConstants.Repository%7D", publishFolder, new GitCloneSettings { @@ -80,8 +81,13 @@ private static void PublishDocumentation(BuildContext context) context.WyamSettings.OutputPath = publishFolder; context.WyamSettings.NoClean = true; context.Wyam(context.WyamSettings); + context.Npx("prettier", arguments: "--write **/*.html", configureSettings: settings => settings.WorkingDirectory = publishFolder); } + var schemaTargetDir = publishFolder.Combine("schemas"); + context.EnsureDirectoryExists(schemaTargetDir); + context.CopyDirectory(Paths.Schemas, schemaTargetDir); + if (!context.GitHasUncommitedChanges(publishFolder)) return; context.Information("Stage all changes..."); diff --git a/build/docs/Utilities/Credentials.cs b/build/docs/Utilities/Credentials.cs index 1726315379..13de8ec6db 100644 --- a/build/docs/Utilities/Credentials.cs +++ b/build/docs/Utilities/Credentials.cs @@ -4,10 +4,10 @@ namespace Docs.Utilities; public class Credentials { - public GitHubCredentials? GitHub { get; private set; } + public GitHubCredentials? GitHub { get; private init; } public static Credentials GetCredentials(ICakeContext context) => new() { - GitHub = new GitHubCredentials( + GitHub = new( context.EnvironmentVariable("GITHUB_TOKEN"), context.EnvironmentVariable("GITHUB_USERNAME")) }; diff --git a/build/docs/docs.csproj b/build/docs/docs.csproj index 89058b02d8..0fcfc39a3f 100644 --- a/build/docs/docs.csproj +++ b/build/docs/docs.csproj @@ -7,7 +7,8 @@ <ProjectReference Include="..\common\common.csproj" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Cake.Git" Version="2.0.0" /> - <PackageReference Include="Cake.Wyam2" Version="3.0.0-rc2" /> + <PackageReference Include="Cake.Frosting.Git" /> + <PackageReference Include="Cake.Npx" /> + <PackageReference Include="Cake.Wyam" /> </ItemGroup> </Project> diff --git a/build/global.json b/build/global.json deleted file mode 100644 index 07fa13d9ea..0000000000 --- a/build/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sdk": { - "version": "5.0", - "rollForward": "latestMajor", - "allowPrerelease": true - } -} diff --git a/build/nuspec/GitVersion.CommandLine.nuspec b/build/nuspec/GitVersion.CommandLine.nuspec deleted file mode 100644 index 8fac567a70..0000000000 --- a/build/nuspec/GitVersion.CommandLine.nuspec +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> - <metadata> - <id>GitVersion.CommandLine</id> - <version>$version$</version> - <title>GitVersion.CommandLine - GitTools and Contributors - GitTools and Contributors - MIT - Copyright GitTools 2021. - https://github.com/GitTools/GitVersion - - package_icon.png - false - Derives SemVer information from a repository following GitFlow or GitHubFlow. - Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer - true - https://github.com/GitTools/GitVersion/releases - README.md - - diff --git a/build/nuspec/GitVersion.Portable.nuspec b/build/nuspec/GitVersion.Portable.nuspec deleted file mode 100644 index 2afbeaa19f..0000000000 --- a/build/nuspec/GitVersion.Portable.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - GitVersion.Portable - $version$ - GitVersion - GitTools and Contributors - GitTools and Contributors - Copyright GitTools 2021. - http://www.opensource.org/licenses/mit-license.php - https://github.com/GitTools/GitVersion - https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/Color/icon_100x100.png - false - Derives SemVer information from a repository following GitFlow or GitHubFlow. - Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer - https://github.com/GitTools/GitVersion/releases - - diff --git a/build/nuspec/README.md b/build/nuspec/README.md index 108f089325..02b3c0314a 100644 --- a/build/nuspec/README.md +++ b/build/nuspec/README.md @@ -5,11 +5,10 @@ works out the [Semantic Version][semver] of the commit being built. [![Gitter][gitter-badge]][gitter] -| Artifact | Stable | | -| :------------------------- | :----------------------------------------------------------------- | - | -| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | -| **GitVersion.CommandLine** | [![NuGet][gvcl-badge]][gvcl] | -| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask][gitversiontask] before v5.6.0 | +| Artifact | Stable | +|:-----------------------|:-----------------------------| +| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | +| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | ## Compatibility @@ -17,13 +16,13 @@ GitVersion works on Windows, Linux, and Mac. ## Quick Links -* [Documentation][docs] -* [Contributing][contribute] -* [Why GitVersion][why] -* [Usage][usage] -* [How it works][how] -* [FAQ][faq] -* [Who is using GitVersion][who] +* [Documentation][docs] +* [Contributing][contribute] +* [Why GitVersion][why] +* [Usage][usage] +* [How it works][how] +* [FAQ][faq] +* [Who is using GitVersion][who] ## GitVersion in action! @@ -31,8 +30,8 @@ GitVersion works on Windows, Linux, and Mac. You are seeing: -* Pull requests being built as pre-release builds -* A branch called `release-1.0.0` producing beta v1 packages +* Pull requests being built as pre-release builds +* A branch called `release-1.0.0` producing beta v1 packages ## Icon @@ -40,24 +39,38 @@ You are seeing: designed by [David Chapman][app-icon-author] from The Noun Project. -[semver]: http://semver.org -[gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge -[gitter-badge]: https://badges.gitter.im/Join+Chat.svg -[docs]: https://gitversion.net/docs/ -[gvt]: https://www.nuget.org/packages/GitVersion.MsBuild -[gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget -[gitversiontask]: https://www.nuget.org/packages/GitVersionTask/ -[gvcl]: https://www.nuget.org/packages/GitVersion.CommandLine -[gvcl-badge]: https://img.shields.io/nuget/v/GitVersion.CommandLine.svg?logo=nuget -[gvgt]: https://www.nuget.org/packages/GitVersion.Tool -[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget -[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md -[why]: https://gitversion.net/docs/learn/why -[usage]: https://gitversion.net/docs/usage -[how]: https://gitversion.net/docs/learn/how-it-works -[faq]: https://gitversion.net/docs/learn/faq -[who]: https://gitversion.net/docs/learn/who -[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png -[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png -[app-icon]: https://thenounproject.com/term/tree/13389/ -[app-icon-author]: http://thenounproject.com/david.chapman +[semver]: http://semver.org + +[gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + +[gitter-badge]: https://badges.gitter.im/Join+Chat.svg + +[docs]: https://gitversion.net/docs/ + +[gvt]: https://www.nuget.org/packages/GitVersion.MsBuild + +[gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget + +[gvgt]: https://www.nuget.org/packages/GitVersion.Tool + +[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget + +[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md + +[why]: https://gitversion.net/docs/learn/why + +[usage]: https://gitversion.net/docs/usage + +[how]: https://gitversion.net/docs/learn/how-it-works + +[faq]: https://gitversion.net/docs/learn/faq + +[who]: https://gitversion.net/docs/learn/who + +[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png + +[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png + +[app-icon]: https://thenounproject.com/term/tree/13389/ + +[app-icon-author]: http://thenounproject.com/david.chapman diff --git a/build/nuspec/VERIFICATION.txt b/build/nuspec/VERIFICATION.txt index bd0489649b..ac647c6a62 100644 --- a/build/nuspec/VERIFICATION.txt +++ b/build/nuspec/VERIFICATION.txt @@ -4,4 +4,4 @@ in verifying that this package's contents are trustworthy. This package is published by the GitTools organization itself. The binaries are identical to other package types published by the project, in particular -the GitVersion.Portable nuget package. +the GitVersion.Portable and GitVersion nuget package. diff --git a/build/publish/BuildContext.cs b/build/publish/BuildContext.cs index 5ad09ee4fa..e2ef7d662e 100644 --- a/build/publish/BuildContext.cs +++ b/build/publish/BuildContext.cs @@ -3,12 +3,9 @@ namespace Publish; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : BuildContextBase(context) { public Credentials? Credentials { get; set; } - public List Packages { get; set; } = new(); - public BuildContext(ICakeContext context) : base(context) - { - } + public List Packages { get; } = []; } diff --git a/build/publish/BuildLifetime.cs b/build/publish/BuildLifetime.cs index 7746522c9a..f7672f8c82 100644 --- a/build/publish/BuildLifetime.cs +++ b/build/publish/BuildLifetime.cs @@ -1,3 +1,4 @@ +using Common.Lifetime; using Common.Utilities; using Publish.Utilities; @@ -5,9 +6,10 @@ namespace Publish; public class BuildLifetime : BuildLifetimeBase { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { - base.Setup(context); + base.Setup(context, info); + context.Credentials = Credentials.GetCredentials(context); if (context.Version?.NugetVersion != null) @@ -18,7 +20,9 @@ public override void Setup(BuildContext context) foreach (var packageFile in nugetPackagesFiles) { var packageName = packageFile.GetFilenameWithoutExtension().ToString()[..^(nugetVersion.Length + 1)].ToLower(); - context.Packages.Add(new NugetPackage(packageName, packageFile, packageName.Contains("Portable", StringComparison.OrdinalIgnoreCase))); + var isChocoPackage = packageName.Equals("GitVersion.Portable", StringComparison.OrdinalIgnoreCase) || + packageName.Equals("GitVersion", StringComparison.OrdinalIgnoreCase); + context.Packages.Add(new NugetPackage(packageName, packageFile, isChocoPackage)); } } context.StartGroup("Build Setup"); diff --git a/build/publish/Program.cs b/build/publish/Program.cs index 855c9a6af0..d3b1a60ff1 100644 --- a/build/publish/Program.cs +++ b/build/publish/Program.cs @@ -7,5 +7,4 @@ .UseLifetime() .UseTaskLifetime() .UseRootDirectory() - .InstallToolsFromRootManifest() .Run(args); diff --git a/build/publish/Tasks/Default.cs b/build/publish/Tasks/Default.cs index eed5903ce5..88260f7a6d 100644 --- a/build/publish/Tasks/Default.cs +++ b/build/publish/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Publish.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/publish/Tasks/PublishChocolatey.cs b/build/publish/Tasks/PublishChocolatey.cs index 373fd457ac..078f555dc0 100644 --- a/build/publish/Tasks/PublishChocolatey.cs +++ b/build/publish/Tasks/PublishChocolatey.cs @@ -7,25 +7,23 @@ namespace Publish.Tasks; [TaskName(nameof(PublishChocolatey))] [TaskDescription("Publish chocolatey packages")] [IsDependentOn(typeof(PublishChocolateyInternal))] -public class PublishChocolatey : FrostingTask -{ -} +public class PublishChocolatey : FrostingTask; [TaskName(nameof(PublishChocolateyInternal))] [TaskDescription("Publish chocolatey packages")] -public class PublishChocolateyInternal : FrostingTask +public class PublishChocolateyInternal : AsyncFrostingTask { public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.IsGitHubActionsBuild, $"{nameof(PublishChocolatey)} works only on GitHub Actions."); shouldRun &= context.ShouldRun(context.IsOnWindows, $"{nameof(PublishChocolatey)} works only on windows."); - shouldRun &= context.ShouldRun(context.IsStableRelease, $"{nameof(PublishChocolatey)} works only for stable releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsTaggedPreRelease, $"{nameof(PublishChocolatey)} works only for tagged releases."); return shouldRun; } - public override void Run(BuildContext context) + public override async Task RunAsync(BuildContext context) { var apiKey = context.Credentials?.Chocolatey?.ApiKey; if (string.IsNullOrEmpty(apiKey)) @@ -33,27 +31,32 @@ public override void Run(BuildContext context) throw new InvalidOperationException("Could not resolve Chocolatey API key."); } - var nugetVersion = context.Version!.NugetVersion; - foreach (var (packageName, filePath, _) in context.Packages.Where(x => x.IsChocoPackage)) + ArgumentNullException.ThrowIfNull(context.Version); + var nugetVersion = context.Version.NugetVersion; + var packages = context.Packages + .Where(x => x.IsChocoPackage) + .OrderByDescending(x => x.PackageName); + foreach (var (packageName, filePath, _) in packages) { - if (!IsPackagePublished(context, packageName, nugetVersion)) + if (IsPackagePublished(context, packageName, nugetVersion)) continue; + try { - try - { - context.Information($"Package {packageName}, version {nugetVersion} is being published."); - context.ChocolateyPush(filePath.FullPath, new ChocolateyPushSettings - { - ApiKey = apiKey, - Source = Constants.ChocolateyUrl, - Force = true - }); - } - catch (Exception) + context.Information($"Package {packageName}, version {nugetVersion} is being published."); + context.ChocolateyPush(filePath.FullPath, new ChocolateyPushSettings { - context.Warning($"There is an exception publishing the Package {packageName}."); - // chocolatey sometimes fails with an error, even if the package gets pushed - } + ApiKey = apiKey, + Source = Constants.ChocolateyUrl, + Force = true + }); } + catch (Exception) + { + context.Warning($"There is an exception publishing the Package {packageName}."); + // chocolatey sometimes fails with an error, even if the package gets pushed + } + + // wait 5 seconds to avoid the meta-package to be published before the other packages + await Task.Delay(TimeSpan.FromSeconds(5)); } } diff --git a/build/publish/Tasks/PublishNuget.cs b/build/publish/Tasks/PublishNuget.cs index 25e40afb62..59649a35af 100644 --- a/build/publish/Tasks/PublishNuget.cs +++ b/build/publish/Tasks/PublishNuget.cs @@ -6,9 +6,7 @@ namespace Publish.Tasks; [TaskName(nameof(PublishNuget))] [TaskDescription("Publish nuget packages")] [IsDependentOn(typeof(PublishNugetInternal))] -public class PublishNuget : FrostingTask -{ -} +public class PublishNuget : FrostingTask; [TaskName(nameof(PublishNugetInternal))] [TaskDescription("Publish nuget packages")] @@ -18,7 +16,7 @@ public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.IsGitHubActionsBuild, $"{nameof(PublishNuget)} works only on GitHub Actions."); - shouldRun &= context.ShouldRun(context.IsPreRelease || context.IsStableRelease, $"{nameof(PublishNuget)} works only for releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsTaggedPreRelease || context.IsInternalPreRelease, $"{nameof(PublishNuget)} works only for releases."); return shouldRun; } @@ -26,30 +24,34 @@ public override bool ShouldRun(BuildContext context) public override void Run(BuildContext context) { // publish to github packages for commits on main and on original repo - if (context.IsGitHubActionsBuild && context.IsOnMainOrSupportBranchOriginalRepo) + if (context.IsInternalPreRelease) { + context.StartGroup("Publishing to GitHub Packages"); var apiKey = context.Credentials?.GitHub?.Token; if (string.IsNullOrEmpty(apiKey)) { throw new InvalidOperationException("Could not resolve NuGet GitHub Packages API key."); } PublishToNugetRepo(context, apiKey, Constants.GithubPackagesUrl); + context.EndGroup(); } - // publish to nuget.org for stable releases - if (context.IsStableRelease) + // publish to nuget.org for tagged releases + if (context.IsStableRelease || context.IsTaggedPreRelease) { + context.StartGroup("Publishing to Nuget.org"); var apiKey = context.Credentials?.Nuget?.ApiKey; if (string.IsNullOrEmpty(apiKey)) { throw new InvalidOperationException("Could not resolve NuGet org API key."); } - PublishToNugetRepo(context, apiKey, Constants.NugetOrgUrl); + context.EndGroup(); } } private static void PublishToNugetRepo(BuildContext context, string apiKey, string apiUrl) { - var nugetVersion = context.Version!.NugetVersion; + ArgumentNullException.ThrowIfNull(context.Version); + var nugetVersion = context.Version.NugetVersion; foreach (var (packageName, filePath, _) in context.Packages.Where(x => !x.IsChocoPackage)) { context.Information($"Package {packageName}, version {nugetVersion} is being published."); diff --git a/build/publish/Utilities/Credentials.cs b/build/publish/Utilities/Credentials.cs index e8cf943c20..aa2ef63082 100644 --- a/build/publish/Utilities/Credentials.cs +++ b/build/publish/Utilities/Credentials.cs @@ -4,14 +4,14 @@ namespace Publish.Utilities; public class Credentials { - public GitHubCredentials? GitHub { get; private set; } - public NugetCredentials? Nuget { get; private set; } - public ChocolateyCredentials? Chocolatey { get; private set; } + public GitHubCredentials? GitHub { get; private init; } + public NugetCredentials? Nuget { get; private init; } + public ChocolateyCredentials? Chocolatey { get; private init; } public static Credentials GetCredentials(ICakeContext context) => new() { - GitHub = new GitHubCredentials(context.EnvironmentVariable("GITHUB_TOKEN")), - Nuget = new NugetCredentials(context.EnvironmentVariable("NUGET_API_KEY")), - Chocolatey = new ChocolateyCredentials(context.EnvironmentVariable("CHOCOLATEY_API_KEY")), + GitHub = new(context.EnvironmentVariable("GITHUB_TOKEN")), + Nuget = new(context.EnvironmentVariable("NUGET_API_KEY")), + Chocolatey = new(context.EnvironmentVariable("CHOCOLATEY_API_KEY")), }; } diff --git a/build/release/BuildContext.cs b/build/release/BuildContext.cs index 7b01b01652..d29e09cd0a 100644 --- a/build/release/BuildContext.cs +++ b/build/release/BuildContext.cs @@ -3,11 +3,7 @@ namespace Release; -public class BuildContext : BuildContextBase +public class BuildContext(ICakeContext context) : BuildContextBase(context) { public Credentials? Credentials { get; set; } - - public BuildContext(ICakeContext context) : base(context) - { - } } diff --git a/build/release/BuildLifetime.cs b/build/release/BuildLifetime.cs index 26244e2b05..5bf3901bdf 100644 --- a/build/release/BuildLifetime.cs +++ b/build/release/BuildLifetime.cs @@ -1,3 +1,4 @@ +using Common.Lifetime; using Common.Utilities; using Release.Utilities; @@ -5,9 +6,10 @@ namespace Release; public class BuildLifetime : BuildLifetimeBase { - public override void Setup(BuildContext context) + public override void Setup(BuildContext context, ISetupContext info) { - base.Setup(context); + base.Setup(context, info); + context.Credentials = Credentials.GetCredentials(context); context.StartGroup("Build Setup"); diff --git a/build/release/Tasks/Default.cs b/build/release/Tasks/Default.cs index e842138737..595447a5db 100644 --- a/build/release/Tasks/Default.cs +++ b/build/release/Tasks/Default.cs @@ -1,6 +1,4 @@ namespace Release.Tasks; [TaskDescription("Shows this output")] -public class Default : Common.Tasks.Default -{ -} +public class Default : Common.Tasks.Default; diff --git a/build/release/Tasks/PublishRelease.cs b/build/release/Tasks/PublishRelease.cs index cb1881fe4b..7bbaf8ea9c 100644 --- a/build/release/Tasks/PublishRelease.cs +++ b/build/release/Tasks/PublishRelease.cs @@ -8,9 +8,7 @@ namespace Release.Tasks; [TaskDescription("Publish release")] [IsDependentOn(typeof(PublishReleaseInternal))] -public class PublishRelease : FrostingTask -{ -} +public class PublishRelease : FrostingTask; [TaskName(nameof(PublishReleaseInternal))] [TaskDescription("Publish release")] @@ -20,7 +18,7 @@ public override bool ShouldRun(BuildContext context) { var shouldRun = true; shouldRun &= context.ShouldRun(context.IsGitHubActionsBuild, $"{nameof(PublishRelease)} works only on GitHub Actions."); - shouldRun &= context.ShouldRun(context.IsStableRelease, $"{nameof(PublishRelease)} works only for releases."); + shouldRun &= context.ShouldRun(context.IsStableRelease || context.IsTaggedPreRelease, $"{nameof(PublishRelease)} works only for tagged releases."); return shouldRun; } @@ -47,7 +45,7 @@ public override void Run(BuildContext context) Milestone = milestone, Name = milestone, Prerelease = false, - TargetCommitish = "main" + TargetCommitish = Constants.DefaultBranch }); context.GitReleaseManagerAddAssets(token, Constants.RepoOwner, Constants.Repository, milestone, assets); diff --git a/build/release/Utilities/Credentials.cs b/build/release/Utilities/Credentials.cs index c71f6cf92f..ab698c4f95 100644 --- a/build/release/Utilities/Credentials.cs +++ b/build/release/Utilities/Credentials.cs @@ -4,9 +4,9 @@ namespace Release.Utilities; public class Credentials { - public GitHubCredentials? GitHub { get; private set; } + public GitHubCredentials? GitHub { get; private init; } public static Credentials GetCredentials(ICakeContext context) => new() { - GitHub = new GitHubCredentials(context.EnvironmentVariable("GITHUB_TOKEN")), + GitHub = new(context.EnvironmentVariable("GITHUB_TOKEN")), }; } diff --git a/docs/config.wyam b/docs/config.wyam deleted file mode 100644 index c242a361ce..0000000000 --- a/docs/config.wyam +++ /dev/null @@ -1 +0,0 @@ -Pipelines["RenderPages"].Replace("WriteMetadata", new Headings(2)); diff --git a/docs/input/_Bottom.cshtml b/docs/input/_Bottom.cshtml index 16443c0a8a..348bc073e6 100644 --- a/docs/input/_Bottom.cshtml +++ b/docs/input/_Bottom.cshtml @@ -1,9 +1,3 @@ - - diff --git a/docs/input/_Navbar.cshtml b/docs/input/_Navbar.cshtml new file mode 100644 index 0000000000..3a1031af19 --- /dev/null +++ b/docs/input/_Navbar.cshtml @@ -0,0 +1,13 @@ +@{ + List> pages = new List> + { + Tuple.Create("Documentation", Context.GetLink("docs")), + Tuple.Create("API", Context.GetLink("api")), + Tuple.Create(" 5.12.0", "/5.12.0/docs"), + }; + foreach(Tuple p in pages) + { + string active = Context.GetLink(Document).StartsWith(p.Item2) ? "active" : null; +
  • @Html.Raw(p.Item1)
  • + } +} \ No newline at end of file diff --git a/docs/input/assets/css/override.less b/docs/input/assets/css/override.less index 44b3897492..b5b943276c 100644 --- a/docs/input/assets/css/override.less +++ b/docs/input/assets/css/override.less @@ -105,10 +105,6 @@ body.layout-boxed .top-banner, font-size: 50px; } -.gitter-open-chat-button { - background-color: @purple; -} - main { font-size: 2rem; } diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png new file mode 100644 index 0000000000..124c10cca2 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png new file mode 100644 index 0000000000..2a499a520a Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png new file mode 100644 index 0000000000..af6daf6711 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png new file mode 100644 index 0000000000..1a0109bf9a Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png new file mode 100644 index 0000000000..24b77c37b1 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png new file mode 100644 index 0000000000..e38e6cc065 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png new file mode 100644 index 0000000000..f9a695b7da Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png new file mode 100644 index 0000000000..c9d0ca996e Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitHubFlow_FeatureBranch.png b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_FeatureBranch.png new file mode 100644 index 0000000000..af6daf6711 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_FeatureBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitHubFlow_ReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_ReleaseBranch.png new file mode 100644 index 0000000000..22d7a76e47 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_ReleaseBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitHubFlow_VersionedReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_VersionedReleaseBranch.png new file mode 100644 index 0000000000..f95e478d5c Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitHubFlow_VersionedReleaseBranch.png differ diff --git a/docs/input/docs/learn/branching-strategies/contribute-examples.md b/docs/input/docs/learn/branching-strategies/contribute-examples.md index c162dfe85e..3651bc91c6 100644 --- a/docs/input/docs/learn/branching-strategies/contribute-examples.md +++ b/docs/input/docs/learn/branching-strategies/contribute-examples.md @@ -9,8 +9,8 @@ The examples are generated by GitVersion tests, there are a number of services which will then turn the sequence diagram text into an image to use in the docs. Here are some links which could be useful -* [PlantUML Sequence Diagrams](https://www.plantuml.com/sequence.html) -* [PlantText Online editor](https://www.planttext.com) +* [PlantUML Sequence Diagrams](https://www.plantuml.com/sequence.html) +* [PlantText Online editor](https://www.planttext.com) The tests are quite simple. Using the methods on the `fixture` itself will record that action in the sequence diagram. If you do not want the action diff --git a/docs/input/docs/learn/branching-strategies/gitflow/examples.md b/docs/input/docs/learn/branching-strategies/gitflow/examples.md index a2915f17bd..fd3876c5b0 100644 --- a/docs/input/docs/learn/branching-strategies/gitflow/examples.md +++ b/docs/input/docs/learn/branching-strategies/gitflow/examples.md @@ -6,61 +6,107 @@ RedirectFrom: - docs/git-branching-strategies/gitflow-examples --- -These examples are using the _default_ configuration with GitVersion. Which is -[continuous deployment](/docs/reference/modes/continuous-deployment) mode for -`develop` and [continuous delivery](/docs/reference/modes/continuous-delivery) mode -for all other branches. - -This default configuration allows you to publish CI builds from develop to a CI -MyGet feed, or another CI feed. Then all other branches are manually released -then tagged. Read more about this at [version increments](/docs/reference/version-increments). +These examples are illustrating the usage of the supported `GitFlow` workflow +in GitVersion. To enable this workflow, the builtin template +[GitFlow/v1](/docs/workflows/GitFlow/v1.json) needs to be referenced in the +configuration as follows: + +```yaml +workflow: GitFlow/v1 +mode: ContinuousDelivery +``` + +Where +the [continuous deployment][continuous-deployment] mode for no branches, +the [continuous delivery][continuous-delivery] mode for +`main`, `support` and `develop` branches and +the [manual deployment][manual-deployment] mode +for `release`, `feature`, `hotfix` and `unknown` branches are specified. + +This configuration allows you to publish CI (Continuous Integration) builds +from `main`, `support` and `develop` branches to an artifact repository. +All other branches are manually published. Read more about this at +[version increments](/docs/reference/version-increments). + +:::{.alert .alert-info} +The _continuous delivery_ mode has been used for the `main` and the +`support` branch in this examples (specified as a fallback on the root +configuration layer) to illustrate how the version increments are applied. +In production context the _continuous deployment_ mode might be a better +option when e.g. the release process is automated or the commits are tagged +by the pipeline automatically. +::: ## Feature Branches -Feature branches will take the feature branch name and use that as the -pre-release tag. +Feature branches can be used in the `GitFlow` workflow to implement a +feature in an isolated environment. Feature branches will take the feature +branch name and use that as the pre-release label. Feature branches will be +created from a `develop`, `release`, `main`, `support` or `hotfix` branch. -![GitFlow](/docs/img/05119d0cd4ecaaefff94\_feature-branch.png) +### Create feature branch from main -Notice after the feature branch is merged, the version on `develop` is -`1.3.0-alpha.3`. This is due to `develop` running in _continuous deployment_ -mode. If you configured `develop` to use _continuous delivery_ the version would -still be `1.3.0-alpha.1` and you would have to use release tags to increment the -`alpha.1`. +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png) -You can see the difference on the feature branch itself, notice the version is -the same before and after the commit on the feature branch? Only the metadata -has changed. If you released the feature branch artifacts then tagged the -commit, the following commit would increase to `-beta.2`. +:::{.alert .alert-info} +After the feature branch is merged, the version on `main` is `2.0.0-5`. +This is due to `main` running in _continuous delivery_ mode. If `main` was +configured to use _continuous deployment_ the version would be `2.0.0`. +::: -## Pull Request +### Create feature branch from develop -Because feature branches are most likely pushed to a fork, we are showing the -pull request branch name which is created when you submit a pull request +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png) -![GitFlow](/docs/img/09fdf46995b771f3164a_pull-request.png) +:::{.alert .alert-info} +After the feature branch is merged, the version on `develop` is +`1.3.0-alpha.3`. This is due to `develop` running in _continuous delivery_ +mode. If `develop` was configured to use _manual deployment_ the version +would still be `1.3.0-alpha.1` and you would have to use pre-release tags +to increment the pre-release label `alpha.1`. +::: ## Hotfix Branches -Hotfix branches are used when you need to do a _patch_ release in GitFlow and -are always created off `main` +Hotfix branches are used when you need to do a _patch_ release in the +`GitFlow` workflow and are always created from `main` branch. + +### Create hotfix branch + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png) + +### Create hotfix branch with version number + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png) + +## Release Branches -![GitFlow](/docs/img/f26ae57adbd9b74f74c4\_hotfix.png) +Release branches are used for major and minor releases to stabilize a RC +(Release Candidate) or to integrate features (in parallel) targeting different +iterations. Release branches are taken from `main` (or from `develop`) and will +be merged back afterwards. Finally the `main` branch is tagged with the +released version. -## Minor Release Branches +Release branches can be used in the `GitFlow` as well as `GitHubFlow` workflow. +Sometimes you want to start on a large feature which may take a while +to stabilize so you want to keep it off main. +In these scenarios you can either create a long lived +feature branch (if you do not know the version number this large feature will go +into, and it's non-breaking) otherwise you can create a release branch for the +next major version. You can then submit pull requests to the long lived feature +branch or the release branch. -Release branches are used for both major and minor releases for stabilisation -before a release. Release branches are taken off `develop` then merged to both -`develop` and `main`. Finally `main` is tagged with the released version. +### Create release branch -![GitFlow](/docs/img/6d33d35a70a777608fa1\_minor-release.png) +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png) -## Major Release Branches +### Create release branch with version -Major releases are just like minor releases, the difference is you bump the -major in the release branch name. +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png) -![GitFlow](/docs/img/39f9d8b8b007c82f1f80\_major-release.png) +## Develop Branch + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png) ## Support Branches @@ -71,17 +117,15 @@ majors, then name your branch `support/.x` (i.e `support/1.x`), to support minors use `support/..x` or `support/..0`. (i.e `support/1.3.x` or `support/1.3.0`) -### Hotfix - -Depending on what you name your support branch, you may or may not need a hotfix -branch. Naming it `support/1.x` will automatically bump the patch, if you name -it `support/1.3.0` then the version in branch name rule will kick in and the -patch _will not_ automatically bump, meaning you have to use hotfix branches. -![GitFlow](/docs/img/b035b8ca99bd34239518\_support-hotfix.png) - -### Minor Release +![GitFlow](/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png) -![GitFlow](/docs/img/2167fb1c4a5cf84edfd8\_support-minor.png) +:::{.alert .alert-info} +Depending on what you name your support branch, you may or may not need a +hotfix branch. Naming it `support/1.x` will automatically bump the patch, +if you name it `support/1.3.0` then the version in branch name rule will +kick in and the patch _will not_ automatically bump, meaning you have to +use hotfix branches. +::: ## To Contribute @@ -89,5 +133,10 @@ See [contributing examples](/docs/learn/branching-strategies/contribute-examples ### Source -See `DocumentationSamples.GitFlowExample`. To update, modify then run test. -Update +See `DocumentationSamplesForGitFlow.cs`. To update, modify then run test. + +[continuous-deployment]: /docs/reference/modes/continuous-deployment + +[continuous-delivery]: /docs/reference/modes/continuous-delivery + +[manual-deployment]: /docs/reference/modes/manual-deployment diff --git a/docs/input/docs/learn/branching-strategies/gitflow/index.md b/docs/input/docs/learn/branching-strategies/gitflow/index.md index 8e0e71dcf5..2c3019d88b 100644 --- a/docs/input/docs/learn/branching-strategies/gitflow/index.md +++ b/docs/input/docs/learn/branching-strategies/gitflow/index.md @@ -10,20 +10,20 @@ SemVer compatible versions from this structure. ## Assumptions: -* Using [GitFlow branching model](https://nvie.com/git-model/) which always has a - main and a develop branch -* Following [Semantic Versioning](https://semver.org/) -* Planned releases (bumps in major or minor) are done on release branches - prefixed with release-. Eg: release-4.1 (or release-4.1.0) -* Hotfixes are prefixed with hotfix- Eg. hotfix-4.0.4 -* The original [GitFlow model](https://nvie.com/posts/a-successful-git-branching-model/) - specifies branches with a "-" separator while the [git flow extensions](https://github.com/nvie/gitflow) - default to a "/" separator. Either work with GitVersion. -* Tags are used on the main branch and reflects the SemVer of each stable - release eg 3.3.8 , 4.0.0, etc -* Tags can also be used to override versions while we transition repositories - over to GitVersion -* Using a build server with multi-branch building enabled eg TeamCity 8 +* Using [GitFlow branching model](https://nvie.com/git-model/) which always has a + main and a develop branch +* Following [Semantic Versioning](https://semver.org/) +* Planned releases (bumps in major or minor) are done on release branches + prefixed with release-. Eg: release-4.1 (or release-4.1.0) +* Hotfixes are prefixed with hotfix- Eg. hotfix-4.0.4 +* The original [GitFlow model](https://nvie.com/posts/a-successful-git-branching-model/) + specifies branches with a "-" separator while the [git flow extensions](https://github.com/CJ-Systems/gitflow-cjs) + default to a "/" separator. Either work with GitVersion. +* Tags are used on the main branch and reflects the SemVer of each stable + release eg 3.3.8 , 4.0.0, etc +* Tags can also be used to override versions while we transition repositories + over to GitVersion +* Using a build server with multi-branch building enabled eg TeamCity 8 ## How Branches are handled @@ -31,8 +31,8 @@ The descriptions of how commits and branches are versioned can be considered a type of pseudopod. With that in mind there are a few common "variables" that we will refer to: -* `targetBranch` => the branch we are targeting -* `targetCommit` => the commit we are targeting on `targetbranch` +* `targetBranch` => the branch we are targeting +* `targetCommit` => the commit we are targeting on `targetbranch` ### Main branch @@ -44,15 +44,15 @@ If we try to build from a commit that is no merge and no tag then assume `0.1.0` `mergeVersion` => the SemVer extracted from `targetCommit.Message` -* major: `mergeVersion.Major` -* minor: `mergeVersion.Minor` -* patch: `mergeVersion.Patch` -* pre-release: 0 (perhaps count ahead commits later) -* stability: final +* major: `mergeVersion.Major` +* minor: `mergeVersion.Minor` +* patch: `mergeVersion.Patch` +* pre-release: 0 (perhaps count ahead commits later) +* stability: final Optional Tags (only when transitioning existing repository): -* TagOnHeadCommit.Name={semver} => overrides the version to be {semver} +* TagOnHeadCommit.Name={semver} => overrides the version to be {semver} Long version: @@ -68,11 +68,11 @@ Long version: `main` that is older than the `targetCommitDate` `mainMergeVersion` => the SemVer extracted from `mainVersionCommit.Message` -* major: `mainMergeVersion.Major` -* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) -* patch: 0 -* pre-release: `alpha.{n}` where n = how many commits `develop` is in front of - `mainVersionCommit.Date` ('0' padded to 4 characters) +* major: `mainMergeVersion.Major` +* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) +* patch: 0 +* pre-release: `alpha.{n}` where n = how many commits `develop` is in front of + `mainVersionCommit.Date` ('0' padded to 4 characters) Long version: @@ -87,11 +87,11 @@ Named: `hotfix-{versionNumber}` eg `hotfix-1.2` `branchVersion` => the SemVer extracted from `targetBranch.Name` -* major: `mergeVersion.Major` -* minor: `mergeVersion.Minor` -* patch: `mergeVersion.Patch` -* pre-release: `beta{n}` where n = number of commits on branch ('0' padded to - 4 characters) +* major: `mergeVersion.Major` +* minor: `mergeVersion.Minor` +* patch: `mergeVersion.Patch` +* pre-release: `beta{n}` where n = number of commits on branch ('0' padded to + 4 characters) Long version: @@ -102,9 +102,9 @@ Long version: ### Release branches -* May branch off from: develop -* Must merge back into: develop and main -* Branch naming convention: `release-{n}` eg `release-1.2` +* May branch off from: develop +* Must merge back into: develop and main +* Branch naming convention: `release-{n}` eg `release-1.2` `releaseVersion` => the SemVer extracted from `targetBranch.Name` `releaseTag` => the first version tag placed on the branch. Note that at least @@ -112,11 +112,11 @@ one version tag is required on the branch. The recommended initial tag is `{releaseVersion}.0-alpha1`. So for a branch named `release-1.2` the recommended tag would be `1.2.0-alpha1` -* major: `mergeVersion.Major` -* minor: `mergeVersion.Minor` -* patch: 0 -* pre-release: `{releaseTag.preRelease}.{n}` where n = 1 + the number of commits - since `releaseTag`. +* major: `mergeVersion.Major` +* minor: `mergeVersion.Minor` +* patch: 0 +* pre-release: `{releaseTag.preRelease}.{n}` where n = 1 + the number of commits + since `releaseTag`. So on a branch named `release-1.2` with a tag `1.2.0-alpha1` and 4 commits after that tag the version would be `1.2.0-alpha1.4` @@ -139,11 +139,11 @@ Branch naming convention: anything except `main`, `develop`, `release-{n}`, or TODO: feature branches cannot start with a SemVer. to stop people from create branches named like "4.0.3" -* major: `mainMergeVersion.Major` -* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) -* patch: 0 -* pre-release: `alpha.feature-{n}` where n = First 8 characters of the commit - SHA of the first commit +* major: `mainMergeVersion.Major` +* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) +* patch: 0 +* pre-release: `alpha.feature-{n}` where n = First 8 characters of the commit + SHA of the first commit Long version: @@ -159,11 +159,11 @@ Must merge back into: `develop` Branch naming convention: anything except `main`, `develop`, `release-{n}`, or `hotfix-{n}`. Canonical branch name contains `/pull/`. -* major: `mainMergeVersion.Major` -* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) -* patch: 0 -* pre-release: `alpha.pull{n}` where n = the pull request number ('0' padded to - 4 characters) +* major: `mainMergeVersion.Major` +* minor: `mainMergeVersion.Minor + 1` (0 if the override above is used) +* patch: 0 +* pre-release: `alpha.pull{n}` where n = the pull request number ('0' padded to + 4 characters) ## Nightly Builds diff --git a/docs/input/docs/learn/branching-strategies/githubflow/examples.md b/docs/input/docs/learn/branching-strategies/githubflow/examples.md index 4a71e6dc4f..92f07d1e89 100644 --- a/docs/input/docs/learn/branching-strategies/githubflow/examples.md +++ b/docs/input/docs/learn/branching-strategies/githubflow/examples.md @@ -4,17 +4,66 @@ Title: GitHubFlow Examples RedirectFrom: docs/git-branching-strategies/githubflow-examples --- -## Feature branch +These examples are illustrating the usage of the supported `GitHubFlow` workflow +in GitVersion. To enable this workflow, the builtin template +[GitHubFlow/v1](/docs/workflows/GitHubFlow/v1.json) needs to be referenced in the +configuration as follows: -![GitHubFlow](/docs/img/githubflow_feature-branch.png) +```yaml +workflow: GitHubFlow/v1 +mode: ContinuousDelivery +``` -## Pull requests +Where +the [continuous deployment][continuous-deployment] mode for no branches, +the [continuous delivery][continuous-delivery] mode for +`main` branch and +the [manual deployment][manual-deployment] mode +for `release`, `feature` and `unknown` branches are specified. -![GitHubFlow](/docs/img/githubflow_pull-request.png) +This configuration allows you to publish CI (Continuous Integration) builds +from `main` branch to an artifact repository. +All other branches are manually published. Read more about this at +[version increments](/docs/reference/version-increments). -## Release branch +:::{.alert .alert-info} +The _continuous delivery_ mode has been used for the `main` branch in this +examples (specified as a fallback on the root +configuration layer) to illustrate how the version increments are applied. +In production context the _continuous deployment_ mode might be a better +option when e.g. the release process is automated or the commits are tagged +by the pipeline automatically. +::: -Release branches can be used in GitHubFlow as well as GitFlow. Sometimes you +## Feature Branch + +Feature branches can be used in the `GitHubFlow` workflow to implement a +feature or fix a bug in an isolated environment. Feature branches will take +the feature +branch name and use that as the pre-release label. Feature branches will be +created from a `main` or `release` branch. + +### Create feature branch from main + +![GitHubFlow](/docs/img/DocumentationSamplesForGitHubFlow_FeatureBranch.png) + +:::{.alert .alert-info} +After the feature branch is merged, the version on `main` is `2.0.0-5`. +This is due to `main` running in _continuous delivery_ mode. If `main` was +configured to use _continuous deployment_ the version would be `2.0.0`. +::: + +## Release Branches + +Release branches are used for major, minor and patch releases to stabilize a RC +(Release Candidate) or to integrate features/hotfixes (in parallel) targeting +different +iterations. Release branches are taken from `main` and will +be merged back afterwards. Finally the `main` branch is tagged with the +released version. + +Release branches can be used in the `GitHubFlow` as well as `GitFlow` workflow. +Sometimes you want to start on a large feature which may take a while to stabilize so you want to keep it off main. In these scenarios you can either create a long lived feature branch (if you do not know the version number this large feature will go @@ -22,4 +71,24 @@ into, and it's non-breaking) otherwise you can create a release branch for the next major version. You can then submit pull requests to the long lived feature branch or the release branch. -![GitFlow](/docs/img/githubflow_release-branch.png) +### Create release branch + +![GitFlow](/docs/img/DocumentationSamplesForGitHubFlow_ReleaseBranch.png) + +### Create release branch with version + +![GitFlow](/docs/img/DocumentationSamplesForGitHubFlow_VersionedReleaseBranch.png) + +## To Contribute + +See [contributing examples](/docs/learn/branching-strategies/contribute-examples). + +### Source + +See `DocumentationSamplesForGitHubFlow.cs`. To update, modify then run test. + +[continuous-deployment]: /docs/reference/modes/continuous-deployment + +[continuous-delivery]: /docs/reference/modes/continuous-delivery + +[manual-deployment]: /docs/reference/modes/manual-deployment diff --git a/docs/input/docs/learn/branching-strategies/githubflow/index.md b/docs/input/docs/learn/branching-strategies/githubflow/index.md index b7e8d0593d..a0c76e72d0 100644 --- a/docs/input/docs/learn/branching-strategies/githubflow/index.md +++ b/docs/input/docs/learn/branching-strategies/githubflow/index.md @@ -11,19 +11,19 @@ are much better off with a simpler workflow. GitHubFlow is in a nutshell: -1. Update main to latest [upstream](/docs/learn/git-setup#upstream) code -2. Create a feature branch `git checkout -b myFeatureBranch` -3. Do the feature/work -4. Push feature branch to [origin](/docs/learn/git-setup#origin) -5. Create pull request from origin/ -> upstream/main -6. Review, fix raised comments, merge your PR or even better, get someone else to. +1. Update main to latest [upstream](/docs/learn/git-setup#upstream) code +2. Create a feature branch `git checkout -b myFeatureBranch` +3. Do the feature/work +4. Push feature branch to [origin](/docs/learn/git-setup#origin) +5. Create pull request from origin/{featureBranch} -> upstream/main +6. Review, fix raised comments, merge your PR or even better, get someone else to. The main rule of GitHub Flow is that main should _always_ be deployable. GitHub Flow allows and encourages [continuous delivery](/docs/reference/modes/continuous-delivery). ## Resources -* [GitHubFlow guide by GitHub](https://docs.github.com/en/get-started/quickstart/github-flow#introduction) -* [GitHubFlow original blog post](https://scottchacon.com/2011/08/31/github-flow.html) -* [Phil Haack's (haacked) GitHubFlow aliases](https://haacked.com/archive/2014/07/28/github-flow-aliases/) -* [GitHubFlow vs GitFlow](https://lucamezzalira.com/2014/03/10/git-flow-vs-github-flow/) +* [GitHubFlow guide by GitHub](https://docs.github.com/en/get-started/quickstart/github-flow#introduction) +* [GitHubFlow original blog post](https://scottchacon.com/2011/08/31/github-flow) +* [Phil Haack's (haacked) GitHubFlow aliases](https://haacked.com/archive/2014/07/28/github-flow-aliases/) +* [GitHubFlow vs GitFlow](https://lucamezzalira.com/2014/03/10/git-flow-vs-github-flow/) diff --git a/docs/input/docs/learn/branching-strategies/overview.md b/docs/input/docs/learn/branching-strategies/overview.md index aae1372e90..4af9d6638f 100644 --- a/docs/input/docs/learn/branching-strategies/overview.md +++ b/docs/input/docs/learn/branching-strategies/overview.md @@ -26,42 +26,48 @@ As mentioned above the GitVersion docs cover [GitHubFlow][githubflow] and GitHubFlow is a simple and powerful branching strategy. It is what GitHub uses and the branching strategy most open source projects use. -* [Mainline development][mainline] on `main`. -* Work on [feature branches][feature-branches], merge into `main` via a [pull - request][pull-request]. -* Works well for [continuous delivery][continuous-delivery]. -* Does not have a way to manage/maintain old releases. -* Only allows working on a single release at a time. +* [Mainline development][mainline] on `main`. +* Work on [feature branches][feature-branches], merge into `main` via a [pull + request][pull-request]. +* Works well for [continuous delivery][continuous-delivery]. +* Does not have a way to manage/maintain old releases. +* Only allows working on a single release at a time. ### Git Flow GitFlow is a more complex and complete branching strategy. It also gives much more control over when features and code is released. -* Development on `develop` branch. -* `main` only contains _released_ code. -* Supports maintaining old releases (like nServiceBus, they support the last 3 - major versions with bug fixes and security updates). -* Supports development on multiple releases at one time. +* Development on `develop` branch. +* `main` only contains _released_ code. +* Supports maintaining old releases (like nServiceBus, they support the last 3 + major versions with bug fixes and security updates). +* Supports development on multiple releases at one time. ## Choosing a branching strategy There are a few reasons you would pick GitFlow over GitHubFlow, they are: -1. You need to support multiple major versions at the same time. -2. You need to work on multiple releases at the same time. +1. You need to support multiple major versions at the same time. +2. You need to work on multiple releases at the same time. -* For example a new feature which will go in the next major version, while bug - fixes/smaller features are still going into the current release +* For example a new feature which will go in the next major version, while bug + fixes/smaller features are still going into the current release But if you do not have a good reason to go with GitFlow, then start with GitHubFlow. It is a far simpler model and if you end up needing GitFlow later, it is [easy to convert][converting-to-gitflow]. [continuous-delivery]: /docs/reference/modes/continuous-delivery + [converting-to-gitflow]: /docs/learn/branching-strategies/gitflow/converting-to-gitflow + [feature-branches]: /docs/learn/branching-strategies/gitflow/examples#feature-branches + [gitflow]: /docs/learn/branching-strategies/gitflow + [githubflow]: /docs/learn/branching-strategies/githubflow + [mainline]: /docs/reference/modes/mainline + [pull-request]: /docs/learn/branching-strategies/gitflow/examples#pull-request diff --git a/docs/input/docs/learn/credits.md b/docs/input/docs/learn/credits.md index d00e906c52..69e6326eb1 100644 --- a/docs/input/docs/learn/credits.md +++ b/docs/input/docs/learn/credits.md @@ -16,18 +16,33 @@ Icons sourced, with love, from [The Noun Project][the-noun-project]: ::: [artz91]: https://thenounproject.com/ArtZ91/ + [collect-icon]: /assets/img/collect.svg + [collect-link]: https://thenounproject.com/term/collect/424422/ + [david-chapman]: https://thenounproject.com/david.chapman/ + [ghayn]: https://thenounproject.com/Ghayn/ + [kevineichhorn]: https://thenounproject.com/kevineichhorn/ + [library-icon]: /assets/img/library.svg + [library-link]: https://thenounproject.com/term/library/1386683/ + [monstercritic]: https://thenounproject.com/monstercritic/ + [repeat-icon]: /assets/img/repeat.svg + [repeat-link]: https://thenounproject.com/term/repeat/304152/ + [terminal-icon]: /assets/img/terminal.svg + [terminal-link]: https://thenounproject.com/term/terminal/2191738/ + [the-noun-project]: https://thenounproject.com/ + [tree-icon]: /assets/img/icon.svg + [tree-link]: https://thenounproject.com/term/tree/13389/ diff --git a/docs/input/docs/learn/dynamic-repositories.md b/docs/input/docs/learn/dynamic-repositories.md index 0ba9bf49cb..848ac16391 100644 --- a/docs/input/docs/learn/dynamic-repositories.md +++ b/docs/input/docs/learn/dynamic-repositories.md @@ -31,11 +31,11 @@ will assume there is already a ".git" folder present, and it will use it. To tell GitVersion.exe to obtain the repository on the fly, you need to call `GitVersion.exe` with the following arguments: -* `/url [the url of your git repo]` -* `/u [authentication username]` -* `/p [authentication password]` -* `/b [branch name]` -* `/c [commit id]` +* `/url [the url of your git repo]` +* `/u [authentication username]` +* `/p [authentication password]` +* `/b [branch name]` +* `/c [commit id]` Please note that these arguments are described when calling `GitVersion.exe /?`. diff --git a/docs/input/docs/learn/faq.md b/docs/input/docs/learn/faq.md index 631948c857..4f972dad4a 100644 --- a/docs/input/docs/learn/faq.md +++ b/docs/input/docs/learn/faq.md @@ -49,13 +49,6 @@ SemVer. If you want to fix the version, use `NuGetVersionV2` which will stay the same after NuGet 3.0 comes out -## How do I choose my branching strategy (GitFlow vs GitHubFlow) - -If you run `gitversion init` then choose `Getting started wizard` then choose -`Unsure, tell me more`, GitVersion will run through a series of questions which -will try and help point you towards a branching strategy and why you would use -it. - ## Merged branch names as version source When GitVersion considers previous commits to calculate a version number, it's @@ -76,8 +69,13 @@ therefore not be considered for version calculation in the target branch of the merge. [dynamic-repos]: /docs/learn/dynamic-repositories + [increments]: /docs/reference/version-increments + [octopus]: /docs/reference/build-servers/octopus-deploy + [semver-intro]: /docs/learn/intro-to-semver + [semver]: https://semver.org + [variables]: /docs/reference/variables diff --git a/docs/input/docs/learn/how-it-works.md b/docs/input/docs/learn/how-it-works.md index a33f2695b3..a556661b26 100644 --- a/docs/input/docs/learn/how-it-works.md +++ b/docs/input/docs/learn/how-it-works.md @@ -5,7 +5,7 @@ RedirectFrom: docs/more-info/how-it-works --- GitVersion v3 works very differently to v2. Version 2 had knowledge of both -GitFlow and GitHubFlow hard coded into it, with each branch having it's own +GitFlow and GitHubFlow hard coded into it, with each branch having its own class which calculated the version for that branch type. v3 is driven by [configuration](/docs/reference/configuration), meaning most of the @@ -16,52 +16,57 @@ it _much_ more predictable and easier to diagnose when odd things are happening. GitVersion has three distinct steps for calculating versions in v3. -1. If the current commit is tagged, the tag is used and build metadata - (excluding commit count) is added. The other two steps will not execute. -2. A set of strategies are evaluated to decide on the base version and some - metadata about that version. These strategies include HighestReachableTag, - NextVersionInConfig, MergedBranchWithVersion, VersionInBranchName etc. -3. The highest base version is selected, using that base version as the new - version is calculated. +1. If the current commit is tagged, the tag is used and build metadata + (excluding commit count) is added. The other two steps will not execute. +2. A set of strategies are evaluated to decide on the base version and some + metadata about that version. See [Version Strategies](#version-strategies) +3. The highest base version is selected, using that base version as the new + version is calculated. Visually it looks something like this: -![Version Calculation](https://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) +![Version Calculation](https://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea_0G00) -[Edit Diagram](https://www.plantuml.com/plantuml/form?url=https://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) +[Edit Diagram](https://www.plantuml.com/plantuml/uml/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea_0G00) **\*** Some strategies allow the version to be incremented, others don't. More info below. **+** This version is out of context with the rest of the example. It is here simply to show what happens if the check is true. -### Base Version Strategies +### Version Strategies Currently we have the following strategies: -* `HighestTagBaseVersionStrategy` - Finds the highest reachable tag from the - current branch -* `VersionInBranchBaseVersionStrategy` - Extracts version information from the - branch name (e.g., `release/3.0.0` will find `3.0.0`) -* `ConfigNextVersionBaseVersionStrategy` - Returns the version from the - GitVersion.yaml file -* `MergeMessageBaseVersionStrategy` - Finds version numbers from merge messages - (e.g., `Merge 'release/3.0.0' into 'main'` will return `3.0.0`) -* `FallbackBaseVersionStrategy` - Always returns 0.1.0 for new repositories +* `Fallback` - Always returns 0.0.0 and will be used for + calculating the next version which is dependent on the increment strategy of + the effected branch (e.g. on main the next version is 0.0.1 or on develop it is 0.1.0). + The fallback strategy only applies if no other selected strategy returns a base version. +* `ConfiguredNextVersion` - Returns the version from the GitVersion.yaml file +* `MergeMessage` - Finds version numbers from merge messages + (e.g., `Merge 'release/3.0.0' into 'main'` will return `3.0.0`) +* `TaggedCommit` - Extracts version information from all tags on the branch which are valid, + and not newer than the current commit. +* `TrackReleaseBranches` - Considers the base version extracted from release branches when + calculating the next version for branches configured with `track-release-branches: true` + (part of default configuration for `develop` branch in `GitFlow` workflow) +* `VersionInBranchName` - Extracts version information from the + branch name (e.g., `release/3.0.0` will find `3.0.0`) +* `Mainline` - Increments the version on every commit for branches configured with `is-main-branch: true` Each strategy needs to return an instance of `BaseVersion` which has the following properties: -* `Source` - Description of the source (e.g., `Merge message 'Merge 'release/3.0.0' into 'main'`) -* `ShouldIncrement` - Some strategies should have the version incremented, - others do not (e.g., `ConfigNextVersionBaseVersionStrategy` returns false, - `HighestTagBaseVersionStrategy` returns true) -* `SemanticVersion` - SemVer of the base version strategy -* `BaseVersionSource` - SHA hash of the source. Commits will be counted from - this hash. Can be null (e.g., `ConfigNextVersionBaseVersionStrategy` returns - null). -* `BranchNameOverride` - When `useBranchName` or `{BranchName}` is used in the - tag configuration, this allows the branch name to be changed by a base version. - `VersionInBranchBaseVersionStrategy` uses this to strip out anything before the - first `-` or `/.` so `foo` ends up being evaluated as `foo`. If in doubt, just - use null. +* `Source` - Description of the source (e.g., `Merge message 'Merge 'release/3.0.0' into 'main'`) +* `ShouldIncrement` - Some strategies should have the version incremented, + others do not (e.g., `ConfiguredNextVersion` returns false, + `TaggedCommit` returns true) +* `SemanticVersion` - SemVer of the base version strategy +* `BaseVersionSource` - SHA hash of the source. Commits will be counted from + this hash. Can be null (e.g., `ConfiguredNextVersion` returns + null). +* `BranchNameOverride` - When `useBranchName` or `{BranchName}` is used in the + tag configuration, this allows the branch name to be changed by a base version. + `VersionInBranchName` uses this to strip out anything before the + first `-` or `/.` so `foo` ends up being evaluated as `foo`. If in doubt, just + use null. diff --git a/docs/input/docs/learn/intro-to-semver.md b/docs/input/docs/learn/intro-to-semver.md index 179010169c..43a73646bf 100644 --- a/docs/input/docs/learn/intro-to-semver.md +++ b/docs/input/docs/learn/intro-to-semver.md @@ -16,12 +16,12 @@ Version Promiscuity is the opposite problem, **JsonLibrary** releases _v1.1.0_ w SemVer introduces conventions about breaking changes into our version numbers so we can safely upgrade dependencies without fear of unexpected, breaking changes while still allowing us to upgrade downstream libraries to get new features and bug fixes. The convention is quite simple: -* `{major}.{minor}.{patch}-{tag}+{buildmetadata}` -* `{major}` is only incremented if the release has breaking changes (includes bug fixes which have breaking behavioural changes -* `{minor}` is incremented if the release has new non-breaking features -* `{patch}` is incremented if the release only contains non-breaking bug fixes -* `{tag}` is optional and denotes a pre-release of the version preceding -* `{buildmetadata}` is optional and contains additional information about the version, but **does not affect** the semantic version preceding it. +* `{major}.{minor}.{patch}-{tag}+{buildmetadata}` +* `{major}` is only incremented if the release has breaking changes (includes bug fixes which have breaking behavioural changes +* `{minor}` is incremented if the release has new non-breaking features +* `{patch}` is incremented if the release only contains non-breaking bug fixes +* `{tag}` is optional and denotes a pre-release of the version preceding +* `{buildmetadata}` is optional and contains additional information about the version, but **does not affect** the semantic version preceding it. Only one number should be incremented per release, and all lower parts should be reset to 0 (if `{major}` is incremented, then `{minor}` and `{patch}` should become 0). diff --git a/docs/input/docs/learn/who.md b/docs/input/docs/learn/who.md index bbcaba18a8..ace607d739 100644 --- a/docs/input/docs/learn/who.md +++ b/docs/input/docs/learn/who.md @@ -8,19 +8,19 @@ Various people are actively using GitVersion, and taking advantage of the automatic generation of their version numbers. Here is a list of applications that we know about today. -* [Catel](https://github.com/catel/catel) -* [ChocolateyGUI](https://github.com/chocolatey/ChocolateyGUI) -* [GitLink](https://github.com/GitTools/GitLink) -* [OctopusDeploy](https://github.com/OctopusDeploy) -* [NUKE](https://nuke.build) -* [Orc.\* packages](https://github.com/wildgums?query=orc) -* [Orchestra](https://github.com/wildgums/orchestra) -* [Shouldly](https://github.com/shouldly/shouldly) -* [Akavache](https://github.com/akavache/akavache) -* [Splat](https://github.com/paulcbetts/splat) -* [ReactiveUI](https://github.com/reactiveui/reactiveui) -* [Uno Platform](https://platform.uno/) -* [Fluent Assertions](https://fluentassertions.com) +* [Catel](https://github.com/catel/catel) +* [ChocolateyGUI](https://github.com/chocolatey/ChocolateyGUI) +* [GitLink](https://github.com/GitTools/GitLink) +* [OctopusDeploy](https://github.com/OctopusDeploy) +* [NUKE](https://nuke.build) +* [Orc.\* packages](https://github.com/wildgums?query=orc) +* [Orchestra](https://github.com/wildgums/orchestra) +* [Shouldly](https://github.com/shouldly/shouldly) +* [Akavache](https://github.com/akavache/akavache) +* [Splat](https://github.com/paulcbetts/splat) +* [ReactiveUI](https://github.com/reactiveui/reactiveui) +* [Uno Platform](https://platform.uno/) +* [Fluent Assertions](https://fluentassertions.com) If you are using GitVersion in your projects, and you are not listed above, please feel free to add a link to your project. diff --git a/docs/input/docs/learn/why.md b/docs/input/docs/learn/why.md index 421db61eee..0b08792e30 100644 --- a/docs/input/docs/learn/why.md +++ b/docs/input/docs/learn/why.md @@ -11,28 +11,28 @@ transportable between projects. It solves: -* Rebuilding tags always produces the same version -* Not having to rebuild to increment versions -* Not duplicating version information in multiple places (branch release/2.0.0 - already has the version in it, why do I need to change something else) -* Each branch calculates its SemVer and versions flow between branches when - they are merged -* Pull requests produce unique pre-release version numbers -* NuGet semver issues -* Build server integration -* Updating assembly info -* And a whole lot of edge cases you don't want to think about +* Rebuilding tags always produces the same version +* Not having to rebuild to increment versions +* Not duplicating version information in multiple places (branch release/2.0.0 + already has the version in it, why do I need to change something else) +* Each branch calculates its SemVer and versions flow between branches when + they are merged +* Pull requests produce unique pre-release version numbers +* NuGet semver issues +* Build server integration +* Updating assembly info +* And a whole lot of edge cases you don't want to think about ## Advantages vs other approaches ### Version.txt/Version in build script -* With version.txt/build script, after the release you need to do an additional commit to bump the version -* After tagging a release, the next build will still be the same version +* With version.txt/build script, after the release you need to do an additional commit to bump the version +* After tagging a release, the next build will still be the same version ### Build Server versioning -* Cannot have different version numbers on different branches -* Rebuilding will result in a different build number (if using an auto incrementing number in the version) -* Need to login to the build server to change version number -* Only build administrators can change the version number +* Cannot have different version numbers on different branches +* Rebuilding will result in a different build number (if using an auto incrementing number in the version) +* Need to login to the build server to change version number +* Only build administrators can change the version number diff --git a/docs/input/docs/reference/build-servers/appveyor.md b/docs/input/docs/reference/build-servers/appveyor.md index d23f0da61d..5cf4199c94 100644 --- a/docs/input/docs/reference/build-servers/appveyor.md +++ b/docs/input/docs/reference/build-servers/appveyor.md @@ -8,8 +8,8 @@ RedirectFrom: docs/build-server-support/build-server/appveyor AppVeyor is the first build server which has a setup helper built into `GitVersion init`. -1. Run `GitVersion init` -2. Choose `Setup build scripts` (currently option 7, but that could change) -3. Choose `AppVeyor` -4. Follow the prompts to generate an AppVeyor.yml file which works nicely with - GitVersion +1. Run `GitVersion init` +2. Choose `Setup build scripts` (currently option 7, but that could change) +3. Choose `AppVeyor` +4. Follow the prompts to generate an AppVeyor.yml file which works nicely with + GitVersion diff --git a/docs/input/docs/reference/build-servers/azure-devops.md b/docs/input/docs/reference/build-servers/azure-devops.md index 15fba0b50b..500b15b7b2 100644 --- a/docs/input/docs/reference/build-servers/azure-devops.md +++ b/docs/input/docs/reference/build-servers/azure-devops.md @@ -2,172 +2,20 @@ Order: 20 Title: Azure DevOps Description: | - Details on the Azure DevOps or Team Foundation Server Build Pipeline support - in GitVersion + Details on the Azure DevOps Build Pipeline support in GitVersion RedirectFrom: docs/build-server-support/build-server/azure-devops --- -## Basic Usage +## Installation and usage -In Azure DevOps Pipeline (the web based build system) you can call GitVersion -either using the Command Line build step or install an extension / custom build -step. The custom build step requires a one-time setup to import the GitVersion -task into your TFS or Azure DevOps Pipeline instance. - -## Executing GitVersion - -### Using GitVersion with the MSBuild Task NuGet Package - -1. Add the [GitVersionTask](https://www.nuget.org/packages/GitVersionTask/) - NuGet package to your projects. - -See [MSBuild Task](/docs/usage/msbuild) for further instructions how to use -the MS Build Task. - -### Using GitVersion with the Command Line build step - -1. Make sure to have GitVersion.exe under version control. There exists also a - [Chocolatey package](https://chocolatey.org/packages/GitVersion.Portable) for - installing GitVersion.exe on build agents. -2. Add a Command Line build step to your build definition. You'll probably want - to drag the task to be at or near the top to ensure it executes before your - other build steps. -3. Set the Tool parameter to `\GitVersion.exe`. -4. Set the Arguments parameter to `/output buildserver /nofetch`. -5. If you want the GitVersionTask to update AssemblyInfo files add - `updateAssemblyInfo true` to the Arguments parameter. -6. If you want to update the build number you need to send a - [logging command](https://github.com/microsoft/azure-pipelines-tasks/blob/main/docs/authoring/commands.md) - to TFS. - -### Using the custom GitVersion build step - -#### Installing - -##### Installing the extension - -For Visual Studio Team Service or TFS 2015 Update 2 or higher it is recommended -to install the GitVersion extension: - -1. Install the - [GitVersion Extension](https://marketplace.visualstudio.com/items?itemName=gittools.usegitversion). - -##### Manually installing/updating the custom build step - -If you run TFS 2015 RTM or Update 1 or don't want to install the GitVersion -extension you can install the build task manually: - -1. Install the `tfx` command line tool as shown [here](https://github.com/microsoft/tfs-cli/blob/master/README.md#setup). -2. For TFS 2015 On-Prem configure Basic Authentication in TFS as shown [here](https://github.com/microsoft/tfs-cli/blob/master/docs/configureBasicAuth.md). -3. Download the GitVersion TFS build task from the latest release on the - [GitVersion releases page](https://github.com/GitTools/GitVersion/releases) and - unzip. -4. Run `tfx login` as shown [here](https://github.com/microsoft/tfs-cli/blob/master/README.md#login). -5. From the directory outside of where you unzipped the task, run - `tfx build tasks upload --task-path .\GitVersionVsixTask --overwrite` where - GitVersionVsixTask is the directory containing the files. -6. It should successfully install. - -#### Using the GitVersion custom build step - -From a TFS build definition, select "Add a Step" and then in the Build category, -choose GitVersion and click Add. You'll probably want to drag the task to be at -or near the top to ensure it executes before your other build steps. - -If you want the GitVersionTask to update AssemblyInfo files, check the box in -the task configuration. For advanced usage, you can pass additional options to -the GitVersion exe in the Additional arguments section. - -The Azure DevOps Pipeline build step can update your build number with -GitVersion variables. See below for details. - -#### Using Pipelines yaml - -Add the following yaml task and variable to your `azure-pipelines.yml` file: - -```yml -variables: - GitVersion.SemVer: '' - -steps: -- task: UseGitVersion@5 - displayName: gitversion - inputs: - versionSpec: '5.x' - updateAssemblyInfo: true -``` - -You can now use the `GitVersion.SemVer` environment variable in any subsequent -tasks to refer to the semantic version number for your build. For example, you -can build your dotnet core application with a semantic version number like so: - -```yml -- task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '$(solution)' - configuration: '$(buildConfiguration)' - versioningScheme: byEnvVar - versionEnvVar: 'GitVersion.SemVer' - -``` - -## Running inside TFS - -### Using the GitVersion Variables - -GitVersion passes variables in the form of `GitVersion.*` (Eg: -`GitVersion.Major`) to TFS Build and also writes `GITVERSION.*` -(Eg: `GITVERSION.MAJOR`) environment variables that are available for any -subsequent build step. - -To use these variables you can just refer to them using the standard variable -syntax. For instance `$(GitVersion.NuGetVersion)` in your nuget pack task to set -the version number. Since update 1 there are no known limitations. - -See [Variables](/docs/reference/variables) for an overview of available variables. - -#### Using GitVersion variables in build name - -To use GitVersion's variables in the build name, just add them in the form -`$(GITVERSION_FullSemVer)` into the Build definition's build number string. Then -just ensure GitVersion is called with `/output buildserver` and it will replace -those variables with the calculated version. The TFS GitVersion Build Step -(above) handles this too, so if you're already using that, there's nothing extra -to configure. - -If GitVersion does not find any substitutions it will just default to using `FullSemVer` +For Azure DevOps Services or Azure DevOps Server you can install the [GitTools Bundle](https://marketplace.visualstudio.com/items?itemName=gittools.gittools). :::{.alert .alert-danger} **Important** -If you currently use `$(rev:.r)` in your build number, that won't -work correctly if you -use GitVersion variables as well due to the delayed expansion of the GitVersion -vars. Instead, you might be able to use `$(GitVersion_BuildMetaData)` to achieve -a similar result. See [Variables](/docs/reference/variables) for more info on the -variables. +You must disable shallow fetch, either in the pipeline settings UI or by setting `fetchDepth: 0` in your `checkout` step; +without it, Azure DevOps Pipelines will perform a shallow clone, which will cause GitVersion to display an error message. +See [the Azure DevOps documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-checkout?view=azure-pipelines#shallow-fetch) for more information. ::: -#### Known limitations - -* If you are using on premises TFS, make sure you are using at least - **TFS 2015 Update 1**, otherwise a few things will not work. -* Installing the extension on an on premise TFS requires at least TFS 2015 - Update 2. -* You need to make sure that all tags are fetched for the Git repository, - otherwise you may end with wrong versions (e.g. `FullSemVer` like `1.2.0+5` - instead of `1.2.0` for tagged releases) Just checking the `Clean Repository` - check box in the build definition settings might not be enough since this will - run a `git clean -fdx/reset --hard` without fetching all tags later. You can - force deletion of the whole folder and a re-clone containing all tags by - settings the variable `Build.Clean` to `all`. This will take more time during - build but makes sure that all tags are fetched. In the future it is planned to - allow using `git.exe` instead of current `libgit2sharp` for syncing the repos - which might allow other possibilities to solve this issue. For details see this - [GitHub issue](https://github.com/microsoft/azure-pipelines-tasks/issues/1218). -* If running a build for a certain commit (through passing the commit SHA while - queueing the build) all tags from the repository will be fetched, even the ones - newer than the commit. This can lead to different version numbers while - re-running historical builds. +More information can be found at [gittools/actions](https://github.com/GitTools/actions/blob/main/docs/examples/azure/gitversion/index.md). diff --git a/docs/input/docs/reference/build-servers/bamboo.md b/docs/input/docs/reference/build-servers/bamboo.md index 71e0ad3ae1..6d0d79a263 100644 --- a/docs/input/docs/reference/build-servers/bamboo.md +++ b/docs/input/docs/reference/build-servers/bamboo.md @@ -36,6 +36,6 @@ sed -i '1d;$ d;s/ //;s/"//g;s/,//;s/:/=/' gitversion.txt **Required Properties** -* **Path to properties file**: gitversion.txt -* **Namespace**: GitVersion -* **Scope of the Variables**: Result +* **Path to properties file**: gitversion.txt +* **Namespace**: GitVersion +* **Scope of the Variables**: Result diff --git a/docs/input/docs/reference/build-servers/bitbucket-pipelines.md b/docs/input/docs/reference/build-servers/bitbucket-pipelines.md index 610031ecbe..f2e91f83db 100644 --- a/docs/input/docs/reference/build-servers/bitbucket-pipelines.md +++ b/docs/input/docs/reference/build-servers/bitbucket-pipelines.md @@ -1,5 +1,5 @@ --- -Order: 35 +Order: 40 Title: BitBucket Pipelines Description: Details on the Atlassian BitBucket Pipelines support in GitVersion --- @@ -16,7 +16,7 @@ in your build step. An example pipeline is shown below: ```yml -image: mcr.microsoft.com/dotnet/sdk:6.0 +image: mcr.microsoft.com/dotnet/sdk:8.0 clone: depth: full @@ -27,8 +27,8 @@ pipelines: name: Version and build script: - export PATH="$PATH:/root/.dotnet/tools" - - dotnet tool install --global GitVersion.Tool --version 5.* - - dotnet-gitversion /buildserver + - dotnet tool install --global GitVersion.Tool + - dotnet-gitversion /output buildserver - source gitversion.properties - echo Building with semver $GITVERSION_FULLSEMVER - dotnet build @@ -38,10 +38,10 @@ pipelines: **Important** You must set the `clone:depth` setting as shown above; without it, BitBucket Pipelines will perform a shallow clone, which will -cause GitVersion will display an error message. +cause GitVersion to display an error message. ::: -When the action `dotnet-gitversion /buildserver` is executed, it will detect that it is running in BitBucket Pipelines by the presence of +When the action `dotnet-gitversion /output buildserver` is executed, it will detect that it is running in BitBucket Pipelines by the presence of the `BITBUCKET_WORKSPACE` environment variable, which is set by the BitBucket Pipelines engine. It will generate a text file named `gitversion.properties` which contains all the output of the GitVersion tool, exported as individual environment variables prefixed with `GITVERSION_`. These environment variables can then be imported back into the build step using the `source gitversion.properties` action. @@ -50,7 +50,7 @@ If you want to share the text file across multiple build steps, then you will ne is shown below: ```yml -image: mcr.microsoft.com/dotnet/sdk:6.0 +image: mcr.microsoft.com/dotnet/sdk:8.0 clone: depth: full @@ -61,8 +61,8 @@ pipelines: name: Version script: - export PATH="$PATH:/root/.dotnet/tools" - - dotnet tool install --global GitVersion.Tool --version 5.* - - dotnet-gitversion /buildserver + - dotnet tool install --global GitVersion.Tool + - dotnet-gitversion /output buildserver artifacts: - gitversion.properties - step: diff --git a/docs/input/docs/reference/build-servers/buildkite.md b/docs/input/docs/reference/build-servers/buildkite.md index 5531690ef1..30c04c14cf 100644 --- a/docs/input/docs/reference/build-servers/buildkite.md +++ b/docs/input/docs/reference/build-servers/buildkite.md @@ -1,5 +1,5 @@ --- -Order: 40 +Order: 50 Title: Buildkite Description: Details on the Buildkite support in GitVersion RedirectFrom: docs/build-server-support/build-server/buildkite @@ -10,8 +10,9 @@ If you use [Buildkite][buildkite] then you will have to use GitVersion from the ## Gotchas By default Buildkite calls `git fetch` with the flags `-v --prune` which can cause issues on new build agents since branches or tags might not be available locally on the build agent when GitVersion runs. This can be fixed by altering the [Buildkite agent configuration][configuration] either by: -* Setting the environment variable `BUILDKITE_GIT_FETCH_FLAGS` to `-v --tags` -* Setting configuration value `git-fetch-flags` to `-v --tags` in your agent configuration file + +* Setting the environment variable `BUILDKITE_GIT_FETCH_FLAGS` to `-v --tags` +* Setting configuration value `git-fetch-flags` to `-v --tags` in your agent configuration file If you are running GitVersion in a docker container make sure to propagate the `BUILDKITE`, `BUILDKITE_BRANCH`, and `BUILDKITE_PULL_REQUEST` environment variables (c.f. example below). @@ -49,6 +50,9 @@ eval $(gitversion | jq -r 'to_entries[] | "buildkite-agent meta-data set GitVers Assuming your Buildkite agent has dotnet and gitversion installed and on the path, all the calculated GitVersion variables will have a corresponding meta-data key set. [buildkite]: https://buildkite.com/ + [configuration]: https://buildkite.com/docs/agent/v3/hooks + [hooks]: https://buildkite.com/docs/agent/v3/hooks + [meta-data]: https://buildkite.com/docs/agent/v3/cli-meta-data diff --git a/docs/input/docs/reference/build-servers/continua.md b/docs/input/docs/reference/build-servers/continua.md index 3605084d18..e2af69c06e 100644 --- a/docs/input/docs/reference/build-servers/continua.md +++ b/docs/input/docs/reference/build-servers/continua.md @@ -1,5 +1,5 @@ --- -Order: 50 +Order: 60 Title: Continua CI Description: Details on the Continua CI support in GitVersion RedirectFrom: docs/build-server-support/build-server/continua @@ -13,47 +13,47 @@ This guide assumes a few variables are present in the configuration. Note that this example uses `Catel` as repository name, but it should be replaced by the name of the repository where GitVersion is running against. -* RepositoryBranchName => $Source.Catel.BranchName$ -* RepositoryCommitId => $Source.Catel.LatestChangeset.Id$ -* RepositoryName => Catel -* RepositoryName => $Source.Catel.Path$ -* RepositoryUrl => $Source.Catel.Url$ +* RepositoryBranchName => $Source.Catel.BranchName$ +* RepositoryCommitId => $Source.Catel.LatestChangeset.Id$ +* RepositoryName => Catel +* RepositoryName => $Source.Catel.Path$ +* RepositoryUrl => $Source.Catel.Url$ It also requires a few variables which will automatically be filled by GitVersion. The example below are just a few, any of the GitVersion variables written to the output can be used. -* GitVersion_FullSemVer -* GitVersion_MajorMinorPatch -* GitVersion_NuGetVersion +* GitVersion\_FullSemVer +* GitVersion\_MajorMinorPatch +* GitVersion\_NuGetVersion You also need to add a property collector for the agents to detect the GitVersion tool on the agents: -* Namespace => GitVersion -* Run On => Agent -* Type => Path Finder Plugin -* Property Name => Path -* Executable => GitVersion.exe -* Search paths => your installation folder (e.g. `C:\Tools\GitVersion` or if you - are using Chocolatey `C:\ProgramData\chocolatey\lib\GitVersion.Portable\tools`) +* Namespace => GitVersion +* Run On => Agent +* Type => Path Finder Plugin +* Property Name => Path +* Executable => GitVersion.exe +* Search paths => your installation folder (e.g. `C:\Tools\GitVersion` or if you + are using Chocolatey `C:\ProgramData\chocolatey\lib\GitVersion.Portable\tools`) ## Basic Usage To run GitLink inside [Continua CI](https://www.finalbuilder.com/continua-ci), follow the steps below: -* Add a new `Execute Program` step to a stage -* In the `Execute Program` tab, set the following values: - * Executable path: $Agent.GitVersion.Path$ - * Working directory: %RepositoryPath% -* In the `Arguments` tab, set the following values: - * Arguments: /url %RepositoryUrl% /b %RepositoryBranchName% /c %RepositoryCommitId% /output buildserver -* In the `Options` tab, set the following values: - * Wait for completion: checked - * Log output: checked - * Check program exit code: checked - * Exit code must be: equal to - * Exit code: 0 +* Add a new `Execute Program` step to a stage +* In the `Execute Program` tab, set the following values: + * Executable path: $Agent.GitVersion.Path$ + * Working directory: %RepositoryPath% +* In the `Arguments` tab, set the following values: + * Arguments: /url %RepositoryUrl% /b %RepositoryBranchName% /c %RepositoryCommitId% /output buildserver +* In the `Options` tab, set the following values: + * Wait for completion: checked + * Log output: checked + * Check program exit code: checked + * Exit code must be: equal to + * Exit code: 0 Now GitVersion will automatically run and fill the `GitVersion_` variables. diff --git a/docs/input/docs/reference/build-servers/github-actions.md b/docs/input/docs/reference/build-servers/github-actions.md new file mode 100644 index 0000000000..77ae3a9023 --- /dev/null +++ b/docs/input/docs/reference/build-servers/github-actions.md @@ -0,0 +1,19 @@ +--- +Order: 70 +Title: GitHub Actions +Description: | + Details on the GitHub Actions Workflow support in GitVersion +--- + +## Installation and usage + +For GitHub Actions you can install the action from [GitTools Bundle](https://github.com/marketplace/actions/gittools). + +:::{.alert .alert-danger} +**Important** + +You must disable shallow fetch by setting `fetch-depth: 0` in your `checkout` step; +without it, GitHub Actions might perform a shallow clone, which will cause GitVersion to display an error message. +::: + +More information can be found at [gittools/actions](https://github.com/GitTools/actions/blob/main/docs/examples/github/gitversion/index.md). diff --git a/docs/input/docs/reference/build-servers/gitlab.md b/docs/input/docs/reference/build-servers/gitlab.md index b9495856e7..aa97d9e5fd 100755 --- a/docs/input/docs/reference/build-servers/gitlab.md +++ b/docs/input/docs/reference/build-servers/gitlab.md @@ -1,5 +1,5 @@ --- -Order: 60 +Order: 80 Title: GitLab CI Description: Details on the GitLab CI support in GitVersion RedirectFrom: docs/build-server-support/build-server/gitlab @@ -13,22 +13,29 @@ A working example of integrating GitVersion with GitLab is maintained in the pro Here is a summary of what it demonstrated (many more details in the [Readme][readme]) -- Is a reusable working example known as a Guided Exploration ([Guided Exploration Manifesto][guided-exploration-manifesto]) - so job logs and package artifacts can be reviewed. The project can also be imported to your own GitLab group or instance as a starting point for your own work. -- IMPORTANT: It demonstrates how to override GitLab CI's default cloning behavior so that GitVersion can do a dynamic copy. Selectively clones GitVersion.yml so that these settings take effect. This best practice demonstrates the best way to do this while avoiding a double-cloning of the project (once by GitLab Runner and once by GitVersion). -- Implements GitVersion as a CI/CD Extension that can be reused across many projects using includes. -- Implements GitVersion as a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables, which means... -- It can be used with ANY coding language, framework or packaging engine. -- Generates example packaged artifacts: - - Two ways of building Sem Versioned NuGet packages (msbuild-ish and nuget.exe-ish) and uploads them and tests them from a [GitLab NuGet Repository][gitlab-nuget-repository]. - - A Sem Versioned [GitLab Generic Package][gitlab-generic-package] - - A Sem Versioned docker container and uploads to [GitLab Container Registry][gitlab-container-registry]. -- It creates a Sem Versioned [GitLab Release][gitlab-release-help] and Git tag using the [GitLab Release Cli][gitlab-release-cli] and links the generic package as evidence. +* Is a reusable working example known as a Guided Exploration ([Guided Exploration Manifesto][guided-exploration-manifesto]) - so job logs and package artifacts can be reviewed. The project can also be imported to your own GitLab group or instance as a starting point for your own work. +* IMPORTANT: It demonstrates how to override GitLab CI's default cloning behavior so that GitVersion can do a dynamic copy. Selectively clones GitVersion.yml so that these settings take effect. This best practice demonstrates the best way to do this while avoiding a double-cloning of the project (once by GitLab Runner and once by GitVersion). +* Implements GitVersion as a CI/CD Extension that can be reused across many projects using includes. +* Implements GitVersion as a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables, which means... +* It can be used with ANY coding language, framework or packaging engine. +* Generates example packaged artifacts: + * Two ways of building Sem Versioned NuGet packages (msbuild-ish and nuget.exe-ish) and uploads them and tests them from a [GitLab NuGet Repository][gitlab-nuget-repository]. + * A Sem Versioned [GitLab Generic Package][gitlab-generic-package] + * A Sem Versioned docker container and uploads to [GitLab Container Registry][gitlab-container-registry]. +* It creates a Sem Versioned [GitLab Release][gitlab-release-help] and Git tag using the [GitLab Release Cli][gitlab-release-cli] and links the generic package as evidence. [gitlab-generic-package]: https://docs.gitlab.com/ee/user/packages/generic_packages/ + [gitlab-nuget-repository]: https://docs.gitlab.com/ee/user/packages/nuget_repository/ + [gitlab-release-cli]: https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs + [gitlab-container-registry]: https://docs.gitlab.com/ee/user/packages/container_registry/ + [guided-exploration-manifesto]: https://gitlab.com/guided-explorations/guided-exploration-concept/-/blob/master/README.md + [readme]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/-/blob/develop/README.md + [utterly-automated-versioning]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ + [gitlab-release-help]: https://docs.gitlab.com/ee/user/project/releases/ diff --git a/docs/input/docs/reference/build-servers/jenkins.md b/docs/input/docs/reference/build-servers/jenkins.md index 46b6355a29..93eb9cb6ab 100644 --- a/docs/input/docs/reference/build-servers/jenkins.md +++ b/docs/input/docs/reference/build-servers/jenkins.md @@ -1,5 +1,5 @@ --- -Order: 70 +Order: 90 Title: Jenkins Description: Details on the Jenkins support in GitVersion RedirectFrom: docs/build-server-support/build-server/jenkins @@ -9,13 +9,13 @@ RedirectFrom: docs/build-server-support/build-server/jenkins When setting up a Jenkins project for GitVersion, it is necessary to add a few _Behaviors_ to the SCM settings to ensure that GitVersion has enough information: -* Advanced clone behaviors - * Enable `Fetch tags` - * Enable `Honor refspec on intial clone` -* Check out to matching local branch -* Prune stale remote-tracking branches -* Specify ref specs - * Ref Spec: `+refs/heads/*:refs/remotes/@{remote}/*` +* Advanced clone behaviors + * Enable `Fetch tags` + * Enable `Honor refspec on intial clone` +* Check out to matching local branch +* Prune stale remote-tracking branches +* Specify ref specs + * Ref Spec: `+refs/heads/*:refs/remotes/@{remote}/*` ## Usage @@ -30,10 +30,10 @@ Jenkins plugins exist that provide this functionality. Of these plugins To inject the GitVersion variables as environment variables for a build job using [EnvInject][env-inject], do the following: -1. Add an **Execute Windows batch command** build step with _Command_: - `gitversion /output buildserver` -2. Add an **Inject environment variables** build step and use value - 'gitversion.properties' for the _Properties File Path_ parameter +1. Add an **Execute Windows batch command** build step with _Command_: + `gitversion /output buildserver` +2. Add an **Inject environment variables** build step and use value + 'gitversion.properties' for the _Properties File Path_ parameter This assumes GitVersion.exe is available on the command line. @@ -55,13 +55,13 @@ For pipeline projects, GitVersion variables can be accessed by reading the `gitv In a pipeline stage: -1. Run GitVersion with the flag for _buildserver_ output (this only works when run from Jenkins, specifically when the `JENKINS_URL` environment variable is defined): +1. Run GitVersion with the flag for _buildserver_ output (this only works when run from Jenkins, specifically when the `JENKINS_URL` environment variable is defined): ```groovy sh 'gitversion /output buildserver'` ``` -2. Add a script block to read the properties file, assign environment variables as needed: +2. Add a script block to read the properties file, assign environment variables as needed: ```groovy script { @@ -76,4 +76,5 @@ script { ``` [env-inject]: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin + [pipeline-utility-steps]: https://plugins.jenkins.io/pipeline-utility-steps diff --git a/docs/input/docs/reference/build-servers/myget.md b/docs/input/docs/reference/build-servers/myget.md index 383d61408a..895862c2a9 100644 --- a/docs/input/docs/reference/build-servers/myget.md +++ b/docs/input/docs/reference/build-servers/myget.md @@ -1,5 +1,5 @@ --- -Order: 80 +Order: 100 Title: MyGet Description: Details on the MyGet support in GitVersion RedirectFrom: docs/build-server-support/build-server/myget @@ -8,18 +8,18 @@ RedirectFrom: docs/build-server-support/build-server/myget MyGet Build Services has built-in support for GitVersion and is encouraging you to leverage GitVersion + GitFlow to produce Semantically Versioned packages. -* Create a [custom build script](https://docs.myget.org/docs/reference/custom-build-scripts): - we advise to run a tool like GitVersion in a _pre-build_ script, so that it can - set additional environment variables for the actual build script. MyGet - [by convention](https://docs.myget.org/docs/reference/build-services#Pre-\_and_post-build_steps) - automatically picks up any of the following file names as pre-build script: - * `pre-build.(bat|cmd|ps1)` - * `pre-myget.(bat|cmd|ps1)` -* Run `GitVersion /output buildserver`: this will cause MyGet Build Services to - set the current `%PackageVersion%` value to the NuGet-compatible SemVer - generated by GitVersion and apply this [MyGet Environment Variable](https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables) - wherever it is used during the build process. -* Ensure the build script has been pushed to your source repository root. Done :) +* Create a [custom build script](https://docs.myget.org/docs/reference/custom-build-scripts): + we advise to run a tool like GitVersion in a _pre-build_ script, so that it can + set additional environment variables for the actual build script. MyGet + [by convention](https://docs.myget.org/docs/reference/build-services#Pre-_and_post-build_steps) + automatically picks up any of the following file names as pre-build script: + * `pre-build.(bat|cmd|ps1)` + * `pre-myget.(bat|cmd|ps1)` +* Run `GitVersion /output buildserver`: this will cause MyGet Build Services to + set the current `%PackageVersion%` value to the NuGet-compatible SemVer + generated by GitVersion and apply this [MyGet Environment Variable](https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables) + wherever it is used during the build process. +* Ensure the build script has been pushed to your source repository root. Done :) :::{.alert .alert-info} **Note** diff --git a/docs/input/docs/reference/build-servers/octopus-deploy.md b/docs/input/docs/reference/build-servers/octopus-deploy.md index 79ce4035cd..e7d50ff3e0 100644 --- a/docs/input/docs/reference/build-servers/octopus-deploy.md +++ b/docs/input/docs/reference/build-servers/octopus-deploy.md @@ -1,5 +1,5 @@ --- -Order: 90 +Order: 110 Title: Octopus Deploy Description: Details on the Octopus Deploy support in GitVersion RedirectFrom: docs/build-server-support/build-server/octopus-deploy @@ -35,15 +35,15 @@ depending on which build server you have this approach may or may not work for you. For instance in TFS Build vNext you cannot chain builds to publish artifacts built in one build in another. -1. Your CI build creates the stable NuGet package +1. Your CI build creates the stable NuGet package -* Do _not_ publish this package into the Octopus nuget feed + * Do _not_ publish this package into the Octopus nuget feed -2. When you want to push a package into the Octopus deployment pipeline you trigger the second build +2. When you want to push a package into the Octopus deployment pipeline you trigger the second build -* it will either take the package built from the first build in the chain (your CI build?) or rebuild -* It will publish that package into the Octopus deploy feed -* The build then is _tagged_ with the version, this will cause GitVersion to increment the version + * it will either take the package built from the first build in the chain (your CI build?) or rebuild + * It will publish that package into the Octopus deploy feed + * The build then is _tagged_ with the version, this will cause GitVersion to increment the version This means that CI builds are _not_ available to Octopus deploy, there will be a manual build in your _build server_ which pushes the package to Octopus deploy. @@ -52,15 +52,15 @@ manual build in your _build server_ which pushes the package to Octopus deploy. Another simple option is to tag a stable version to release, the basic idea is: -1. GitVersion is set to continuous deployment mode, so main will create `-ci.x` - pre-release builds -2. CI Builds only create NuGet packages for stable builds -3. You tag main with a stable version of the next version then push it -4. The CI build triggers, GitVersion will always respect tags so you will get a - stable version -5. The stable package will be pushed to Octopus -6. Because of the tag, then next build will be incremented and will be producing - pre-release packages of the next build +1. GitVersion is set to continuous deployment mode, so main will create `-ci.x` + pre-release builds +2. CI Builds only create NuGet packages for stable builds +3. You tag main with a stable version of the next version then push it +4. The CI build triggers, GitVersion will always respect tags so you will get a + stable version +5. The stable package will be pushed to Octopus +6. Because of the tag, then next build will be incremented and will be producing + pre-release packages of the next build #### Script to create the release @@ -179,4 +179,5 @@ will burn multiple versions per release. This might not be an issue for you, but can confuse consumers of your library as the version has semantic meaning. [continuous-delivery]: /docs/reference/modes/continuous-delivery + [increment-per-commit]: /docs/reference/version-increments#incrementing-per-commit diff --git a/docs/input/docs/reference/build-servers/teamcity.md b/docs/input/docs/reference/build-servers/teamcity.md index 55d663cc8d..60f84f5129 100644 --- a/docs/input/docs/reference/build-servers/teamcity.md +++ b/docs/input/docs/reference/build-servers/teamcity.md @@ -1,5 +1,5 @@ --- -Order: 100 +Order: 120 Title: TeamCity Description: Details on the TeamCity support in GitVersion RedirectFrom: docs/build-server-support/build-server/teamcity @@ -9,10 +9,10 @@ RedirectFrom: docs/build-server-support/build-server/teamcity In [TeamCity][teamcity] you can create a build step as follows: -* **Runner type:** Command Line -* **Run:** Executable with parameters -* **Command executable:** `GitVersion.exe` -* **Command parameters:** `/output buildserver /updateassemblyinfo true` +* **Runner type:** Command Line +* **Run:** Executable with parameters +* **Command executable:** `GitVersion.exe` +* **Command parameters:** `/output buildserver /updateassemblyinfo true` Then in your build parameters simply [add a placeholder](#nuget-in-teamcity) of the GitVersion variables you would like to use. @@ -61,24 +61,24 @@ See [dynamic repositories][dynamic-repo] for more info. ### Output -* We update the TC build number to the GitVersion number automatically -* We output the individual values of the GitVersion version variables as build - parameters with format `GitVersion.*` (Eg: `GitVersion.Major`) if you need - access to them in your build script. Being system variables they will be passed - as msbuild/environmental variables to other build steps +* We update the TC build number to the GitVersion number automatically +* We output the individual values of the GitVersion version variables as build + parameters with format `GitVersion.*` (Eg: `GitVersion.Major`) if you need + access to them in your build script. Being system variables they will be passed + as msbuild/environmental variables to other build steps ### NuGet in TeamCity -* Add a dummy [parameter][parameter] to the project called `GitVersion.NuGetVersion`. If - many of your projects uses git-flow and SemVer you can add the parameter to - the "root-project" (TeamCity 8.x+). You need a dummy param because - GitVersion creates the variables at runtime, and you cannot reference a - parameter which is not available statically. GitVersion will overwrite the - dummy value. -* Then setup you nuget pack build set the "version" to - `%GitVersion.NuGetVersion%`. -* If you do your pack in a build script then you can just use environmental - variables because teamcity will pass them through automatically. +* Add a dummy [parameter][parameter] to the project called `GitVersion.NuGetVersion`. If + many of your projects uses git-flow and SemVer you can add the parameter to + the "root-project" (TeamCity 8.x+). You need a dummy param because + GitVersion creates the variables at runtime, and you cannot reference a + parameter which is not available statically. GitVersion will overwrite the + dummy value. +* Then setup you nuget pack build set the "version" to + `%GitVersion.NuGetVersion%`. +* If you do your pack in a build script then you can just use environmental + variables because teamcity will pass them through automatically. ### When TeamCity -> GitHub can't use https @@ -101,11 +101,16 @@ Sorry ## Guides -* [Continuous Delivery Setup in TeamCity][cd] +* [Continuous Delivery Setup in TeamCity][cd] [cd]: https://jake.ginnivan.net/blog/2014/07/09/my-typical-teamcity-build-setup + [dynamic-repo]: /docs/learn/dynamic-repositories + [general-settings]: https://www.jetbrains.com/help/teamcity/git.html#General+Settings + [parameter]: https://confluence.jetbrains.com/display/TCD8/Configuring+Build+Parameters + [teamcity]: https://www.jetbrains.com/teamcity/ + [meta-runner]: https://github.com/JetBrains/meta-runner-power-pack/tree/master/gitversion diff --git a/docs/input/docs/reference/configuration.md b/docs/input/docs/reference/configuration.md index 6db30871b3..9c4dd1a8f6 100644 --- a/docs/input/docs/reference/configuration.md +++ b/docs/input/docs/reference/configuration.md @@ -8,16 +8,6 @@ RedirectFrom: docs/configuration GitVersion, starting from version 3.0, is mainly powered by configuration and no longer has branching strategies hard-coded. -## Configuration tool - -If you run `gitversion init`, GitVersion will launch into a configuration tool, -which can help you configure GitVersion the way you want it. - -Once complete, the `init` command will create a `GitVersion.yml` file in the -working directory. It can be the root repository directory or any subdirectory -in case you have a single repository for more than one project or are restricted -to commit into a subdirectory. - :::{.alert .alert-info} **Note** @@ -31,41 +21,438 @@ found that is generally what is needed when using GitFlow. To see the effective configuration (defaults and overrides), you can run `gitversion /showConfig`. -To create your config file just type `gitversion init` in your repo directory, -after [installing][installing]. A minimal `GitVersion.yml` configuration file will be -created. Modify this to suit your needs. - ## Global configuration -The global configuration looks like this: +The following supported workflow configurations are available in GitVersion and can be referenced by the workflow property: + +* GitFlow (GitFlow/v1) +* GitHubFlow (GitHubFlow/v1) +* TrunkBased (TrunkBased/preview1) + +Example of using a `GitHubFlow` workflow with a different `tag-prefix`: ```yaml -next-version: 1.0 +workflow: GitHubFlow/v1 +tag-prefix: '[abc]' +``` + +The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) looks like: + + + +```yml assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch -assembly-informational-format: '{InformationalVersion}' +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + develop: + mode: ContinuousDelivery + label: alpha + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-target: true + track-merge-message: true + regex: ^dev(elop)?(ment)?$ + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: true + is-release-branch: false + is-main-branch: false + pre-release-weight: 0 + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Minor + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-target: false + regex: ^releases?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - develop + - main + - release + - support + - hotfix + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - develop + - main + - release + - feature + - support + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + hotfix: + mode: ManualDeployment + label: beta + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + support: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + regex: ^support[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: true + regex: (?.+) + source-branches: + - main + - develop + - release + - feature + - pull-request + - hotfix + - support + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] mode: ContinuousDelivery +label: '{BranchName}' increment: Inherit -continuous-delivery-fallback-tag: ci -tag-prefix: '[vV]' -major-version-bump-message: '\+semver:\s?(breaking|major)' -minor-version-bump-message: '\+semver:\s?(feature|minor)' -patch-version-bump-message: '\+semver:\s?(fix|patch)' -no-bump-message: '\+semver:\s?(none|skip)' -legacy-semver-padding: 4 -build-metadata-padding: 4 -commits-since-version-source-padding: 4 -tag-pre-release-weight: 60000 +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false +``` +snippet source | anchor + + +The supported built-in configuration for the `GitHubFlow` workflow (`workflow: GitHubFlow/v1`) looks like: + + + +```yml +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Patch + prevent-increment: + of-merged-branch: true + when-branch-merged: false + when-current-commit-tagged: false + track-merge-target: false + track-merge-message: true + regex: ^releases?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + - release + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: false + regex: (?.+) + source-branches: + - main + - release + - feature + - pull-request + is-source-branch-for: [] + is-main-branch: false ignore: sha: [] - commits-before: yyyy-MM-ddTHH:mm:ss + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false +``` +snippet source | anchor + + +The preview built-in configuration (experimental usage only) for the `TrunkBased` workflow (`workflow: TrunkBased/preview1`) looks like: + + + +```yml +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd merge-message-formats: {} update-build-number: true +semantic-version-format: Strict +strategies: +- ConfiguredNextVersion +- Mainline +branches: + main: + mode: ContinuousDeployment + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + feature: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + hotfix: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - feature + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: (?.+) + source-branches: + - main + is-source-branch-for: [] + pre-release-weight: 30000 +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false ``` +snippet source | anchor + The details of the available options are as follows: +### workflow + +The base template of the configuration to use. Possible values are `GitFlow/v1` or `GitHubFlow/v1`. Defaults to `GitFlow/v1` if not set. To create a configuration from scratch without using a base template, please specify an empty string. + ### next-version Allows you to bump the next version explicitly. Useful for bumping `main` or a @@ -90,6 +477,9 @@ while still updating the `AssemblyFileVersion` and `AssemblyInformationVersion` attributes. Valid values: `MajorMinorPatchTag`, `MajorMinorPatch`, `MajorMinor`, `Major`, `None`. +For information on using format strings in these properties, see +[Format Strings](/docs/reference/custom-formatting). + ### assembly-file-versioning-scheme When updating assembly info, `assembly-file-versioning-scheme` tells GitVersion @@ -132,7 +522,7 @@ The default value is `{InformationalVersion}`. ### mode Sets the `mode` of how GitVersion should create a new version. Read more at -[versioning modes][modes]. +[deployment modes][modes]. ### increment @@ -141,34 +531,19 @@ increased, such as for commits after a tag: `Major`, `Minor`, `Patch`, `None`. The special value `Inherit` means that GitVersion should find the parent branch (i.e. the branch where the current branch was branched from), and use its values -for [increment](#increment), -[prevent-increment-of-merged-branch-version](#prevent-increment-of-merged-branch-version) -and [tracks-release-branches](#tracks-release-branches). - -### continuous-delivery-fallback-tag +for [increment](#increment) or other branch related properties. -When using `mode: ContinuousDeployment`, the value specified in -`continuous-delivery-fallback-tag` will be used as the pre-release tag for -branches which do not have one specified. Default set to `ci`. - -Just to clarify: For a build name without `...-ci-` or in other -words without a `PreReleaseTag` (ergo `"PreReleaseTag":""` in GitVersion's JSON output) -at the end you would need to set `continuous-delivery-fallback-tag` to an empty -string (`''`): - -```yaml -mode: ContinuousDeployment -continuous-delivery-fallback-tag: '' -... -``` +### tag-prefix -Doing so can be helpful if you use your `main` branch as a `release` branch. +A regular expression which is used to trim Git tags before processing (e.g., +v1.0.0). The default value is `[vV]`. -### tag-prefix +### version-in-branch-pattern -A regex which is used to trim Git tags before processing (e.g., v1.0.0). Default -is `[vV]`, although this is just for illustrative purposes as we do a IgnoreCase -match and could be `v`. +A regular expression which is used to determine the version number in the branch +name or commit message (e.g., v1.0.0-LTS). This setting only applies on branches +where the option `is-release-branch` is set to `true`. The default value is +`(?[vV]?\d+(\.\d+)?(\.\d+)?).*`. ### major-version-bump-message @@ -194,23 +569,8 @@ Used to tell GitVersion not to increment when in Mainline development mode. Default `\+semver:\s?(none|skip)`, which will match occurrences of `+semver: none` and `+semver: skip` -### legacy-semver-padding - -The number of characters to pad `LegacySemVer` to in the `LegacySemVerPadded` -[variable][variables]. Default is `4`, which will pad the `LegacySemVer` value - of `3.0.0-beta1` to `3.0.0-beta0001`. - -### build-metadata-padding - -The number of characters to pad `BuildMetaData` to in the `BuildMetaDataPadded` -[variable][variables]. Default is `4`, which will pad the `BuildMetaData` value -of `1` to `0001`. - -### commits-since-version-source-padding - -The number of characters to pad `CommitsSinceVersionSource` to in the -`CommitsSinceVersionSourcePadded` [variable][variables]. Default is `4`, which -will pad the `CommitsSinceVersionSource` value of `1` to `0001`. +When a commit matches **both** the `no-bump-message` **and** any combination of +the `version-bump-message`, `no-bump-message` takes precedence and no increment is applied. ### tag-pre-release-weight @@ -218,7 +578,7 @@ The pre-release weight in case of tagged commits. If the value is not set in the configuration, a default weight of 60000 is used instead. If the `WeightedPreReleaseNumber` [variable][variables] is 0 and this parameter is set, its value is used. This helps if your branching model is GitFlow and the last -release build, which is often tagged, can utilise this parameter to produce a +release build, which is often tagged, can utilize this parameter to produce a monotonically increasing build number. ### commit-message-incrementing @@ -267,6 +627,44 @@ Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before: 2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before `commits-before` will be ignored. +#### paths +A sequence of regular expressions that represent paths in the repository. Commits that modify these paths will be excluded from version calculations. For example, to filter out commits that belong to `docs`: +```yaml +ignore: + paths: + - ^docs\/ +``` +##### *Monorepo* +This ignore config can be used to filter only those commits that belong to a specific project in a monorepo. +As an example, consider a monorepo consisting of subdirectories for `ProjectA`, `ProjectB` and a shared `LibraryC`. For GitVersion to consider only commits that are part of `projectA` and shared library `LibraryC`, a regex that matches all paths except those starting with `ProjectA` or `LibraryC` can be used. Either one of the following configs would filter out `ProjectB`. +* Specific match on `/ProjectB/*`: +```yaml +ignore: + paths: + - `^\/ProductB\/.*` +``` +* Negative lookahead on anything other than `/ProjectA/*` and `/LibraryC/*`: +```yaml +ignore: + paths: + - `^(?!\/ProductA\/|\/LibraryC\/).*` +``` +A commit having changes only in `/ProjectB/*` path would be ignored. A commit having changes in the following paths wouldn't be ignored: +* `/ProductA/*` +* `/LibraryC/*` +* `/ProductA/*` and `/LibraryC/*` +* `/ProductA/*` and `/ProductB/*` +* `/LibraryC/*` and `/ProductB/*` +* `/ProductA/*` and `/ProductB/*` and `/LibraryC/*` + +::: +Note: The `ignore.paths` configuration is case-sensitive. This can lead to unexpected behavior on case-insensitive file systems, such as Windows. To ensure consistent matching regardless of case, you can prefix your regular expressions with the case-insensitive flag `(?i)`. For example, `(?i)^docs\/` will match both `docs/` and `Docs/`. +::: + +::: {.alert .alert-warning} +A commit is ignored by the `ignore.paths` configuration only if **all paths** changed in that commit match one or more of the specified regular expressions. If a path in a commit does not match any one of the ignore patterns, that commit will be included in version calculations. +::: + ### merge-message-formats Custom merge message formats to enable identification of merge messages that do not @@ -276,14 +674,14 @@ e.g. ```yaml merge-message-formats: - tfs: ^Merged (?:PR (?\d+)): Merge (?.+) to (?.+) + tfs: '^Merged (?:PR (?\d+)): Merge (?.+) to (?.+)' ``` The regular expression should contain the following capture groups: -* `SourceBranch` - Identifies the source branch of the merge -* `TargetBranch` - Identifies the target branch of the merge -* `PullRequestNumber` - Captures the pull-request number +* `SourceBranch` - Identifies the source branch of the merge +* `TargetBranch` - Identifies the target branch of the merge +* `PullRequestNumber` - Captures the pull-request number Custom merge message formats are evaluated _before_ any built in formats. Support for [Conventional Commits][conventional-commits] can be @@ -307,92 +705,84 @@ If you have branch specific configuration upgrading to v4 will force you to upgrade. ```yaml +workflow: 'GitHubFlow/v1' branches: main: - regex: ^master$|^main$ - mode: ContinuousDelivery - tag: '' + label: '' increment: Patch - prevent-increment-of-merged-branch-version: true + prevent-increment: + of-merged-branch: true track-merge-target: false - source-branches: [ 'develop', 'release' ] + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] tracks-release-branches: false is-release-branch: false - is-mainline: true + is-main-branch: true pre-release-weight: 55000 - develop: - regex: ^dev(elop)?(ment)?$ - mode: ContinuousDeployment - tag: alpha - increment: Minor - prevent-increment-of-merged-branch-version: false - track-merge-target: true - source-branches: [] - tracks-release-branches: true - is-release-branch: false - is-mainline: false - pre-release-weight: 0 release: - regex: ^releases?[/-] - mode: ContinuousDelivery - tag: beta - increment: None - prevent-increment-of-merged-branch-version: true + mode: ManualDeployment + label: beta + increment: Patch + prevent-increment: + of-merged-branch: true + when-branch-merged: false + when-current-commit-tagged: false track-merge-target: false - source-branches: [ 'develop', 'main', 'support', 'release' ] + track-merge-message: true + regex: ^releases?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] tracks-release-branches: false is-release-branch: true - is-mainline: false + is-main-branch: false pre-release-weight: 30000 feature: - regex: ^features?[/-] - mode: ContinuousDelivery - tag: useBranchName + mode: ManualDeployment + label: '{BranchName}' increment: Inherit - prevent-increment-of-merged-branch-version: false - track-merge-target: false - source-branches: [ 'develop', 'main', 'release', 'feature', 'support', 'hotfix' ] - tracks-release-branches: false - is-release-branch: false - is-mainline: false + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + - release + is-source-branch-for: [] + is-main-branch: false pre-release-weight: 30000 pull-request: - regex: ^(pull|pull\-requests|pr)[/-] mode: ContinuousDelivery - tag: PullRequest + label: PullRequest{Number} increment: Inherit - prevent-increment-of-merged-branch-version: false - tag-number-pattern: '[/-](?\d+)[-/]' - track-merge-target: false - source-branches: [ 'develop', 'main', 'release', 'feature', 'support', 'hotfix' ] - tracks-release-branches: false - is-release-branch: false - is-mainline: false - pre-release-weight: 30000 - hotfix: - regex: ^hotfix(es)?[/-] - mode: ContinuousDelivery - tag: beta - increment: Patch - prevent-increment-of-merged-branch-version: false - track-merge-target: false - source-branches: [ 'develop', 'main', 'support' ] - tracks-release-branches: false - is-release-branch: false - is-mainline: false + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] pre-release-weight: 30000 - support: - regex: ^support[/-] - mode: ContinuousDelivery - tag: '' - increment: Patch - prevent-increment-of-merged-branch-version: true - track-merge-target: false - source-branches: [ 'main' ] - tracks-release-branches: false - is-release-branch: false - is-mainline: true - pre-release-weight: 55000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: false + regex: (?.+) + source-branches: + - main + - release + - feature + - pull-request + is-source-branch-for: [] + is-main-branch: false ``` If you don't specify the regex, the built-in for that branch config will be @@ -406,6 +796,8 @@ values, but here they are if you need to: This is the regex which is used to match the current branch to the correct branch configuration. +[Named groups](https://learn.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions#named-matched-subexpressions) can be used to dynamically label pre-releases based on the branch name, or parts of it. See [Label](#label) for more details and examples. + ### source-branches Because Git commits only refer to parent commits (not branches) GitVersion @@ -424,16 +816,16 @@ Take this commit graph By looking at this graph, you cannot tell which of these scenarios happened: -* feature/foo branches off release/v1.0.0 - * Branch release/v1.0.0 from main - * Branch feature/foo from release/v1.0.0 - * Add a commit to both release/v1.0.0 and feature/foo - * release/v1.0.0 is the base for feature/foo -* release/v1.0.0 branches off feature/foo - * Branch feature/foo from main - * Branch release/v1.0.0 from feature/foo - * Add a commit to both release/v1.0.0 and feature/foo - * feature/foo is the base for release/v1.0.0 +* feature/foo branches off release/v1.0.0 + * Branch release/v1.0.0 from main + * Branch feature/foo from release/v1.0.0 + * Add a commit to both release/v1.0.0 and feature/foo + * release/v1.0.0 is the base for feature/foo +* release/v1.0.0 branches off feature/foo + * Branch feature/foo from main + * Branch release/v1.0.0 from feature/foo + * Add a commit to both release/v1.0.0 and feature/foo + * feature/foo is the base for release/v1.0.0 Or put more simply, you cannot tell which branch was created first, `release/v1.0.0` or `feature/foo`. @@ -474,7 +866,7 @@ Without this configuration value you would have to do: ```yaml branches: unstable: - regex: ... + regex: feature: source-branches: ['unstable', 'develop', 'feature', 'hotfix', 'support'] release: @@ -490,21 +882,25 @@ The header for all the individual branch configuration. Same as for the [global configuration, explained above](#mode). -### tag +### label + +The pre-release label to use for this branch. Use the value `{BranchName}` as a placeholder to +insert the value of the named group `BranchName` from the [regular expression](#regex). -The pre release tag to use for this branch. Use the value `useBranchName` to use -the branch name instead. For example `feature/foo` would become a pre-release -tag of `foo` with this value. Use the value `{BranchName}` as a placeholder to -insert the branch name. For example `feature/foo` would become a pre-release tag -of `alpha.foo` with the value of `alpha.{BranchName}`. +For example: branch `feature/foo` would become a pre-release label +of `alpha.foo` with `label: 'alpha.{BranchName}'` and `regex: '^features?[\/-](?.+)'`. -**Note:** To clear a default use an empty string: `tag: ''` +Another example: branch `features/sc-12345/some-description` would become a pre-release label of `sc-12345` with `label: '{StoryNo}'` and `regex: '^features?[\/-](?sc-\d+)[-/].+'`. + +**Note:** To clear a default use an empty string: `label: ''` ### increment Same as for the [global configuration, explained above](#increment). -### prevent-increment-of-merged-branch-version +### prevent-increment-of-merged-branch + +The increment of the branch merged to will be ignored, regardless of whether the merged branch has a version number or not, when this branch related property is set to true on the target branch. When `release-2.0.0` is merged into main, we want main to build `2.0.0`. If `release-2.0.0` is merged into develop we want it to build `2.1.0`, this option @@ -515,35 +911,53 @@ In a GitFlow-based repository, setting this option can have implications on the better version source proposed by the `MergeMessageBaseVersionStrategy`. For more details and an in-depth analysis, please see [the discussion][2506]. -### tag-number-pattern +### prevent-increment-when-branch-merged -Pull requests require us to extract the pre-release number out of the branch -name so `refs/pulls/534/merge` builds as `PullRequest.534`. This is a regex with -a named capture group called `number`. +The increment of the merged branch will be ignored when this branch related property is set to `true` on the source branch. + +### prevent-increment-when-current-commit-tagged -If the branch `mode` is set to `ContinuousDeployment`, then the extracted -`number` is appended to the name of the pre-release tag and the number portion -is the number of commits since the last tag. This enables consecutive commits to -the pull request branch to generate unique full semantic version numbers when -the branch is configured to use ContinuousDeployment mode. +This branch related property controls the behvior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true. + +### label-number-pattern + +Pull requests require us to extract the pre-release number out of the branch +name so `refs/pull/534/merge` builds as `PullRequest534`. This is a regex with +a named capture group called `Number`. **Example usage:** ```yaml branches: pull-request: - mode: ContinuousDeployment - tag: PullRequest + mode: ContinuousDelivery + label: PullRequest{Number} increment: Inherit - track-merge-target: true - tag-number-pattern: '[/-](?\d+)[-/]' + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 ``` ### track-merge-target Strategy which will look for tagged merge commits directly off the current branch. For example `develop` → `release/1.0.0` → merge into `main` and tag -`1.0.0`. The tag is *not* on develop, but develop should be version `1.0.0` now. +`1.0.0`. The tag is _not_ on develop, but develop should be version `1.0.0` now. + +### track-merge-message + +This property is a branch related property and gives the user the possibility to control the behavior of whether the merge +commit message will be interpreted as a next version or not. Consider we have a main branch and a `release/1.0.0` branch and +merge changes from `release/1.0.0` to the `main` branch. If `track-merge-message` is set to `true` then the next version will +be `1.0.0` otherwise `0.0.1`. ### tracks-release-branches @@ -553,10 +967,9 @@ Indicates this branch config represents develop in GitFlow. Indicates this branch config represents a release branch in GitFlow. -### is-mainline +### is-main-branch -When using Mainline mode, this indicates that this branch is a mainline. By -default `main` and `support/*` are mainlines. +This indicates that this branch is a main branch. By default `main` and `support/*` are main branches. ### pre-release-weight @@ -572,12 +985,45 @@ is set, it would be added to the `PreReleaseNumber` to get a final `pre-release-weight` will be used in the calculation. Related Issues [1145][1145] and [1366][1366]. +### semantic-version-format + +Specifies the semantic version format that is used when parsing the string. +Can be `Strict` - using the [regex](https://regex101.com/r/Ly7O1x/3/) +or `Loose` the old way of parsing. The default if not specified is `Strict` +Example of invalid `Strict`, but valid `Loose` + +```log +1.2-alpha4 +01.02.03-rc03 +1.2.3.4 +``` + +### strategies + +Specifies which version strategy implementation (one or more) will be used to determine the next version. +These strategies can be combined, and the order in which they are specified does not matter. +The configuration accepts the following values: + +* Fallback +* ConfiguredNextVersion +* MergeMessage +* TaggedCommit +* TrackReleaseBranches +* VersionInBranchName +* Mainline + [1145]: https://github.com/GitTools/GitVersion/issues/1145 + [1366]: https://github.com/GitTools/GitVersion/issues/1366 + [2506]: https://github.com/GitTools/GitVersion/pull/2506#issuecomment-754754037 + [conventional-commits-config]: /docs/reference/version-increments#conventional-commit-messages + [conventional-commits]: https://www.conventionalcommits.org/ -[installing]: /docs/usage/cli/installation + [modes]: /docs/reference/modes + [variables]: /docs/reference/variables + [version-sources]: /docs/reference/version-sources diff --git a/docs/input/docs/reference/custom-formatting.md b/docs/input/docs/reference/custom-formatting.md new file mode 100644 index 0000000000..c970fea342 --- /dev/null +++ b/docs/input/docs/reference/custom-formatting.md @@ -0,0 +1,181 @@ +--- +title: Format Strings +description: Using C# format strings in GitVersion configuration +--- + +GitVersion supports C# format strings in configuration, allowing you to apply standard .NET formatting and custom transformations to version properties. This enhancement provides more flexibility and control over how version information is displayed and used throughout your build process. + +## Overview + +The custom formatter functionality introduces several new formatters that can be used in GitVersion configuration files and templates: + +- **FormattableFormatter**: Supports standard .NET format strings for numeric values, dates, and implements `IFormattable` +- **NumericFormatter**: Handles numeric formatting with culture-aware output +- **DateTimeFormatter**: Provides date and time formatting with standard and custom format specifiers +- **String Case Formatters**: Provides text case transformations with custom format specifiers + +## Standard .NET Format Strings + +### Numeric Formatting + +You can now use standard .NET numeric format strings with version components: + +```yaml +# GitVersion.yml +assembly-informational-format: "{Major}.{Minor}.{Patch:F2}-{PreReleaseLabel}" +``` + +**Supported Numeric Formats:** + +- `F` or `f` (Fixed-point): `{Patch:F2}` → `"1.23"` +- `N` or `n` (Number): `{BuildMetadata:N0}` → `"1,234"` +- `C` or `c` (Currency): `{Major:C}` → `"¤1.00"` +- `P` or `p` (Percent): `{CommitsSinceVersionSource:P}` → `"12,345.60 %"` +- `D` or `d` (Decimal): `{Major:D4}` → `"0001"` +- `X` or `x` (Hexadecimal): `{Patch:X}` → `"FF"` + +### Date and Time Formatting + +When working with date-related properties like `CommitDate`: + +```yaml +assembly-informational-format: "Build-{SemVer}-{CommitDate:yyyy-MM-dd}" +``` + +**Common Date Format Specifiers:** + +- `yyyy-MM-dd` → `"2024-03-15"` +- `HH:mm:ss` → `"14:30:22"` +- `MMM dd, yyyy` → `"Mar 15, 2024"` +- `yyyy-MM-dd'T'HH:mm:ss'Z'` → `"2024-03-15T14:30:22Z"` + +## Custom String Case Formatters + +GitVersion introduces custom format specifiers for string case transformations that can be used in templates: + +### Available Case Formats + +| Format | Description | Example Input | Example Output | +|--------|---------------------------------------------------------------|------------------|------------------| +| `u` | **Uppercase** - Converts entire string to uppercase | `feature-branch` | `FEATURE-BRANCH` | +| `l` | **Lowercase** - Converts entire string to lowercase | `Feature-Branch` | `feature-branch` | +| `t` | **Title Case** - Capitalizes first letter of each word | `feature-branch` | `Feature-Branch` | +| `s` | **Sentence Case** - Capitalizes only the first letter | `feature-branch` | `Feature-branch` | +| `c` | **PascalCase** - Removes separators and capitalizes each word | `feature-branch` | `FeatureBranch` | + +### Usage Examples + +```yaml +# GitVersion.yml configuration +branches: + feature: + label: "{BranchName:c}" # Converts to PascalCase + +assembly-informational-format: "{Major}.{Minor}.{Patch}-{PreReleaseLabel:l}.{CommitsSinceVersionSource:0000}" +``` + +**Template Usage:** + +```yaml +# Using format strings in templates +assembly-informational-format: "{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}" +assembly-informational-format: "{SemVer}-{BranchName:l}" +``` + +## Examples + +Based on actual test cases from the implementation: + +### Zero-Padded Numeric Formatting + +```yaml +# Zero-padded commit count +assembly-informational-format: "{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}" +# Result: "1.2.3-0042" +``` + +### String Case Transformations + +```yaml +branches: + feature: + label: "{BranchName:c}" # PascalCase: "feature-branch" → "FeatureBranch" + hotfix: + label: "hotfix-{BranchName:l}" # Lowercase: "HOTFIX-BRANCH" → "hotfix-branch" +``` + +### Date and Time Formatting + +```yaml +assembly-informational-format: "{SemVer}-build-{CommitDate:yyyy-MM-dd}" +# Result: "1.2.3-build-2021-01-01" +``` + +### Numeric Formatting + +```yaml +# Currency format (uses InvariantCulture) +assembly-informational-format: "Cost-{Major:C}" # Result: "Cost-¤1.00" + +# Percentage format +assembly-informational-format: "Progress-{Minor:P}" # Result: "Progress-200.00 %" + +# Thousands separator +assembly-informational-format: "Build-{CommitsSinceVersionSource:N0}" # Result: "Build-1,234" +``` + +## Configuration Integration + +The format strings are used in GitVersion configuration files through various formatting properties: + +### Assembly Version Formatting + +```yaml +# GitVersion.yml +assembly-informational-format: "{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}" +assembly-versioning-format: "{Major}.{Minor}.{Patch}.{env:BUILD_NUMBER}" +assembly-file-versioning-format: "{MajorMinorPatch}.{CommitsSinceVersionSource}" +``` + +### Environment Variable Integration + +```yaml +# Using environment variables with fallbacks +assembly-informational-format: "{Major}.{Minor}.{Patch}-{env:RELEASE_STAGE ?? 'dev'}" +assembly-informational-format: "{SemVer}+{env:BUILD_ID ?? 'local'}" +``` + +### Real-World Integration Examples + +Based on the actual test implementation: + +```yaml +# Example from VariableProviderTests.cs +assembly-informational-format: "{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}" +# Result: "1.2.3-0042" when CommitsSinceVersionSource = 42 + +# Branch-specific formatting +branches: + feature: + label: "{BranchName:c}" # PascalCase conversion + hotfix: + label: "hotfix.{CommitsSinceVersionSource:00}" +``` + +## Invariant Culture Formatting + +The formatting system uses `CultureInfo.InvariantCulture` by default through the chained `TryFormat` overload implementation. This provides: + +- **Consistent results** across all environments and systems +- **Predictable numeric formatting** with period (.) as decimal separator and comma (,) as thousands separator +- **Standard date formatting** using English month names and formats +- **No localization variations** regardless of system locale + +```csharp +// All environments produce the same output: +// {CommitsSinceVersionSource:N0} → "1,234" +// {CommitDate:MMM dd, yyyy} → "Mar 15, 2024" +// {Major:C} → "¤1.00" (generic currency symbol) +``` + +This ensures that version strings generated by GitVersion are consistent across different build environments, developer machines, and CI/CD systems. diff --git a/docs/input/docs/reference/mdsource/configuration.source.md b/docs/input/docs/reference/mdsource/configuration.source.md new file mode 100644 index 0000000000..f08c69c816 --- /dev/null +++ b/docs/input/docs/reference/mdsource/configuration.source.md @@ -0,0 +1,630 @@ +--- +Order: 10 +Title: Configuration +Description: Details about how GitVersion can be configured to suit your needs +RedirectFrom: docs/configuration +--- + +GitVersion, starting from version 3.0, is mainly powered by configuration and no +longer has branching strategies hard-coded. + +:::{.alert .alert-info} +**Note** + +GitVersion ships with internal default configuration which works with +GitHubFlow and GitFlow, probably with others too. +::: + +The `develop` branch is set to `ContinuousDeployment` mode by default as we have +found that is generally what is needed when using GitFlow. + +To see the effective configuration (defaults and overrides), you can run +`gitversion /showConfig`. + +## Global configuration + +The following supported workflow configurations are available in GitVersion and can be referenced by the workflow property: + +* GitFlow (GitFlow/v1) +* GitHubFlow (GitHubFlow/v1) +* TrunkBased (TrunkBased/preview1) + +Example of using a `GitHubFlow` workflow with a different `tag-prefix`: + +```yaml +workflow: GitHubFlow/v1 +tag-prefix: '[abc]' +``` + +The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) looks like: + +snippet: /docs/workflows/GitFlow/v1.yml + +The supported built-in configuration for the `GitHubFlow` workflow (`workflow: GitHubFlow/v1`) looks like: + +snippet: /docs/workflows/GitHubFlow/v1.yml + +The preview built-in configuration (experimental usage only) for the `TrunkBased` workflow (`workflow: TrunkBased/preview1`) looks like: + +snippet: /docs/workflows/TrunkBased/preview1.yml + +The details of the available options are as follows: + +### workflow + +The base template of the configuration to use. Possible values are `GitFlow/v1` or `GitHubFlow/v1`. Defaults to `GitFlow/v1` if not set. To create a configuration from scratch without using a base template, please specify an empty string. + +### next-version + +Allows you to bump the next version explicitly. Useful for bumping `main` or a +feature branch with breaking changes (i.e., a major increment), indicating what +the next `git tag` is going to be. + +`next-version` is not a permanent replacement for `git tag` and should only be +used intermittently. Since version 5.5 GitVersion supports `next-version` with +`mode: Mainline` and should not be treated as a "base version". + +If you are using `next-version` and are experiencing weird versioning behaviour, +please remove it, create a `git tag` with an appropriate version number on an +appropriate historical commit and see if that resolves any versioning issues +you may have. + +### assembly-versioning-scheme + +When updating assembly info, `assembly-versioning-scheme` tells GitVersion how +to treat the `AssemblyVersion` attribute. Useful to lock the major when using +Strong Naming. Note: you can use `None` to skip updating the `AssemblyVersion` +while still updating the `AssemblyFileVersion` and `AssemblyInformationVersion` +attributes. Valid values: `MajorMinorPatchTag`, `MajorMinorPatch`, `MajorMinor`, +`Major`, `None`. + +For information on using format strings in these properties, see +[Format Strings](/docs/reference/custom-formatting). + +### assembly-file-versioning-scheme + +When updating assembly info, `assembly-file-versioning-scheme` tells GitVersion +how to treat the `AssemblyFileVersion` attribute. Note: you can use `None` to +skip updating the `AssemblyFileVersion` while still updating the +`AssemblyVersion` and `AssemblyInformationVersion` attributes. Valid values: +`MajorMinorPatchTag`, `MajorMinorPatch`, `MajorMinor`, `Major`, `None`. + +### assembly-file-versioning-format + +Specifies the format of `AssemblyFileVersion` and +overwrites the value of `assembly-file-versioning-scheme`. + +Expressions in curly braces reference one of the [variables][variables] +or a process-scoped environment variable (when prefixed with `env:`). For example, + +```yaml +# use a variable if non-null or a fallback value otherwise +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}' + +# use an environment variable or raise an error if not available +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:BUILD_NUMBER}' + +# use an environment variable if available or a fallback value otherwise +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:BUILD_NUMBER ?? 42}' +``` + +### assembly-versioning-format + +Specifies the format of `AssemblyVersion` and +overwrites the value of `assembly-versioning-scheme`. +Follows the same formatting semantics as `assembly-file-versioning-format`. + +### assembly-informational-format + +Specifies the format of `AssemblyInformationalVersion`. +Follows the same formatting semantics as `assembly-file-versioning-format`. +The default value is `{InformationalVersion}`. + +### mode + +Sets the `mode` of how GitVersion should create a new version. Read more at +[deployment modes][modes]. + +### increment + +The part of the SemVer to increment when GitVersion detects it needs to be +increased, such as for commits after a tag: `Major`, `Minor`, `Patch`, `None`. + +The special value `Inherit` means that GitVersion should find the parent branch +(i.e. the branch where the current branch was branched from), and use its values +for [increment](#increment) or other branch related properties. + +### tag-prefix + +A regular expression which is used to trim Git tags before processing (e.g., +v1.0.0). The default value is `[vV]`. + +### version-in-branch-pattern + +A regular expression which is used to determine the version number in the branch +name or commit message (e.g., v1.0.0-LTS). This setting only applies on branches +where the option `is-release-branch` is set to `true`. The default value is +`(?[vV]?\d+(\.\d+)?(\.\d+)?).*`. + +### major-version-bump-message + +The regex to match commit messages with to perform a major version increment. +Default set to `'\+semver:\s?(breaking|major)'`, which will match occurrences of +`+semver: major` and `+semver: breaking` in a commit message. + +### minor-version-bump-message + +The regex to match commit messages with to perform a minor version increment. +Default set to `'\+semver:\s?(feature|minor)'`, which will match occurrences of +`+semver: feature` and `+semver: minor` in a commit message. + +### patch-version-bump-message + +The regex to match commit messages with to perform a patch version increment. +Default set to `'\+semver:\s?(fix|patch)'`, which will match occurrences of +`+semver: fix` and `+semver: patch` in a commit message. + +### no-bump-message + +Used to tell GitVersion not to increment when in Mainline development mode. +Default `\+semver:\s?(none|skip)`, which will match occurrences of `+semver: +none` and `+semver: skip` + +When a commit matches **both** the `no-bump-message` **and** any combination of +the `version-bump-message`, `no-bump-message` takes precedence and no increment is applied. + +### tag-pre-release-weight + +The pre-release weight in case of tagged commits. If the value is not set in the +configuration, a default weight of 60000 is used instead. If the +`WeightedPreReleaseNumber` [variable][variables] is 0 and this parameter is set, +its value is used. This helps if your branching model is GitFlow and the last +release build, which is often tagged, can utilize this parameter to produce a +monotonically increasing build number. + +### commit-message-incrementing + +Sets whether it should be possible to increment the version with special syntax +in the commit message. See the `*-version-bump-message` options above for +details on the syntax. Default set to `Enabled`; set to `Disabled` to disable. + +### commit-date-format + +Sets the format which will be used to format the `CommitDate` output variable. + +### ignore + +The header property for the `ignore` configuration. + +:::{.alert .alert-info} +**Note:** When ignoring a commit or a range of commits, they are only ignored in +the search for a [version source][version-sources], not when calculating other +parts of the version number, such as build metadata. +::: + +#### sha + +A sequence of SHAs to be excluded from the version calculations. Useful when +there is a rogue commit in history yielding a bad version. You can use either +style below: + +```yaml +ignore: + sha: [e7bc24c0f34728a25c9187b8d0b041d935763e3a, 764e16321318f2fdb9cdeaa56d1156a1cba307d7] +``` + +or + +```yaml +ignore: + sha: + - e7bc24c0f34728a25c9187b8d0b041d935763e3a + - 764e16321318f2fdb9cdeaa56d1156a1cba307d7 +``` + +#### commits-before + +Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before: +2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before +`commits-before` will be ignored. + +#### paths +A sequence of regular expressions that represent paths in the repository. Commits that modify these paths will be excluded from version calculations. For example, to filter out commits that belong to `docs`: +```yaml +ignore: + paths: + - ^docs\/ +``` +##### *Monorepo* +This ignore config can be used to filter only those commits that belong to a specific project in a monorepo. +As an example, consider a monorepo consisting of subdirectories for `ProjectA`, `ProjectB` and a shared `LibraryC`. For GitVersion to consider only commits that are part of `projectA` and shared library `LibraryC`, a regex that matches all paths except those starting with `ProjectA` or `LibraryC` can be used. Either one of the following configs would filter out `ProjectB`. +* Specific match on `/ProjectB/*`: +```yaml +ignore: + paths: + - `^\/ProductB\/.*` +``` +* Negative lookahead on anything other than `/ProjectA/*` and `/LibraryC/*`: +```yaml +ignore: + paths: + - `^(?!\/ProductA\/|\/LibraryC\/).*` +``` +A commit having changes only in `/ProjectB/*` path would be ignored. A commit having changes in the following paths wouldn't be ignored: +* `/ProductA/*` +* `/LibraryC/*` +* `/ProductA/*` and `/LibraryC/*` +* `/ProductA/*` and `/ProductB/*` +* `/LibraryC/*` and `/ProductB/*` +* `/ProductA/*` and `/ProductB/*` and `/LibraryC/*` + +::: +Note: The `ignore.paths` configuration is case-sensitive. This can lead to unexpected behavior on case-insensitive file systems, such as Windows. To ensure consistent matching regardless of case, you can prefix your regular expressions with the case-insensitive flag `(?i)`. For example, `(?i)^docs\/` will match both `docs/` and `Docs/`. +::: + +::: {.alert .alert-warning} +A commit is ignored by the `ignore.paths` configuration only if **all paths** changed in that commit match one or more of the specified regular expressions. If a path in a commit does not match any one of the ignore patterns, that commit will be included in version calculations. +::: + +### merge-message-formats + +Custom merge message formats to enable identification of merge messages that do not +follow the built-in conventions. Entries should be added as key-value pairs where +the value is a regular expression. +e.g. + +```yaml +merge-message-formats: + tfs: '^Merged (?:PR (?\d+)): Merge (?.+) to (?.+)' +``` + +The regular expression should contain the following capture groups: + +* `SourceBranch` - Identifies the source branch of the merge +* `TargetBranch` - Identifies the target branch of the merge +* `PullRequestNumber` - Captures the pull-request number + +Custom merge message formats are evaluated _before_ any built in formats. +Support for [Conventional Commits][conventional-commits] can be +[configured][conventional-commits-config]. + +### update-build-number + +Configures GitVersion to update the build number or not when running on a build server. + +## Branch configuration + +Then we have branch specific configuration, which looks something like this: + +:::{.alert .alert-info} +**Note** + +v4 changed from using regexes for keys, to named configs +::: + +If you have branch specific configuration upgrading to v4 will force you to +upgrade. + +```yaml +workflow: 'GitHubFlow/v1' +branches: + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Patch + prevent-increment: + of-merged-branch: true + when-branch-merged: false + when-current-commit-tagged: false + track-merge-target: false + track-merge-message: true + regex: ^releases?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + - release + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: false + regex: (?.+) + source-branches: + - main + - release + - feature + - pull-request + is-source-branch-for: [] + is-main-branch: false +``` + +If you don't specify the regex, the built-in for that branch config will be +used (recommended). + +We don't envision many people needing to change most of these configuration +values, but here they are if you need to: + +### regex + +This is the regex which is used to match the current branch to the correct +branch configuration. + +[Named groups](https://learn.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions#named-matched-subexpressions) can be used to dynamically label pre-releases based on the branch name, or parts of it. See [Label](#label) for more details and examples. + +### source-branches + +Because Git commits only refer to parent commits (not branches) GitVersion +sometimes cannot tell which branch the current branch was branched from. + +Take this commit graph + +```shell +* release/v1.0.0 * feature/foo +| ________________/ +|/ +* +* +* (main) +``` + +By looking at this graph, you cannot tell which of these scenarios happened: + +* feature/foo branches off release/v1.0.0 + * Branch release/v1.0.0 from main + * Branch feature/foo from release/v1.0.0 + * Add a commit to both release/v1.0.0 and feature/foo + * release/v1.0.0 is the base for feature/foo +* release/v1.0.0 branches off feature/foo + * Branch feature/foo from main + * Branch release/v1.0.0 from feature/foo + * Add a commit to both release/v1.0.0 and feature/foo + * feature/foo is the base for release/v1.0.0 + +Or put more simply, you cannot tell which branch was created first, +`release/v1.0.0` or `feature/foo`. + +To resolve this issue, we give GitVersion a hint about our branching workflows +by telling it what types of branches a branch can be created from. For example, +feature branches are, by default, configured to have the following source +branches: + +`source-branches: ['main', 'develop', 'feature', 'hotfix', 'support']` + +This means that we will never bother to evaluate pull request branches as merge +base options and being explicit in this way also improves the performance of +GitVersion. + +### is-source-branch-for + +The reverse of `source-branches`. This property was introduced to keep it easy +to extend GitVersion's config. + +It exists to make it easier to extend GitVersion's configuration. If only +`source-branches` exists and you add a new branch type, for instance +`unstable/`, you then need to re-define the `source-branches` configuration +value for existing branches (like feature/) to now include the new unstable +branch. + +A complete example: + +```yaml +branches: + unstable: + regex: ... + is-source-branch-for: ['main', 'develop', 'feature', 'hotfix', 'support'] +``` + +Without this configuration value you would have to do: + +```yaml +branches: + unstable: + regex: + feature: + source-branches: ['unstable', 'develop', 'feature', 'hotfix', 'support'] + release: + source-branches: ['unstable', 'develop'] + etc... +``` + +### branches + +The header for all the individual branch configuration. + +### mode + +Same as for the [global configuration, explained above](#mode). + +### label + +The pre-release label to use for this branch. Use the value `{BranchName}` as a placeholder to +insert the value of the named group `BranchName` from the [regular expression](#regex). + +For example: branch `feature/foo` would become a pre-release label +of `alpha.foo` with `label: 'alpha.{BranchName}'` and `regex: '^features?[\/-](?.+)'`. + +Another example: branch `features/sc-12345/some-description` would become a pre-release label of `sc-12345` with `label: '{StoryNo}'` and `regex: '^features?[\/-](?sc-\d+)[-/].+'`. + +**Note:** To clear a default use an empty string: `label: ''` + +### increment + +Same as for the [global configuration, explained above](#increment). + +### prevent-increment-of-merged-branch + +The increment of the branch merged to will be ignored, regardless of whether the merged branch has a version number or not, when this branch related property is set to true on the target branch. + +When `release-2.0.0` is merged into main, we want main to build `2.0.0`. If +`release-2.0.0` is merged into develop we want it to build `2.1.0`, this option +prevents incrementing after a versioned branch is merged. + +In a GitFlow-based repository, setting this option can have implications on the +`CommitsSinceVersionSource` output variable. It can rule out a potentially +better version source proposed by the `MergeMessageBaseVersionStrategy`. For +more details and an in-depth analysis, please see [the discussion][2506]. + +### prevent-increment-when-branch-merged + +The increment of the merged branch will be ignored when this branch related property is set to `true` on the source branch. + +### prevent-increment-when-current-commit-tagged + +This branch related property controls the behvior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true. + +### label-number-pattern + +Pull requests require us to extract the pre-release number out of the branch +name so `refs/pull/534/merge` builds as `PullRequest534`. This is a regex with +a named capture group called `Number`. + +**Example usage:** + +```yaml +branches: + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 +``` + +### track-merge-target + +Strategy which will look for tagged merge commits directly off the current +branch. For example `develop` → `release/1.0.0` → merge into `main` and tag +`1.0.0`. The tag is _not_ on develop, but develop should be version `1.0.0` now. + +### track-merge-message + +This property is a branch related property and gives the user the possibility to control the behavior of whether the merge +commit message will be interpreted as a next version or not. Consider we have a main branch and a `release/1.0.0` branch and +merge changes from `release/1.0.0` to the `main` branch. If `track-merge-message` is set to `true` then the next version will +be `1.0.0` otherwise `0.0.1`. + +### tracks-release-branches + +Indicates this branch config represents develop in GitFlow. + +### is-release-branch + +Indicates this branch config represents a release branch in GitFlow. + +### is-main-branch + +This indicates that this branch is a main branch. By default `main` and `support/*` are main branches. + +### pre-release-weight + +Provides a way to translate the `PreReleaseLabel` ([variables][variables]) to a numeric +value in order to avoid version collisions across different branches. For +example, a release branch created after "1.2.3-alpha.55" results in +"1.2.3-beta.1" and thus e.g. "1.2.3-alpha.4" and "1.2.3-beta.4" would have the +same file version: "1.2.3.4". One of the ways to use this value is to set +`assembly-file-versioning-format: +{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}`. If the `pre-release-weight` +is set, it would be added to the `PreReleaseNumber` to get a final +`AssemblySemFileVer`, otherwise a branch specific default for +`pre-release-weight` will be used in the calculation. Related Issues [1145][1145] +and [1366][1366]. + +### semantic-version-format + +Specifies the semantic version format that is used when parsing the string. +Can be `Strict` - using the [regex](https://regex101.com/r/Ly7O1x/3/) +or `Loose` the old way of parsing. The default if not specified is `Strict` +Example of invalid `Strict`, but valid `Loose` + +```log +1.2-alpha4 +01.02.03-rc03 +1.2.3.4 +``` + +### strategies + +Specifies which version strategy implementation (one or more) will be used to determine the next version. +These strategies can be combined, and the order in which they are specified does not matter. +The configuration accepts the following values: + +* Fallback +* ConfiguredNextVersion +* MergeMessage +* TaggedCommit +* TrackReleaseBranches +* VersionInBranchName +* Mainline + +[1145]: https://github.com/GitTools/GitVersion/issues/1145 + +[1366]: https://github.com/GitTools/GitVersion/issues/1366 + +[2506]: https://github.com/GitTools/GitVersion/pull/2506#issuecomment-754754037 + +[conventional-commits-config]: /docs/reference/version-increments#conventional-commit-messages + +[conventional-commits]: https://www.conventionalcommits.org/ + +[modes]: /docs/reference/modes + +[variables]: /docs/reference/variables + +[version-sources]: /docs/reference/version-sources diff --git a/docs/input/docs/reference/modes/continuous-delivery.md b/docs/input/docs/reference/modes/continuous-delivery.md index b8d306fb42..bc93a85bc4 100644 --- a/docs/input/docs/reference/modes/continuous-delivery.md +++ b/docs/input/docs/reference/modes/continuous-delivery.md @@ -2,75 +2,41 @@ Order: 20 Title: Continuous Delivery Description: | - Continuous Delivery is the default versioning mode. In this mode, - GitVersion calculates the next version and will use that until that is - released. + Sometimes you just want the version to keep changing and deploy continuously + to an testing system. In this case, Continuous Delivery is a good mode to + operate GitVersion by. RedirectFrom: docs/reference/versioning-modes/continuous-delivery --- -Continuous Delivery is the practice of having a deployment pipeline and is the -default mode in GitVersion. Each stage of the pipeline gets the code going -through the pipeline closer to production. +Continuous Delivery is the process of checking into a branch, running all the +tests and if everything goes green it is automatically pushed to a testing system. -The topic itself is rather large, here we will just focus on the building and -creation of _releasable_ artifacts. This is only a part of continuous delivery -as a whole, with the hard part being the ability to measure the impacts of what -you have deployed into production. +A good case for Continuous Delivery is when using Octopus deploy, as you +cannot publish the same version of a package into the same feed. -In essence continuous delivery means: - -* Your code is automatically built and tested -* If any of the automated tests fail, the team's #1 priority is to fix the - build -* If the build is green, the application can be deployed at any time - * Ideally the business should make that decision - * The same artifacts which were built and tested should be deployed - * That means no rebuilding everything when you are deploying - -Continuous delivery does not work well with GitFlow. The reason is that you are -required to _merge_ to main to do a release, triggering a rebuild and a new -set of artifacts to go through your pipeline. Depending on how long your -pipeline is, this could be a while. - -GitHubFlow is a better fit for Continuous delivery, the [mainline -development][mainline] model means that every merged feature branch will be -built as a _stable_ version and if the build/builds go green then you are free -to deploy to production at any time. - -## Usage - -By default, GitVersion is set up to do Continuous Delivery on all branches but -`develop`, which is set up with [Continuous Deployment][continuous-deployment]. -To change the mode to Continuous Delivery, change your -[configuration][configuration] to: - -```yaml -mode: ContinuousDelivery -``` +For this mode we follow the logic in [this blog post by Xavier Decoster][blog] +on the issues of incrementing automatically. ## How Continuous Delivery affects GitVersion -The thing about continuous delivery is that there will be _multiple_ candidates -to deploy to production and it is a human choice to deploy. This means that -GitVersion will build **the same semantic version** until that version is -deployed. For instance: +Continuous delivery is good when you deploy continuously to a testing system. -* 1.1.0+5 -* 1.1.0+6 -* 1.1.0+7 <-- This is the artifact we release, tag the commit which created - this version -* 1.1.1+0 +* 1.1.0-3 +* 1.1.0-2 (tag: 1.1.0-2) <-- This is the version which has been deployed on testing +* 1.1.0-1 +* 1.1.0-0 -Tags are required in this mode to communicate when the release is done as it's -an external manual process. +Tags are not required but optional in this mode to communicate when the release +is done as it's an automated process. ## Resources -* [Continuous Delivery on Wikipedia][wikipedia] -* [Continuous Delivery, the book][book] +* [Configuration][configuration] +* [Semantic Versioning & auto-incremented NuGet package versions][blog] +* [Continuous delivery][wikipedia] -[book]: https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 [configuration]: /docs/reference/configuration -[continuous-deployment]: /docs/reference/modes/continuous-deployment -[mainline]: /docs/reference/modes/mainline + +[blog]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions + [wikipedia]: https://en.wikipedia.org/wiki/Continuous_delivery diff --git a/docs/input/docs/reference/modes/continuous-deployment.md b/docs/input/docs/reference/modes/continuous-deployment.md index 999256d779..b700c3732b 100644 --- a/docs/input/docs/reference/modes/continuous-deployment.md +++ b/docs/input/docs/reference/modes/continuous-deployment.md @@ -3,42 +3,33 @@ Order: 30 Title: Continuous Deployment Description: | Sometimes you just want the version to keep changing and deploy continuously. - In this case, Continuous Deployment is a good mode to operate GitVersion by. RedirectFrom: docs/reference/versioning-modes/continuous-deployment --- -Continuous Deployment is the process of checking into main, running all the -tests and if everything goes green it is automatically pushed to production. - -A good case for Continuous Deployment is when using Octopus deploy, as you -cannot publish the same version of a package into the same feed. +Continuous Deployment is the process of checking into main and automatically +deploying to production. For this mode we follow the logic in [this blog post by Xavier Decoster][blog] on the issues of incrementing automatically. -As such we force a pre-release tag on all branches, this is fine for -applications but can cause problems for libraries. As such this mode may or may -not work for you, which leads us into a new mode in v4 of GitVersion: -[Mainline Development][mainline]. +## How Continuous Deployment affects GitVersion -### Usage +The thing about continuous deployment is that there will be only one version +to deploy on production. This means that GitVersion will build +**the same semantic version** for every commit until it has been tagged. For instance: -By default GitVersion is set up to do Continuous Deployment versioning on the -`develop` branch, but for all other branches, [Continuous -Delivery][continuous-delivery] is the default mode. From version 3 of GitVersion -this behavior is [configurable][configuration]. +* 1.2.0 +* 1.1.0 (tag: 1.1.0) <-- This is the version which has been deployed on production +* 1.1.0 +* 1.1.0 -The default behavior for v3 and how v1 & 2 worked was that the version only -incremented after a tag, which signified a release. In v3 you can simply switch -the default mode in the [configuration][configuration] from `ContinuousDelivery` -to `ContinuousDeployment` and the version will then increment each commit, -giving you the features of GitVersion with continuous deployment: +Tags are required in this mode to communicate when the deployment happens on production. -```yaml -mode: ContinuousDeployment -``` +## Resources + +* [Configuration][configuration] +* [Semantic Versioning & auto-incremented NuGet package versions][blog] -[blog]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions [configuration]: /docs/reference/configuration -[continuous-delivery]: /docs/reference/modes/continuous-delivery -[mainline]: /docs/reference/modes/mainline + +[blog]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions diff --git a/docs/input/docs/reference/modes/mainline.md b/docs/input/docs/reference/modes/mainline.md deleted file mode 100644 index 3c882715a9..0000000000 --- a/docs/input/docs/reference/modes/mainline.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -Order: 40 -Title: Mainline Development -Description: | - Mainline Development versioning mode works like the Continuous Delivery, - except that it tells GitVersion to *infer* releases from merges and commits - to `main`. -RedirectFrom: docs/reference/versioning-modes/mainline-development ---- - -Mainline Development is enabled when using [GitHubFlow][githubflow] or any other -strategy where you develop on `main`. The main rule of mainline development is -that **main is always in a state that it could be deployed to production**. This -means that pull requests should not be merged until they are ready to go out. - -To properly achieve mainline development you need confidence in your test suite -as if it goes green against a PR then you are confident that you can merge and -release that pull request. Another property of mainline development is normally -that you fix going forward, not revert. When an issue is discovered with a -release, add a test or some sort of check to make sure it won't happen again, -fix the issue, then do a release with the fix. - -Like all things, it is an approach and will work for some people and not for -others. GitVersion is unique in the fact that it works very well with mainline -development and the version numbers it generates are _predictive_ and indicate -what the next version to be released is. Most other approaches require bumping -the version number before the release which means that the version being built -and the version number which will be deployed are often different. - -This mode is great if you do not want to tag each release because you simply -deploy every commit to main. The behaviour of this mode is as follows: - -1. Calculate a base version (likely a tag in this mode) -2. Walk all commits from the base version commit -3. When a merge commit is found: - * Calculate increments for each direct commit on main - * Calculate the increment for the branch -4. Calculate increments for each remaining direct commit -5. For feature branches then calculate increment for the commits so far on your - feature branch. - -If you _do not want_ GitVersion to treat a commit or a pull request as a release -and increment the version you can use `+semver: none` or `+semver: skip` in a -commit message to skip incrementing for that commit. - -Here is an example of what mainline development looks like: - -![Mainline mode][mainline-img] - -:::{.alert .alert-warning} -**Warning** - -This approach can slow down over time, we recommend to tag -intermittently (maybe for minor or major releases) because then GitVersion -will start the version calculation from that point. Much like a snapshot in an -event sourced system. We will probably add in warnings to tag when things are -slowing down. -::: - -## Usage - -By default GitVersion is set up to do [Continuous Delivery][continuous-delivery] -versioning on all branches but `develop` (which does [Continuous -Deployment][continuous-deployment] by default). To change the [versioning -mode][modes] to Mainline Development, just change the [configuration][configuration] as such: - -```yaml -mode: Mainline -``` - -[configuration]: /docs/reference/configuration -[continuous-delivery]: /docs/reference/modes/continuous-delivery -[continuous-deployment]: /docs/reference/modes/continuous-deployment -[githubflow]: /docs/learn/branching-strategies/githubflow -[mainline-img]: /docs/img/mainline-mode.png -[modes]: /docs/reference/modes diff --git a/docs/input/docs/reference/modes/manual-deployment.md b/docs/input/docs/reference/modes/manual-deployment.md new file mode 100644 index 0000000000..75e0fb9d74 --- /dev/null +++ b/docs/input/docs/reference/modes/manual-deployment.md @@ -0,0 +1,39 @@ +--- +Order: 10 +Title: Manual Deployment +Description: | + The Manual Deployment mode can be used to remain on the same pre-released + version until it has been deployed dedicatedly. +RedirectFrom: docs/reference/versioning-modes/manual-deployment +--- + +Having not the necessity to deploy the build artifacts on every commit is an +indecation of using the **Manual Deployment** mode. This mode can be used to +remain on the same pre-released version until it has been deployed dedicatedly. + +## How Manual Deployment affects GitVersion + +The thing about manual deployment is that there will be _multiple_ candidates +to deploy on testing and it is a human choice to deploy. This means that +GitVersion will build **the same semantic version** until that version is +deployed. For instance: + +* 1.1.0-2+1 +* 1.1.0-1+2 (tag: 1.1.0-1) <-- This is the version which has been deployed on testing +* 1.1.0-1+1 +* 1.1.0-1+0 + +Tags are required in this mode to communicate when the release is done as it's +an external manual process. + +## Resources + +* [Configuration][configuration] +* [Continuous Delivery on Wikipedia][wikipedia] +* [Continuous Delivery, the book][book] + +[configuration]: /docs/reference/configuration + +[book]: https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 + +[wikipedia]: https://en.wikipedia.org/wiki/Continuous_delivery diff --git a/docs/input/docs/reference/requirements.md b/docs/input/docs/reference/requirements.md index 91a2785b80..68acfb00d5 100644 --- a/docs/input/docs/reference/requirements.md +++ b/docs/input/docs/reference/requirements.md @@ -14,8 +14,9 @@ build server, needs to adhere to the below requirements. ### Unshallow -The repository needs to be an [unshallow][git-unshallow] clone. This means -that the `fetch-depth` in GitHub Actions needs to be set to `0`, for instance. +The repository should be an [unshallow][git-unshallow] clone. This means +that the `fetch-depth` in GitHub Actions should set to `0`, unless +the `allowshallow` flag is used. Check with your [build server][build-servers] to see how it can be configured appropriately. @@ -42,8 +43,10 @@ If it is ambigous which reference (branch or tag) is being built, which is often the case on build servers, the `Git_Branch` environment variable needs to be defined and set to the reference being built. -[git-switch]: https://git-scm.com/docs/git-switch [git-unshallow]: https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---unshallow + [gitflow]: /docs/learn/branching-strategies/gitflow + [build-servers]: /docs/reference/build-servers + [configuration]: /docs/reference/configuration diff --git a/docs/input/docs/reference/variables.md b/docs/input/docs/reference/variables.md index bb52759a96..158891797a 100644 --- a/docs/input/docs/reference/variables.md +++ b/docs/input/docs/reference/variables.md @@ -21,12 +21,9 @@ what is available. For the `release/3.0.0` branch of GitVersion it shows: "PreReleaseNumber": 99, "WeightedPreReleaseNumber": 1099, "BuildMetaData": 88, - "BuildMetaDataPadded": "0088", "FullBuildMetaData": "99.Branch.release/3.22.11.Sha.28c853159a46b5a87e6cc9c4f6e940c59d6bc68a", "MajorMinorPatch": "3.22.11", "SemVer": "3.22.11-beta.99", - "LegacySemVer": "3.22.11-beta99", - "LegacySemVerPadded": "3.22.11-beta0099", "AssemblySemVer": "3.22.11.0", "AssemblySemFileVer": "3.22.11.0", "InformationalVersion": "3.22.11-beta.99+88.Branch.release/3.022.011.Sha.28c853159a46b5a87e6cc9c4f6e940c59d6bc68a", @@ -35,13 +32,8 @@ what is available. For the `release/3.0.0` branch of GitVersion it shows: "EscapedBranchName": "release-3.022.011", "Sha": "28c853159a46b5a87e6cc9c4f6e940c59d6bc68a", "ShortSha": "28c8531", - "NuGetVersionV2": "3.22.11-beta0099", - "NuGetVersion": "3.22.11-beta0099", - "NuGetPreReleaseTagV2": "beta0099", - "NuGetPreReleaseTag": "beta0099", "VersionSourceSha": "28c853159a46b5a87e6cc9c4f6e940c59d6bc68a", "CommitsSinceVersionSource": 7, - "CommitsSinceVersionSourcePadded": "0007", "CommitDate": "2021-12-31", "UncommittedChanges": 0 } @@ -61,12 +53,9 @@ Each property of the above JSON document is described in the below table. | `PreReleaseNumber` | The pre-release number. | | `WeightedPreReleaseNumber` | A summation of branch specific `pre-release-weight` and the `PreReleaseNumber`. Can be used to obtain a monotonically increasing version number across the branches. | | `BuildMetaData` | The build metadata, usually representing number of commits since the `VersionSourceSha`. Despite its name, will not increment for every build. | -| `BuildMetaDataPadded` | The `BuildMetaData` padded with `0` up to 4 digits. | | `FullBuildMetaData` | The `BuildMetaData` suffixed with `BranchName` and `Sha`. | | `MajorMinorPatch` | `Major`, `Minor` and `Patch` joined together, separated by `.`. | | `SemVer` | The semantical version number, including `PreReleaseTagWithDash` for pre-release version numbers. | -| `LegacySemVer` | Equal to `SemVer`, but without a `.` separating `PreReleaseLabel` and `PreReleaseNumber`. | -| `LegacySemVerPadded` | Equal to `LegacySemVer`, but with `PreReleaseNumber` padded with `0` up to 4 digits. | | `AssemblySemVer` | Suitable for .NET `AssemblyVersion`. Defaults to `Major.Minor.0.0` to allow the assembly to be hotfixed without breaking existing applications that may be referencing it. | | `AssemblySemFileVer` | Suitable for .NET `AssemblyFileVersion`. Defaults to `Major.Minor.Patch.0`. | | `InformationalVersion` | Suitable for .NET `AssemblyInformationalVersion`. Defaults to `FullSemVer` suffixed by `FullBuildMetaData`. | @@ -75,13 +64,8 @@ Each property of the above JSON document is described in the below table. | `EscapedBranchName` | Equal to `BranchName`, but with `/` replaced with `-`. | | `Sha` | The SHA of the Git commit. | | `ShortSha` | The `Sha` limited to 7 characters. | -| `NuGetVersionV2` | A NuGet 2.0 compatible version number. | -| `NuGetVersion` | A NuGet 1.0 compatible version number. | -| `NuGetPreReleaseTagV2` | A NuGet 2.0 compatible `PreReleaseTag`. | -| `NuGetPreReleaseTag` | A NuGet 1.0 compatible `PreReleaseTag`. | | `VersionSourceSha` | The SHA of the commit used as version source. | | `CommitsSinceVersionSource` | The number of commits since the version source. | -| `CommitsSinceVersionSourcePadded` | The `CommitsSinceVersionSource` padded with `0` up to 4 digits. | | `CommitDate` | The ISO-8601 formatted date of the commit identified by `Sha`. | | `UncommittedChanges` | The number of uncommitted changes present in the repository. | @@ -90,4 +74,8 @@ within a [supported build server][build-servers]), the above version variables may be exposed automatically as **environment variables** in the format `GitVersion_FullSemVer`. +## Formatting Variables + +GitVersion variables can be formatted using C# format strings. See [Format Strings](/docs/reference/custom-formatting) for details. + [build-servers]: ./build-servers/ diff --git a/docs/input/docs/reference/version-increments.md b/docs/input/docs/reference/version-increments.md index f6e31f3cf2..3098cad889 100644 --- a/docs/input/docs/reference/version-increments.md +++ b/docs/input/docs/reference/version-increments.md @@ -83,11 +83,6 @@ If the incrementing `mode` is set to `MergeMessageOnly` you can add this information when merging a pull request. This prevents commits within a PR to bump the version number. -One thing to be aware of: If the current version is an alpha-version (i.e. -`0.x.y`.), attempting to bump the major version will merely bump the minor (eg -from `0.2.0` to `0.3.0` instead of `1.0.0`). Once the current version is greater -than `1.0.0`, bumping the major version works as expected. - #### Conventional commit messages If you want to use the [Conventional Commits][conventional-commits] standard, @@ -95,14 +90,25 @@ you can leverage this feature as follows: ```yaml mode: MainLine # Only add this if you want every version to be created automatically on your main branch. -major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)" -minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:" -patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:" +major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-,/\\\\]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)" +minor-version-bump-message: "^(feat)(\\([\\w\\s-,/\\\\]*\\))?:" +patch-version-bump-message: "^(fix|perf)(\\([\\w\\s-,/\\\\]*\\))?:" ``` This will ensure that your version gets bumped according to the commits you've created. +If your CI/CD workflow uses semantic-release's commit-analyzer, change +`(fix|perf)` to `(fix|perf|revert)`. +[Why?](https://github.com/semantic-release/commit-analyzer/blob/75c9c87c88772d7ded4ca9614852b42519e41931/lib/default-release-rules.js#L8C1-L8C38) + +Alternatively, you can override this rule in the +[configuration](https://github.com/semantic-release/commit-analyzer/tree/master#usage) +of @semantic-release/commit-analyzer. If you intend to write rules with +patterns, note that instead of using Regular Expression, +@semantic-release/commit-analyzer uses +[micromatch's glob implementation](https://github.com/micromatch/micromatch#matching-features). + ### GitVersion.yml The first is by setting the `next-version` property in the GitVersion.yml file. @@ -116,9 +122,10 @@ from the branch name as a source. However, GitVersion can't use the [branch name as a version source for _other branches_][faq-branch-name-source]. ### Detached HEAD -If HEAD is in detached state tag will be `-no-branch-`. -Example: `0.1.0--no-branch-.1+4` +If HEAD is in detached state tag will be `-no-branch-`. + +Example: `0.0.1--no-branch-.1+4` ### Tagging commit @@ -126,11 +133,16 @@ By tagging a commit, GitVersion will use that tag for the version of that commit, then increment the next commit automatically based on the increment rules for that branch (some branches bump patch, some minor). +Be aware that tags are local to a repository and will not be transferred when +you perform a default `git push`. Instead, tags can be pushed separately with +their own command. For more information, read the [git documentation on +tagging][git-tagging]. + ### Incrementing per commit -When using the continuous deployment `mode` (which will increment the SemVer every -commit) all builds _must_ have a pre-release tag, except for builds that are -explicitly tagged as stable. +When using the continuous deployment `mode` (which will increment the SemVer +every commit) all builds _must_ have a pre-release tag, except for builds that +are explicitly tagged as stable. Then the build metadata (which is the commit count) is promoted to the pre-release tag. Applying these rules, the above commit-graph would produce: @@ -148,12 +160,18 @@ b5d142 -> 2.0.0-ci.0 (2.0.0 branch was merged, so main is now at 2.0.0) As you can see, the versions now no longer conflict. When you want to create a stable `2.0.0` release you simply `git tag 2.0.0`, then build the tag, and it -will produce a stable `2.0.0` package. +will produce a stable `2.0.0` package. Be aware that +[tags are not transferred with `git push`](#tagging-commit) For more information/background on why we have come to this conclusion, read [Xavier Decoster's blog post on the subject][auto-incremented-nuget-package]. [auto-incremented-nuget-package]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions + [continuous-delivery]: /docs/reference/modes/continuous-delivery + [conventional-commits]: https://www.conventionalcommits.org/ + [faq-branch-name-source]: /docs/learn/faq#merged-branch-names-as-version-source + +[git-tagging]: https://git-scm.com/book/en/v2/Git-Basics-Tagging diff --git a/docs/input/docs/reference/version-sources.md b/docs/input/docs/reference/version-sources.md index e58b7c4beb..dcdae9f82d 100644 --- a/docs/input/docs/reference/version-sources.md +++ b/docs/input/docs/reference/version-sources.md @@ -11,13 +11,13 @@ version should be. The logic of GitVersion is something like this: -* Is the current commit tagged - * Yes: Use the tag as the version - * No: continue -* Calculate the base version (highest version from all the sources) -* Increment version if needed based on branch config -* Calculate the build metadata (everything after the +) and append to the - calculated version +* Is the current commit tagged + * Yes: Use the tag as the version + * No: continue +* Calculate the base version (highest version from all the sources) +* Increment version if needed based on branch config +* Calculate the build metadata (everything after the +) and append to the + calculated version ## Version Sources @@ -50,9 +50,9 @@ Will increment: false For the develop branch, i.e. marked with `is-develop: true` -* Returns the version number extracted from any child release-branches, i.e. - those marked with `is-release-branch: true` -* Returns the version number of any tags on the main branch +* Returns the version number extracted from any child release-branches, i.e. + those marked with `is-release-branch: true` +* Returns the version number of any tags on the main branch Will increment: true diff --git a/docs/input/docs/usage/ci.md b/docs/input/docs/usage/ci.md index 95b4106329..6affabd81b 100644 --- a/docs/input/docs/usage/ci.md +++ b/docs/input/docs/usage/ci.md @@ -32,5 +32,7 @@ GitVersion into an Azure DevOps build pipeline. The GitLab CI example [gitlab-sample][] implements GitVersion support at the pipeline level by using a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables. It is also implemented as a reusable CI/CD Extension that can be included in many different projects. [gittools-actions]: https://github.com/marketplace/actions/gittools + [gittools-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools + [gitlab-sample]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index 14d7c8f996..c8a95ddbc5 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -23,7 +23,6 @@ GitVersion [path] path The directory containing .git. If not defined current directory is used. (Must be first argument) - init Configuration utility for gitversion /version Displays the version of GitVersion /diag Runs GitVersion with additional diagnostic information (requires git.exe to be installed) @@ -31,22 +30,31 @@ GitVersion [path] /targetpath Same as 'path', but not positional /output Determines the output to the console. Can be either 'json', - 'file' or 'buildserver', will default to 'json'. + 'file', 'buildserver' or 'dotenv', will default to 'json'. /outputfile Path to output file. It is used in combination with /output 'file'. - /showvariable Used in conjuntion with /output json, will output just a + /showvariable Used in conjunction with /output json, will output just a particular variable. E.g. /output json /showvariable SemVer - will output `1.2.3+beta.4` + /format Used in conjunction with /output json, will output a format + containing version variables. + Supports C# format strings - see [Format Strings](/docs/reference/custom-formatting) for details. + E.g. /output json /format {SemVer} - will output `1.2.3+beta.4` + /output json /format {Major}.{Minor} - will output `1.2` /l Path to logfile. - /config Path to config file (defaults to GitVersion.yml) + /config Path to config file (defaults to GitVersion.yml, GitVersion.yaml, .GitVersion.yml or .GitVersion.yaml) /showconfig Outputs the effective GitVersion config (defaults + custom - from GitVersion.yml) in yaml format + from GitVersion.yml, GitVersion.yaml, .GitVersion.yml or .GitVersion.yaml) in yaml format /overrideconfig Overrides GitVersion config values inline (semicolon- separated key value pairs e.g. /overrideconfig tag-prefix=Foo) Currently supported config overrides: tag-prefix /nocache Bypasses the cache, result will not be written to the cache. /nonormalize Disables normalize step on a build server. + /allowshallow Allows GitVersion to run on a shallow clone. + This is not recommended, but can be used if you are sure + that the shallow clone contains all the information needed + to calculate the version. /verbosity Specifies the amount of information to be displayed. (Quiet, Minimal, Normal, Verbose, Diagnostic) Default is Normal @@ -58,16 +66,13 @@ GitVersion [path] the git repo and update them /updateprojectfiles Will recursively search for all project files - (.csproj/.vbproj/.fsproj) files in the git repo and update + (.csproj/.vbproj/.fsproj/.sqlproj) files in the git repo and update them Note: This is only compatible with the newer Sdk projects - /updateassemblyinfofilename - Specify name of AssemblyInfo file. Can also - /updateAssemblyInfo GlobalAssemblyInfo.cs as a shorthand /ensureassemblyinfo If the assembly info file specified with - /updateassemblyinfo or /updateassemblyinfofilename is not - found, it be created with these attributes: + /updateassemblyinfo is not + found, it will be created with these attributes: AssemblyFileVersion, AssemblyVersion and AssemblyInformationalVersion. Supports writing version info for: C#, F#, VB @@ -93,13 +98,11 @@ GitVersion [path] Use this switch to override /nofetch Disables 'git fetch' during version calculation. Might cause GitVersion to not calculate your version as expected. - -gitversion init Configuration utility for gitversion ``` ## Override config -`/overrideconfig [key=value]` will override appropriate `key` from 'GitVersion.yml'. +`/overrideconfig [key=value]` will override appropriate `key` from 'GitVersion.yml', 'GitVersion.yaml', '.GitVersion.yml' or '.GitVersion.yaml'. To specify multiple options add multiple `/overrideconfig [key=value]` entries: `/overrideconfig key1=value1 /overrideconfig key2=value2`. @@ -110,31 +113,28 @@ Double quote character inside of the double quoted `value` has to be be escaped Following options are supported: -1. `assembly-file-versioning-format` -2. `assembly-file-versioning-scheme` -3. `assembly-informational-format` -4. `assembly-versioning-format` -5. `assembly-versioning-scheme` -6. `build-metadata-padding` -7. `commit-date-format` -8. `commit-message-incrementing` -9. `commits-since-version-source-padding` -10. `continuous-delivery-fallback-tag` -11. `increment` -12. `legacy-semver-padding` -13. `major-version-bump-message` -14. `minor-version-bump-message` -15. `mode` -16. `next-version` -17. `no-bump-message` -18. `patch-version-bump-message` -19. `tag-prefix` -20. `tag-pre-release-weight` -21. `update-build-number` +1. `assembly-file-versioning-format` +2. `assembly-file-versioning-scheme` +3. `assembly-informational-format` +4. `assembly-versioning-format` +5. `assembly-versioning-scheme` +6. `commit-date-format` +7. `commit-message-incrementing` +8. `label` +9. `increment` +10. `major-version-bump-message` +11. `minor-version-bump-message` +12. `mode` +13. `next-version` +14. `no-bump-message` +15. `patch-version-bump-message` +16. `tag-prefix` +17. `tag-pre-release-weight` +18. `update-build-number` Read more about [Configuration](/docs/reference/configuration). -Using `override-config` on the command line will not change the contents of the config file `GitVersion.yml`. +Using `override-config` on the command line will not change the contents of the config file `GitVersion.yml`, `GitVersion.yaml`, `.GitVersion.yml` or `.GitVersion.yaml`. ### Example: How to override configuration option 'tag-prefix' to use prefix 'custom' diff --git a/docs/input/docs/usage/cli/assembly-patch.md b/docs/input/docs/usage/cli/assembly-patch.md index 704044e0fd..94509e65c8 100644 --- a/docs/input/docs/usage/cli/assembly-patch.md +++ b/docs/input/docs/usage/cli/assembly-patch.md @@ -10,11 +10,11 @@ Description: | `AssemblyInfo.cs` or `AssemblyInfo.vb` files in the git repo and update them. It will update the following assembly attributes: -* `AssemblyVersion` will be set to the `AssemblySemVer` variable. -* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with an - appended `.0`. -* `AssemblyInformationalVersion` will be set to the `InformationalVersion` - variable. +* `AssemblyVersion` will be set to the `AssemblySemVer` variable. +* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with an + appended `.0`. +* `AssemblyInformationalVersion` will be set to the `InformationalVersion` + variable. Note that contrary to when using the [MSBuild Task][msbuild-task] the attributes must already exist in the `AssemblyInfo.cs` or `AssemblyInfo.vb` @@ -29,11 +29,11 @@ already exist. Use the `/ensureassemblyinfo` switch alongside `/updateassemblyinfo `, if the filename specified does not exist it will be generated based on a known template that adds: -* `AssemblyVersion` will be set to the `AssemblySemVer` variable. -* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with an - appended `.0`. -* `AssemblyInformationalVersion` will be set to the `InformationalVersion` - variable. +* `AssemblyVersion` will be set to the `AssemblySemVer` variable. +* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with an + appended `.0`. +* `AssemblyInformationalVersion` will be set to the `InformationalVersion` + variable. This can be done for \*.cs, \*.vb and \*.fs files. @@ -81,4 +81,5 @@ To support integration with WiX projects, use `GitVersion.exe referenced in the WiX project files. [msbuild-task]: /docs/usage/msbuild + [variables]: /docs/reference/variables diff --git a/docs/input/docs/usage/cli/installation.md b/docs/input/docs/usage/cli/installation.md index 1ea0ac2aab..e90f53a940 100644 --- a/docs/input/docs/usage/cli/installation.md +++ b/docs/input/docs/usage/cli/installation.md @@ -13,9 +13,15 @@ GitVersion can be installed as a [.NET global tool][dotnet-tool] under the name [`GitVersion.Tool`][tool] by executing the following in a terminal: ```shell -dotnet tool install --global GitVersion.Tool --version 5.* +dotnet tool install --global GitVersion.Tool ``` +:::{.alert .alert-info} +**Hint:** To install an older version of GitVersion.Tools, use the --version flag of dotnet tool install + +Example: `dotnet tool install GitVersion.Tool --global --version 5.*` +::: + If you want to pin to a specific version of GitVersion, you can find the available versions of [`GitVersion.Tool` on NuGet](https://www.nuget.org/packages/GitVersion.Tool/). @@ -36,7 +42,7 @@ enter the following into a terminal: brew install gitversion ``` -Switches are available with `gitversion --help`. Even though the documentation +Switches are available with `gitversion -h`. Even though the documentation uses a slash `/` for all switches, you need to use a dash `-` instead, since `/` is interpreted as a root path on POSIX based operating systems. @@ -62,15 +68,15 @@ without installing any other dependencies. To use the Docker image, execute the following: ```shell -docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.6 /repo +docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-debian.12 /repo ``` The important arguments here are: | Argument | Description | -| --------------------------: | :----------------------------------------------------------------------------------------------------------- | +|----------------------------:|:-------------------------------------------------------------------------------------------------------------| | `"$(pwd):/repo"` | Maps the output of `pwd` (the working directory) to the `/repo` directory within the Docker container. | -| `gittools/gitversion:5.6.6` | The name and tag of the GitVersion container to use. | +| `gittools/gitversion:{tag}` | The name and tag of the GitVersion container to use. | | `/repo` | The directory within the Docker container GitVersion should use as its working directory. Don't change this. | :::{.alert .alert-warning} @@ -83,8 +89,13 @@ This should work on all operating systems supported by Docker (at the time of writing: Linux, macOS, Windows). [dotnet-tool]: https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-global-tool + [tool]: https://www.nuget.org/packages/GitVersion.Tool/ + [brew]: https://formulae.brew.sh/formula/gitversion + [homebrew]: https://brew.sh/ + [docker]: https://hub.docker.com/r/gittools/gitversion + [choco]: https://chocolatey.org/packages/GitVersion.Portable diff --git a/docs/input/docs/usage/cli/output.md b/docs/input/docs/usage/cli/output.md index 52a03daba1..e8cdaf051d 100644 --- a/docs/input/docs/usage/cli/output.md +++ b/docs/input/docs/usage/cli/output.md @@ -14,3 +14,24 @@ out the variables to whatever build server it is running in. You can then use those variables in your build scripts or run different tools to create versioned NuGet packages or whatever you would like to do. See [build servers](/docs/reference/build-servers) for more information about this. + +You can even store the [variables](/docs/reference/variables) in a Dotenv file +and load it to have the variables available in your environment. +For that you have to run `GitVersion.exe /output dotenv` and store the output +into e.g. a `gitversion.env` file. These files can also be passed around in CI environments +like [GitHub](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#passing-values-between-steps-and-jobs-in-a-workflow) +or [GitLab](https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job). +Below are some examples of using the Dotenv format in the Unix command line: +```bash +# Output version variables in Dotenv format +gitversion /output dotenv + +# Show only a subset of the version variables in Dotenv format +gitversion /output dotenv | grep -i "prerelease" + +# Show only a subset of the version variables that match the regex in Dotenv format +gitversion /output dotenv | grep -iE "major|sha=|_prerelease" + +# Write version variables in Dotenv format into a file +gitversion /output dotenv > gitversion.env +``` diff --git a/docs/input/docs/usage/docker.md b/docs/input/docs/usage/docker.md new file mode 100644 index 0000000000..f7d7c2cb96 --- /dev/null +++ b/docs/input/docs/usage/docker.md @@ -0,0 +1,50 @@ +--- +Order: 50 +Title: Docker +Description: | + Use GitVersion through one of its many published Docker containers. +--- + +The recommended image to run is `alpine`, as they are the smallest Docker images we provide. This will execute GitVersion for the current working directory (`$(pwd)`) on Linux and Unix or powershell on Windows: + +```sh +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag} /repo +``` + +The following command will execute GitVersion for the current working directory (`%CD%`) on Windows with CMD: + +```sh +docker run --rm -v "%CD%:/repo" gittools/gitversion:{tag} /repo +``` + +Note that the path `/repo` needs to be passed as an argument since the `gitversion` executable within the container is not aware of the fact that it's running inside a container. + +### CI Agents + +If you are running GitVersion on a CI agent, you may need to specify environment variables to allow GitVersion to work correctly. +For example, on Azure DevOps you may need to set the following environment variables: + +```sh +docker run --rm -v "$(pwd):/repo" --env TF_BUILD=true --env BUILD_SOURCEBRANCH=$(Build.SourceBranch) gittools/gitversion:{tag} /repo +``` + +On GitHub Actions, you may need to set the following environment variables: + +```sh +docker run --rm -v "$(pwd):/repo" --env GITHUB_ACTIONS=true --env GITHUB_REF=$(GITHUB_REF) gittools/gitversion:{tag} /repo +``` + +### Tags + +Most of the tags we provide have both arm64 and amd64 variants. If you need to pull a architecture specific tag you can do that like: + +```sh +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag}-amd64 /repo +docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag}-arm64 /repo +``` + +The list of available containers can be found on [Docker Hub][docker-hub]. + +[Explore GitVersion on Docker Hub][docker-hub]{.btn .btn-primary} + +[docker-hub]: https://hub.docker.com/r/gittools/gitversion diff --git a/docs/input/docs/usage/library.md b/docs/input/docs/usage/library.md index cec061ecdb..0eaeb6a481 100644 --- a/docs/input/docs/usage/library.md +++ b/docs/input/docs/usage/library.md @@ -15,9 +15,9 @@ patch releases, it's a useful option to some. :::{.alert .alert-warning} **Warning** - -We are not semantically versioning this library and it should be considered -unstable. +The library API is not stable and does not follow the semantic versioning +of the GitVersion tool. A patch release of the tool may break the library +and we will refactor and change the library API without notice. ::: Explore the GitVersion library API diff --git a/docs/input/docs/usage/msbuild.md b/docs/input/docs/usage/msbuild.md index 64e06e9b9b..5cacea82fd 100644 --- a/docs/input/docs/usage/msbuild.md +++ b/docs/input/docs/usage/msbuild.md @@ -15,12 +15,11 @@ modifying your build process. Just install with NuGet and GitVersion will automatically generate assembly version information that is compiled into the resulting artifact. -It currently works with desktop `MSBuild`. Support for CoreCLR with `dotnet build` -is coming soon. +Since version 6.0 only MSBuild running on .NET Core (`dotnet msbuild`) is supported. -> **Note**\ -> The nuget package was "_[GitVersionTask](https://www.nuget.org/packages/GitVersionTask/)_" up until version 5.5.1.\ -> From version 5.6.0 it has been called "_[GitVersion.MsBuild](https://www.nuget.org/packages/GitVersion.MsBuild/)_" +Unfortunately, up until at least Visual Studio 2022 17.11, Visual Studio runs all builds +using the .NET Framework version of MSBuild, and therefore **Visual Studio is not supported**. +For more information see [this discussion](https://github.com/GitTools/GitVersion/discussions/4130). ## TL;DR @@ -40,7 +39,7 @@ If you're using `PackageReference` style NuGet dependencies (VS 2017+), add dependency of your package: ```xml - + All ``` @@ -51,39 +50,6 @@ The next thing you need to do is to remove the `Assembly*Version` attributes fro your `Properties\AssemblyInfo.cs` files. This puts GitVersion.MsBuild in charge of versioning your assemblies. -### WPF specific concerns - -One further step needs to be taken for SDK-style WPF projects. - -Building projects with .NET Core SDK with a version lower than v5.0.200 -requires turning off automatic generation of the different versioning attributes. -GitVersion usually controls these properties but cannot during WPF specific -targets that generate a temporary project. - -```xml - - - false - false - false - -``` - -For .NET Core SDK v5.0.200 to v6.0.0-preview.1, a opt-in flag was introduced to -allow package references to be imported to the temporary project. -You can now remove the previous versioning attributes and replace them with -a single property. - -```xml - - - true - -``` - -You can remove all workarounds if you are building with .NET Core SDK -v6.0.0-preview.2 or later as the flag is now opt-out. - ### Done! The setup process is now complete and GitVersion.MsBuild should be working its magic, @@ -91,6 +57,12 @@ versioning your assemblies like a champ. However, more can be done to further customize the build process. Keep reading to find out how the version variables are set and how you can use them in MSBuild tasks. +## Configuration + +The [configuration file](/docs/reference/configuration), if any, is read from a file +the `GitVersion.yml` the root of the repository or the project directory. Since version 3, +the path to the configuration file itself [cannot be configured](https://github.com/GitTools/GitVersion/issues/3009). + ## How does it work? After being installed into a project, the MSBuild task will wire GitVersion into @@ -121,10 +93,12 @@ Default sample: Now, when you build: -* `AssemblyVersion` will be set to the `AssemblySemVer` variable. -* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with `.0` - appended to it. -* `AssemblyInformationalVersion` will be set to the `InformationalVersion` variable. +* `AssemblyVersion` will be set to the `AssemblySemVer` variable. +* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with `.0` + appended to it. +* `AssemblyInformationalVersion` will be set to the `InformationalVersion` variable. + +Assembly version formatting can use C# format strings. See [Format Strings](/docs/reference/custom-formatting) for available options. #### Other injected Variables @@ -258,14 +232,40 @@ For SDK-style projects, `UpdateVersionProperties` controls setting the default variables: `Version`, `VersionPrefix`, `VersionSuffix`, `PackageVersion`, `InformationalVersion`, `AssemblyVersion` and `FileVersion`. +## Overriding Target Framework + +If you want to override the target framework that GitVersion uses to determine the version, you can set the `GitVersionTargetFramework` property in your MSBuild script, like this: + +```xml + + ... + net8.0 + ... + +``` + +### Namespace generation + +You can configure GitVersion to generate the `GitVersionInformation` class in a namespace that matches the current assembly. By default this class is created in the global namespace. If `UseProjectNamespaceForGitVersionInformation` is set to true, the `GitVersionInfomation` class will instead be generated in a namespace matching the current project. If the property `` is set that value will be used, otherwise the name of the project file is used. + +```xml + + ... + true + ... + +``` + ## Extra properties -There are properties that correspont to certain +There are properties that correspond to certain [command line arguments](/docs/usage/cli/arguments) for GetVersion task. -In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch` -during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables +In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch` +during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables normalize step on a build server, setting `GitVersion_NoCacheEnabled` to `true` -makes GetVersion ignore cache. All the rest command line arguments can be passed via +makes GetVersion ignore cache, setting `GitVersion_AllowShallowEnabled` to `true` +does not mandate a full clone of the repository to determine the version. +All the rest command line arguments can be passed via `GitVersion_CommandLineArguments` variable. ## My Git repository requires authentication. What should I do? diff --git a/docs/input/docs/workflows/GitFlow/v1.yml b/docs/input/docs/workflows/GitFlow/v1.yml new file mode 100644 index 0000000000..dd44250ac5 --- /dev/null +++ b/docs/input/docs/workflows/GitFlow/v1.yml @@ -0,0 +1,167 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + develop: + mode: ContinuousDelivery + label: alpha + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-target: true + track-merge-message: true + regex: ^dev(elop)?(ment)?$ + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: true + is-release-branch: false + is-main-branch: false + pre-release-weight: 0 + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Minor + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-target: false + regex: ^releases?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - develop + - main + - release + - support + - hotfix + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - develop + - main + - release + - feature + - support + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + hotfix: + mode: ManualDeployment + label: beta + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + support: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + regex: ^support[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: true + regex: (?.+) + source-branches: + - main + - develop + - release + - feature + - pull-request + - hotfix + - support + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/docs/input/docs/workflows/GitHubFlow/v1.yml b/docs/input/docs/workflows/GitHubFlow/v1.yml new file mode 100644 index 0000000000..be7da3a729 --- /dev/null +++ b/docs/input/docs/workflows/GitHubFlow/v1.yml @@ -0,0 +1,116 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Patch + prevent-increment: + of-merged-branch: true + when-branch-merged: false + when-current-commit-tagged: false + track-merge-target: false + track-merge-message: true + regex: ^releases?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + - release + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: false + regex: (?.+) + source-branches: + - main + - release + - feature + - pull-request + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/docs/input/docs/workflows/TrunkBased/preview1.yml b/docs/input/docs/workflows/TrunkBased/preview1.yml new file mode 100644 index 0000000000..c261444d9f --- /dev/null +++ b/docs/input/docs/workflows/TrunkBased/preview1.yml @@ -0,0 +1,101 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- ConfiguredNextVersion +- Mainline +branches: + main: + mode: ContinuousDeployment + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + feature: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + hotfix: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - feature + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: (?.+) + source-branches: + - main + is-source-branch-for: [] + pre-release-weight: 30000 +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/docs/readme.md b/docs/readme.md index a35ed62c43..8898e0691b 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -17,32 +17,45 @@ expected. ## Serving the documentation locally -To serve up the documentation locally, you need to run the `build.ps1` script -with the arguments `-Target Preview-Documentation`. +To serve up the documentation locally, you need to run the following +commands: + +```shell +./build.ps1 -Stage build -Target BuildPrepare +./build.ps1 -Stage build -Target Build +./build.ps1 -Stage docs -Target PreviewDocs +``` ### On Windows -On Windows, you need to run the following build command in a PowerShell +On Windows, you need to run the following commands in a PowerShell terminal: ```shell -.\build.ps1 -Target Preview-Documentation +./build.ps1 -Stage build -Target BuildPrepare +./build.ps1 -Stage build -Target Build +./build.ps1 -Stage docs -Target PreviewDocs ``` ### On Unix First you need to [install PowerShell on macOS][ps-mac] or [Linux][ps-linux], -then execute the following command: +then execute the following commands: ```shell -pwsh build.ps1 -Target Preview-Documentation +./build.ps1 -Stage build -Target BuildPrepare +./build.ps1 -Stage build -Target Build +./build.ps1 -Stage docs -Target PreviewDocs ``` After pressing enter, the documentation will be generated and then served under -a local web server. Information about the URL that can be used to view the docs -will be shown in the output. Copy/paste this URL into a browser window. +a local web server. Information about the URL that can be used to view the docs +will be shown in the output. Copy/paste this URL into a browser window. [gitversion.net]: https://gitversion.net/ + [forking]: https://guides.github.com/activities/forking/ + [ps-mac]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7.1 + [ps-linux]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1 diff --git a/dotnet-tools.json b/dotnet-tools.json deleted file mode 100644 index 4c6f94aa79..0000000000 --- a/dotnet-tools.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "codecov.tool": { - "version": "1.13.0", - "commands": [ - "codecov" - ] - }, - "gitversion.tool": { - "version": "5.10.1", - "commands": [ - "dotnet-gitversion" - ] - }, - "gitreleasemanager.tool": { - "version": "0.13.0", - "commands": [ - "dotnet-gitreleasemanager" - ] - }, - "Wyam2.Tool": { - "version": "3.0.0-rc3", - "commands": [ - "wyam2" - ] - } - } -} diff --git a/global.json b/global.json new file mode 100644 index 0000000000..83a2010aca --- /dev/null +++ b/global.json @@ -0,0 +1,10 @@ +{ + "projects": [ + "build", + "new-cli", + "src" + ], + "sdk": { + "version": "9.0.306" + } +} diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 6215b58620..0000000000 --- a/mkdocs.yml +++ /dev/null @@ -1,6 +0,0 @@ -site_name: GitVersion -theme: readthedocs -repo_url: https://github.com/GitTools/GitVersion - -pages: -- Home: index.md diff --git a/new-cli/.idea/.idea.GitVersion/.idea/icon.svg b/new-cli/.idea/.idea.GitVersion/.idea/icon.svg new file mode 100644 index 0000000000..f8bfb01f26 --- /dev/null +++ b/new-cli/.idea/.idea.GitVersion/.idea/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/new-cli/.idea/.idea.GitVersion/.idea/indexLayout.xml b/new-cli/.idea/.idea.GitVersion/.idea/indexLayout.xml new file mode 100644 index 0000000000..db942041e6 --- /dev/null +++ b/new-cli/.idea/.idea.GitVersion/.idea/indexLayout.xml @@ -0,0 +1,10 @@ + + + + + docs + + + + + \ No newline at end of file diff --git a/new-cli/.run/Calculate.run.xml b/new-cli/.run/Calculate.run.xml new file mode 100644 index 0000000000..018cb7f4fc --- /dev/null +++ b/new-cli/.run/Calculate.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Config Help.run.xml b/new-cli/.run/Config Help.run.xml new file mode 100644 index 0000000000..4e0be82dd7 --- /dev/null +++ b/new-cli/.run/Config Help.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Config Init.run.xml b/new-cli/.run/Config Init.run.xml new file mode 100644 index 0000000000..f188a379c1 --- /dev/null +++ b/new-cli/.run/Config Init.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Config Show.run.xml b/new-cli/.run/Config Show.run.xml new file mode 100644 index 0000000000..72e1fdcd29 --- /dev/null +++ b/new-cli/.run/Config Show.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Help.run.xml b/new-cli/.run/Help.run.xml new file mode 100644 index 0000000000..1baa8e5ef1 --- /dev/null +++ b/new-cli/.run/Help.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Normalize.run.xml b/new-cli/.run/Normalize.run.xml new file mode 100644 index 0000000000..f77ee611de --- /dev/null +++ b/new-cli/.run/Normalize.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Output AssemblyInfo.run.xml b/new-cli/.run/Output AssemblyInfo.run.xml new file mode 100644 index 0000000000..514f75ccfe --- /dev/null +++ b/new-cli/.run/Output AssemblyInfo.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Output Help.run.xml b/new-cli/.run/Output Help.run.xml new file mode 100644 index 0000000000..eb86159ea7 --- /dev/null +++ b/new-cli/.run/Output Help.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Output Project.run.xml b/new-cli/.run/Output Project.run.xml new file mode 100644 index 0000000000..23976608fd --- /dev/null +++ b/new-cli/.run/Output Project.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Output Wix.run.xml b/new-cli/.run/Output Wix.run.xml new file mode 100644 index 0000000000..7c35b9079a --- /dev/null +++ b/new-cli/.run/Output Wix.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/TestCommand.run.xml b/new-cli/.run/TestCommand.run.xml new file mode 100644 index 0000000000..6d8c05c0fb --- /dev/null +++ b/new-cli/.run/TestCommand.run.xml @@ -0,0 +1,25 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Tester.run.xml b/new-cli/.run/Tester.run.xml new file mode 100644 index 0000000000..d59e277cea --- /dev/null +++ b/new-cli/.run/Tester.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/.run/Version.run.xml b/new-cli/.run/Version.run.xml new file mode 100644 index 0000000000..1c5607e906 --- /dev/null +++ b/new-cli/.run/Version.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/new-cli/Directory.Build.props b/new-cli/Directory.Build.props new file mode 100644 index 0000000000..986cfabbd7 --- /dev/null +++ b/new-cli/Directory.Build.props @@ -0,0 +1,40 @@ + + + net9.0 + GitVersion + + latest + enable + enable + 8625;2254;IDE0005 + + en + true + latest + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props new file mode 100644 index 0000000000..0173907d76 --- /dev/null +++ b/new-cli/Directory.Packages.props @@ -0,0 +1,37 @@ + + + true + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/new-cli/GitVersion.Calculation/CalculateCommand.cs b/new-cli/GitVersion.Calculation/CalculateCommand.cs new file mode 100644 index 0000000000..6b3dbb798a --- /dev/null +++ b/new-cli/GitVersion.Calculation/CalculateCommand.cs @@ -0,0 +1,30 @@ +using GitVersion.Extensions; +using GitVersion.Git; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +public record CalculateSettings : GitVersionSettings; + +[Command("calculate", "Calculates the version object from the git history.")] +public class CalculateCommand(ILogger logger, IService service, IGitRepository repository) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + private readonly IGitRepository _repository = repository.NotNull(); + + public Task InvokeAsync(CalculateSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + if (settings.WorkDir != null) + { + _repository.DiscoverRepository(settings.WorkDir.FullName); + var branches = _repository.Branches.ToList(); + _logger.LogInformation("Command : 'calculate', LogFile : '{logFile}', WorkDir : '{workDir}' ", + settings.LogFile, settings.WorkDir); + _logger.LogInformation("Found {count} branches", branches.Count); + } + + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Calculation/GitVersion.Calculation.csproj b/new-cli/GitVersion.Calculation/GitVersion.Calculation.csproj new file mode 100644 index 0000000000..01f48f5e20 --- /dev/null +++ b/new-cli/GitVersion.Calculation/GitVersion.Calculation.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj new file mode 100644 index 0000000000..13dd134bbf --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj @@ -0,0 +1,36 @@ + + + + GitVersion.Cli.Generator.Tests + false + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + diff --git a/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs b/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs new file mode 100644 index 0000000000..6e3775e48d --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs @@ -0,0 +1,288 @@ +using System.CommandLine; +using GitVersion.Infrastructure; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Testing; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Cli.Generator.Tests; + +public class SystemCommandlineGeneratorTests +{ + /*language=cs*/ + private const string GlobalUsingsCode = +""" +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; +"""; + + /*language=cs*/ + private const string ExpectedCommandImplText = +$$""" +{{Constants.GeneratedHeader}} +using System.CommandLine; +using System.CommandLine.Binding; + +using {{Constants.CommandNamespaceName}}; + +namespace {{Constants.GeneratedNamespaceName}}; + +public class TestCommandImpl : Command, ICommandImpl +{ + public string CommandImplName => nameof(TestCommandImpl); + public string ParentCommandImplName => string.Empty; + // Options list + protected readonly Option LogFileOption; + protected readonly Option OutputFileOption; + protected readonly Option VerbosityOption; + protected readonly Option WorkDirOption; + + public TestCommandImpl(TestCommand command) + : base("test", "Test description.") + { + LogFileOption = new Option("--log-file", "-l") + { + Required = false, + Description = "The log file", + }; + OutputFileOption = new Option("--output-file") + { + Required = true, + Description = "The output file", + }; + VerbosityOption = new Option("--verbosity") + { + Required = false, + Description = "The verbosity of the logging information", + }; + WorkDirOption = new Option("--work-dir") + { + Required = false, + Description = "The working directory with the git repository", + }; + Add(LogFileOption); + Add(OutputFileOption); + Add(VerbosityOption); + Add(WorkDirOption); + + this.SetAction(Run); + return; + + Task Run(ParseResult parseResult, CancellationToken cancellationToken) + { + var settings = new TestCommandSettings + { + LogFile = parseResult.GetValue(LogFileOption), + OutputFile = parseResult.GetValue(OutputFileOption)!, + Verbosity = parseResult.GetValue(VerbosityOption), + WorkDir = parseResult.GetValue(WorkDirOption), + }; + return command.InvokeAsync(settings, cancellationToken); + } + } +} +"""; + + /*language=cs*/ + private const string ExpectedCommandsModuleText = +$$""" +{{Constants.GeneratedHeader}} +using System.CommandLine; +using {{Constants.InfrastructureNamespaceName}}; +using {{Constants.CommandNamespaceName}}; +using {{Constants.CommonNamespaceName}}; +using Microsoft.Extensions.DependencyInjection; + +namespace {{Constants.GeneratedNamespaceName}}; + +public class CommandsModule : IGitVersionModule +{ + public IServiceCollection RegisterTypes(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); + return services; + } +} +"""; + + /*language=cs*/ + private const string ExpectedRootCommandImplText = +$$""" +{{Constants.GeneratedHeader}} +using System.CommandLine; + +using {{Constants.CommonNamespaceName}}; +using {{Constants.ExtensionsNamespaceName}}; + +namespace {{Constants.GeneratedNamespaceName}}; + +public class RootCommandImpl(IEnumerable commands) : RootCommand +{ + private readonly IEnumerable _commands = commands.NotNull(); + + public void Configure() + { + var map = _commands.ToDictionary(c => c.CommandImplName); + foreach (var command in map.Values) + { + AddCommand(command, map); + } + } + + private void AddCommand(ICommandImpl command, Dictionary map) + { + if (!string.IsNullOrWhiteSpace(command.ParentCommandImplName)) + { + var parent = map[command.ParentCommandImplName] as Command; + parent?.Add((Command)command); + } + else + { + Add((Command)command); + } + } +} +"""; + + /*language=cs*/ + private const string ExpectedCliAppImplText = +$$""" +{{Constants.GeneratedHeader}} +using System.CommandLine; +using {{Constants.ExtensionsNamespaceName}}; +using {{Constants.InfrastructureNamespaceName}}; + +namespace {{Constants.GeneratedNamespaceName}}; + +internal class CliAppImpl : ICliApp +{ + private readonly RootCommandImpl _rootCommand; + + public CliAppImpl(RootCommandImpl rootCommand) + { + _rootCommand = rootCommand.NotNull(); + _rootCommand.Configure(); + } + + public Task RunAsync(string[] args, CancellationToken cancellationToken) + { + // Note: there are 2 locations to watch for the dotnet-suggest tool + // - sentinel file: + // $env:TEMP\system-commandline-sentinel-files\ and + // - registration file: + // $env:LOCALAPPDATA\.dotnet-suggest-registration.txt or $HOME/.dotnet-suggest-registration.txt + + var parseResult = _rootCommand.Parse(args); + + var logFile = parseResult.GetValue(GitVersionSettings.LogFileOption); + var verbosity = parseResult.GetValue(GitVersionSettings.VerbosityOption) ?? Verbosity.Normal; + + LoggingEnricher.Configure(logFile?.FullName, verbosity); + + return parseResult.InvokeAsync(cancellationToken: cancellationToken); + } +} +"""; + + /*language=cs*/ + private const string TestCommandSourceCode = +$$""" +using {{Constants.InfrastructureNamespaceName}}; +using Microsoft.Extensions.Logging; + +namespace {{Constants.CommandNamespaceName}}; + +[CommandAttribute("test", "Test description.")] +public class TestCommand(ILogger logger): ICommand +{ + public Task InvokeAsync(TestCommandSettings settings, CancellationToken cancellationToken = default) + { + return Task.FromResult(0); + } +} + +"""; + + /*language=cs*/ + private const string TestCommandSettingsSourceCode = +$$""" +using {{Constants.InfrastructureNamespaceName}}; +using Microsoft.Extensions.Logging; + +namespace {{Constants.CommandNamespaceName}}; + +public record TestCommandSettings : GitVersionSettings +{ + [Option("--output-file", "The output file")] + public required string OutputFile { get; init; } +} + +"""; + + [Test] + public async Task ValidateGeneratedCommandImplementation() + { + var generatorType = typeof(SystemCommandlineGenerator); + var sourceGeneratorTest = new CSharpSourceGeneratorTest + { + TestState = + { + Sources = + { + (generatorType, "GlobalUsings.cs", GlobalUsingsCode), + (generatorType, "TestCommand.cs", TestCommandSourceCode), + (generatorType, "TestCommandSettings.cs", TestCommandSettingsSourceCode) + }, + GeneratedSources = + { + (generatorType,"TestCommandImpl.g.cs", ExpectedCommandImplText), + (generatorType,"CommandsModule.g.cs", ExpectedCommandsModuleText), + (generatorType,"RootCommandImpl.g.cs", ExpectedRootCommandImplText), + (generatorType,"CliAppImpl.g.cs", ExpectedCliAppImplText), + }, + ReferenceAssemblies = ReferenceAssemblies.Net.Net90, + AdditionalReferences = + { + MetadataReference.CreateFromFile(typeof(ILogger).Assembly.Location), + MetadataReference.CreateFromFile(typeof(IServiceCollection).Assembly.Location), + MetadataReference.CreateFromFile(typeof(RootCommand).Assembly.Location), + MetadataReference.CreateFromFile(typeof(CommandAttribute).Assembly.Location), + MetadataReference.CreateFromFile(typeof(IGitVersionModule).Assembly.Location), + MetadataReference.CreateFromFile(typeof(LoggingEnricher).Assembly.Location), + } + } + }; + + sourceGeneratorTest.SolutionTransforms.Add( + // make sure the ImplicitUsage is enabled + (solution, projectId) => + { + var project = solution.GetProject(projectId)!; + + // Enable ImplicitUsings + var parseOptions = (CSharpParseOptions)project.ParseOptions!; + var compilationOptions = (CSharpCompilationOptions)project.CompilationOptions!; + + // Enable implicit usings (same as `enable` in .csproj) + compilationOptions = compilationOptions.WithNullableContextOptions(NullableContextOptions.Enable); + + return project + .WithParseOptions(parseOptions.WithLanguageVersion(LanguageVersion.Latest)) + .WithCompilationOptions(compilationOptions) + .Solution; + }); + await sourceGeneratorTest.RunAsync(); + } +} diff --git a/new-cli/GitVersion.Cli.Generator/CommandBaseGenerator.cs b/new-cli/GitVersion.Cli.Generator/CommandBaseGenerator.cs new file mode 100644 index 0000000000..1afd040bd9 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/CommandBaseGenerator.cs @@ -0,0 +1,115 @@ +using GitVersion.Polyfill; + +namespace GitVersion; + +public abstract class CommandBaseGenerator : IIncrementalGenerator +{ + private const string CommandInterfaceFullName = $"{Constants.CommonNamespaceName}.ICommand"; + private const string CommandAttributeFullName = $"{Constants.CommonNamespaceName}.CommandAttribute"; + private const string CommandAttributeGenericFullName = $"{Constants.CommonNamespaceName}.CommandAttribute"; + private const string OptionAttributeFullName = $"{Constants.CommonNamespaceName}.OptionAttribute"; + + public void Initialize(IncrementalGeneratorInitializationContext context) + { + var commandTypes = context.CompilationProvider.Select(SelectCommandTypes); + + context.RegisterImplementationSourceOutput(commandTypes, GenerateSourceCode); + } + + internal abstract void GenerateSourceCode(SourceProductionContext context, ImmutableArray commandInfos); + + private static ImmutableArray SelectCommandTypes(Compilation compilation, CancellationToken ct) + { + ct.ThrowIfCancellationRequested(); + + var visitor = new TypeVisitor(SearchQuery, ct); + visitor.Visit(compilation.GlobalNamespace); + var selectCommandTypes = visitor.GetResults(); + + return [.. selectCommandTypes.Select(selectCommandType => MapToCommandInfo(selectCommandType, ct))]; + + static bool SearchQuery(INamedTypeSymbol typeSymbol) + { + var attributeData = typeSymbol.GetAttributeData(CommandAttributeFullName) ?? typeSymbol.GetAttributeData(CommandAttributeGenericFullName); + return attributeData is not null; + } + } + + private static CommandInfo? MapToCommandInfo(ITypeSymbol classSymbol, CancellationToken ct) + { + ct.ThrowIfCancellationRequested(); + + var commandAttribute = classSymbol.GetAttributeData(CommandAttributeFullName) ?? classSymbol.GetAttributeData(CommandAttributeGenericFullName); + if (commandAttribute is null) return null; + + var ctorArguments = commandAttribute.ConstructorArguments; + + var name = Convert.ToString(ctorArguments[0].Value); + var description = Convert.ToString(ctorArguments[1].Value); + + name.NotNull(); + description.NotNull(); + + ITypeSymbol? parentCommandType = null; + if (commandAttribute.AttributeClass?.TypeArguments.Any() == true) + { + parentCommandType = commandAttribute.AttributeClass.TypeArguments.Single(); + } + + var commandBase = classSymbol.AllInterfaces.SingleOrDefault(x => x.OriginalDefinition.ToDisplayString() == CommandInterfaceFullName); + if (commandBase is null) return null; + + var settingsType = commandBase.TypeArguments.Single(); + + var properties = settingsType.GetAllMembers().ToArray(); + + var settingsPropertyInfos = + from propertySymbol in properties + let optionAttribute = propertySymbol.GetAttributeData(OptionAttributeFullName) + where optionAttribute is not null + select MapToPropertyInfo(propertySymbol, optionAttribute); + + var commandInfo = new CommandInfo + { + ParentCommand = parentCommandType?.Name, + CommandTypeName = classSymbol.Name, + CommandTypeNamespace = classSymbol.ContainingNamespace.ToDisplayString(), + CommandName = name, + CommandDescription = description, + SettingsTypeName = settingsType.Name, + SettingsTypeNamespace = settingsType.ContainingNamespace.ToDisplayString(), + SettingsProperties = [.. settingsPropertyInfos] + }; + return commandInfo; + } + private static SettingsPropertyInfo MapToPropertyInfo(IPropertySymbol propertySymbol, AttributeData attribute) + { + var ctorArguments = attribute.ConstructorArguments; + + var name = Convert.ToString(ctorArguments[0].Value); + var description = Convert.ToString(ctorArguments[1].Value); + + name.NotNull(); + description.NotNull(); + + string[] aliases = []; + if (ctorArguments.Length == 3) + { + var aliasesArgs = ctorArguments[2]; + aliases = (aliasesArgs.Kind == TypedConstantKind.Array + ? aliasesArgs.Values.Select(x => Convert.ToString(x.Value)).ToArray() + : [Convert.ToString(aliasesArgs.Value)]); + } + + var isRequired = propertySymbol.IsRequired; + return new() + { + Name = propertySymbol.Name, + TypeName = propertySymbol.Type.ToDisplayString(), + OptionName = name, + Aliases = aliases, + Description = description, + Required = isRequired + }; + } +} diff --git a/new-cli/GitVersion.Cli.Generator/Constants.cs b/new-cli/GitVersion.Cli.Generator/Constants.cs new file mode 100644 index 0000000000..0732f0ee48 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Constants.cs @@ -0,0 +1,24 @@ +namespace GitVersion; + +public static class Constants +{ + internal const string GeneratedNamespaceName = "GitVersion.Generated"; + internal const string CommonNamespaceName = "GitVersion"; + internal const string InfrastructureNamespaceName = "GitVersion.Infrastructure"; + internal const string CommandNamespaceName = "GitVersion.Commands"; + internal const string ExtensionsNamespaceName = "GitVersion.Extensions"; + + /*language=cs*/ + internal const string GeneratedHeader = +""" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +"""; +} diff --git a/new-cli/GitVersion.Cli.Generator/GitVersion.Cli.Generator.csproj b/new-cli/GitVersion.Cli.Generator/GitVersion.Cli.Generator.csproj new file mode 100644 index 0000000000..d93d7009bb --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/GitVersion.Cli.Generator.csproj @@ -0,0 +1,22 @@ + + + + netstandard2.0 + true + true + en + true + + + + + + + + + + + + + + diff --git a/new-cli/GitVersion.Cli.Generator/GlobalUsings.cs b/new-cli/GitVersion.Cli.Generator/GlobalUsings.cs new file mode 100644 index 0000000000..8199d6a28c --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/GlobalUsings.cs @@ -0,0 +1,5 @@ +global using System.Collections.Immutable; +global using System.Diagnostics.CodeAnalysis; +global using System.Runtime.CompilerServices; +global using Microsoft.CodeAnalysis; +global using Scriban; diff --git a/new-cli/GitVersion.Cli.Generator/Models.cs b/new-cli/GitVersion.Cli.Generator/Models.cs new file mode 100644 index 0000000000..8e75c59fb9 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Models.cs @@ -0,0 +1,23 @@ +namespace GitVersion; + +internal record CommandInfo +{ + public string? ParentCommand { get; init; } + public required string CommandTypeNamespace { get; init; } + public required string CommandTypeName { get; init; } + public required string CommandName { get; init; } + public required string CommandDescription { get; init; } + public required string SettingsTypeName { get; init; } + public required string SettingsTypeNamespace { get; init; } + public required SettingsPropertyInfo[] SettingsProperties { get; init; } = []; +} + +internal record SettingsPropertyInfo +{ + public required string Name { get; init; } + public required string TypeName { get; init; } + public required string OptionName { get; init; } + public required string[] Aliases { get; init; } + public required string Description { get; init; } + public required bool Required { get; init; } +} diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/CallerArgumentExpressionAttribute.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/CallerArgumentExpressionAttribute.cs new file mode 100644 index 0000000000..a1f589114f --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/CallerArgumentExpressionAttribute.cs @@ -0,0 +1,40 @@ +// +#pragma warning disable + +#if NETFRAMEWORK || NETSTANDARD || NETCOREAPP2X + +namespace System.Runtime.CompilerServices; + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using Link = System.ComponentModel.DescriptionAttribute; + +/// +/// Indicates that a parameter captures the expression passed for another parameter as a string. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Parameter)] +[Link("https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerargumentexpressionattribute")] +#if PolyPublic +public +#endif +sealed class CallerArgumentExpressionAttribute : + Attribute +{ + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the parameter whose expression should be captured as a string. + /// + public CallerArgumentExpressionAttribute(string parameterName) => + ParameterName = parameterName; + + /// + /// Gets the name of the parameter whose expression should be captured as a string. + /// + public string ParameterName { get; } +} + +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/CommonExtensions.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/CommonExtensions.cs new file mode 100644 index 0000000000..350913fa6b --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/CommonExtensions.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Polyfill; + +public static class CommonExtensions +{ + public static T NotNull([NotNull] this T? value, [CallerArgumentExpression(nameof(value))] string name = "") + where T : class => value ?? throw new ArgumentNullException(name); +} diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/CompilerFeatureRequiredAttribute.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/CompilerFeatureRequiredAttribute.cs new file mode 100644 index 0000000000..37cf5ccc71 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/CompilerFeatureRequiredAttribute.cs @@ -0,0 +1,56 @@ +// +#pragma warning disable + +#if !NET7_0_OR_GREATER + +namespace System.Runtime.CompilerServices; + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using Link = System.ComponentModel.DescriptionAttribute; + +/// +/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + validOn: AttributeTargets.All, + AllowMultiple = true, + Inherited = false)] +[Link("https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.compilerfeaturerequiredattribute")] +#if PolyPublic +public +#endif +sealed class CompilerFeatureRequiredAttribute : + Attribute +{ + /// + /// Initialize a new instance of + /// + /// The name of the required compiler feature. + public CompilerFeatureRequiredAttribute(string featureName) => + FeatureName = featureName; + + /// + /// The name of the compiler feature. + /// + public string FeatureName { get; } + + /// + /// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand . + /// + public bool IsOptional { get; init; } + + /// + /// The used for the ref structs C# feature. + /// + public const string RefStructs = nameof(RefStructs); + + /// + /// The used for the required members C# feature. + /// + public const string RequiredMembers = nameof(RequiredMembers); +} + +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/IsExternalInit.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/IsExternalInit.cs new file mode 100644 index 0000000000..f7221c6dda --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/IsExternalInit.cs @@ -0,0 +1,21 @@ +// +#pragma warning disable + +#if !NET5_0_OR_GREATER + +namespace System.Runtime.CompilerServices; + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; + +/// +/// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +#if PolyPublic +public +#endif +static class IsExternalInit; + +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/NotNullAttribute.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/NotNullAttribute.cs new file mode 100644 index 0000000000..827063a13d --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/NotNullAttribute.cs @@ -0,0 +1,26 @@ +// +#pragma warning disable + +#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2X + +namespace System.Diagnostics.CodeAnalysis; + +using Targets = AttributeTargets; + +/// +/// Specifies that an output is not even if the +/// corresponding type allows it. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + validOn: Targets.Field | + Targets.Parameter | + Targets.Property | + Targets.ReturnValue)] +#if PolyPublic +public +#endif +sealed class NotNullAttribute : + Attribute; +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/RequiredMemberAttribute.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/RequiredMemberAttribute.cs new file mode 100644 index 0000000000..a38ca389fd --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/RequiredMemberAttribute.cs @@ -0,0 +1,29 @@ +// +#pragma warning disable + +#if !NET7_0_OR_GREATER + +namespace System.Runtime.CompilerServices; + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; + +using Targets = AttributeTargets; + +/// +/// Specifies that a type has required members or that a member is required. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + validOn: Targets.Class | + Targets.Struct | + Targets.Field | + Targets.Property, + Inherited = false)] +#if PolyPublic +public +#endif +sealed class RequiredMemberAttribute : + Attribute; +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Polyfill/SetsRequiredMembersAttribute.cs b/new-cli/GitVersion.Cli.Generator/Polyfill/SetsRequiredMembersAttribute.cs new file mode 100644 index 0000000000..a3cdfc8608 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Polyfill/SetsRequiredMembersAttribute.cs @@ -0,0 +1,20 @@ +// +#pragma warning disable + +#if !NET7_0_OR_GREATER + +namespace System.Diagnostics.CodeAnalysis; + +/// +/// Specifies that this constructor sets all required members for the current type, and callers +/// do not need to set any required members themselves. +/// +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Constructor)] +#if PolyPublic +public +#endif +sealed class SetsRequiredMembersAttribute : + Attribute; +#endif diff --git a/new-cli/GitVersion.Cli.Generator/Properties/launchSettings.json b/new-cli/GitVersion.Cli.Generator/Properties/launchSettings.json new file mode 100644 index 0000000000..5470135d61 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "SourceGenerator": { + "commandName": "DebugRoslynComponent", + "targetProject": "../GitVersion.Cli/GitVersion.Cli.csproj" + } + } +} diff --git a/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs b/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs new file mode 100644 index 0000000000..fe83125599 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs @@ -0,0 +1,31 @@ +namespace GitVersion; + +public static class RoslynExtensions +{ + private static IEnumerable GetBaseTypesAndThis(this ITypeSymbol type) + { + var current = type; + while (current != null) + { + yield return current; + current = current.BaseType; + } + } + + public static IEnumerable GetBaseTypes(this ITypeSymbol type) + { + var current = type.BaseType; + while (current != null) + { + yield return current; + current = current.BaseType; + } + } + + public static IEnumerable GetAllMembers(this ITypeSymbol type) where T : ISymbol + => type.GetBaseTypesAndThis().SelectMany(n => n.GetMembers().OfType()); + + public static AttributeData? GetAttributeData(this ISymbol namedType, string fullName) + => namedType.GetAttributes() + .SingleOrDefault(a => a.AttributeClass?.OriginalDefinition.ToDisplayString() == fullName); +} diff --git a/new-cli/GitVersion.Cli.Generator/SystemCommandlineContent.cs b/new-cli/GitVersion.Cli.Generator/SystemCommandlineContent.cs new file mode 100644 index 0000000000..ce2fa4fd75 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/SystemCommandlineContent.cs @@ -0,0 +1,166 @@ +namespace GitVersion; + +public static class SystemCommandlineContent +{ + /*language=cs*/ + public const string CommandImplContent = $$$""" +{{{Constants.GeneratedHeader}}} +using System.CommandLine; +using System.CommandLine.Binding; + +using {{Model.CommandTypeNamespace}}; + +namespace {{GeneratedNamespaceName}}; + +public class {{Model.CommandTypeName}}Impl : Command, ICommandImpl +{ + public string CommandImplName => nameof({{Model.CommandTypeName}}Impl); + {{- if (Model.ParentCommand | string.empty) }} + public string ParentCommandImplName => string.Empty; + {{- else }} + public string ParentCommandImplName => nameof({{Model.ParentCommand}}Impl); + {{ end }} + {{- $settingsProperties = Model.SettingsProperties | array.sort "Name" }} + // Options list + {{~ for $prop in $settingsProperties ~}} + protected readonly Option<{{$prop.TypeName}}> {{$prop.Name}}Option; + {{~ end ~}} + + public {{Model.CommandTypeName}}Impl({{Model.CommandTypeName}} command) + : base("{{Model.CommandName}}", "{{Model.CommandDescription}}") + { + {{~ for $prop in $settingsProperties ~}} + {{$prop.Name}}Option = new Option<{{$prop.TypeName}}>("{{$prop.OptionName}}"{{if $prop.Aliases.size == 0}}{{else}}, {{for $alias in $prop.Aliases}}"{{$alias}}"{{if !for.last}}, {{end}}{{end}}{{end}}) + { + Required = {{$prop.Required}}, + Description = "{{$prop.Description}}", + }; + {{~ end ~}} + + {{- for $prop in $settingsProperties ~}} + Add({{$prop.Name}}Option); + {{~ end ~}} + + this.SetAction(Run); + return; + + Task Run(ParseResult parseResult, CancellationToken cancellationToken) + { + var settings = new {{ if Model.SettingsTypeNamespace != Model.CommandTypeNamespace }}{{Model.SettingsTypeNamespace}}.{{ end }}{{Model.SettingsTypeName}} + { + {{~ for $prop in $settingsProperties ~}} + {{$prop.Name}} = parseResult.GetValue({{$prop.Name}}Option){{ if $prop.Required }}!{{ end}}, + {{~ end ~}} + }; + return command.InvokeAsync(settings, cancellationToken); + } + } +} +"""; + + /*language=cs*/ + public const string RootCommandImplContent = $$$""" +{{{Constants.GeneratedHeader}}} +using System.CommandLine; + +using {{CommonNamespaceName}}; +using {{ExtensionsNamespaceName}}; + +namespace {{GeneratedNamespaceName}}; + +public class RootCommandImpl(IEnumerable commands) : RootCommand +{ + private readonly IEnumerable _commands = commands.NotNull(); + + public void Configure() + { + var map = _commands.ToDictionary(c => c.CommandImplName); + foreach (var command in map.Values) + { + AddCommand(command, map); + } + } + + private void AddCommand(ICommandImpl command, Dictionary map) + { + if (!string.IsNullOrWhiteSpace(command.ParentCommandImplName)) + { + var parent = map[command.ParentCommandImplName] as Command; + parent?.Add((Command)command); + } + else + { + Add((Command)command); + } + } +} +"""; + + /*language=cs*/ + public const string CommandsModuleContent = $$$""" +{{{Constants.GeneratedHeader}}} +using System.CommandLine; +using {{InfrastructureNamespaceName}}; +using {{CommandNamespaceName}}; +using {{CommonNamespaceName}}; +using Microsoft.Extensions.DependencyInjection; + +namespace {{GeneratedNamespaceName}}; + +public class CommandsModule : IGitVersionModule +{ + public IServiceCollection RegisterTypes(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + + {{- $commands = Model | array.sort "CommandTypeName" }} + + {{~ for $command in $commands ~}} + services.AddSingleton<{{ if $command.CommandTypeNamespace != CommandNamespaceName }}{{$command.CommandTypeNamespace}}.{{ end }}{{$command.CommandTypeName}}>(); + services.AddSingleton(); + {{~ end ~}} + return services; + } +} +"""; + + /*language=cs*/ + public const string CliAppContent = $$$""" +{{{Constants.GeneratedHeader}}} +using System.CommandLine; +using {{ExtensionsNamespaceName}}; +using {{InfrastructureNamespaceName}}; + +namespace {{GeneratedNamespaceName}}; + +internal class CliAppImpl : ICliApp +{ + private readonly RootCommandImpl _rootCommand; + + public CliAppImpl(RootCommandImpl rootCommand) + { + _rootCommand = rootCommand.NotNull(); + _rootCommand.Configure(); + } + + public Task RunAsync(string[] args, CancellationToken cancellationToken) + { + // Note: there are 2 locations to watch for the dotnet-suggest tool + // - sentinel file: + // $env:TEMP\system-commandline-sentinel-files\ and + // - registration file: + // $env:LOCALAPPDATA\.dotnet-suggest-registration.txt or $HOME/.dotnet-suggest-registration.txt + + var parseResult = _rootCommand.Parse(args); + + var logFile = parseResult.GetValue(GitVersionSettings.LogFileOption); + var verbosity = parseResult.GetValue(GitVersionSettings.VerbosityOption) ?? Verbosity.Normal; + + LoggingEnricher.Configure(logFile?.FullName, verbosity); + + return parseResult.InvokeAsync(cancellationToken: cancellationToken); + } +} +"""; +} diff --git a/new-cli/GitVersion.Cli.Generator/SystemCommandlineGenerator.cs b/new-cli/GitVersion.Cli.Generator/SystemCommandlineGenerator.cs new file mode 100644 index 0000000000..6902afaf44 --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/SystemCommandlineGenerator.cs @@ -0,0 +1,54 @@ +namespace GitVersion; + +[Generator(LanguageNames.CSharp)] +public class SystemCommandlineGenerator : CommandBaseGenerator +{ + internal override void GenerateSourceCode(SourceProductionContext context, ImmutableArray commandInfos) + { + foreach (var commandInfo in commandInfos) + { + if (commandInfo == null) + continue; + + var commandHandlerTemplate = Template.Parse(SystemCommandlineContent.CommandImplContent); + + var commandHandlerSource = commandHandlerTemplate.Render(new + { + Model = commandInfo, + Constants.GeneratedNamespaceName + }, member => member.Name); + + context.AddSource($"{commandInfo.CommandTypeName}Impl.g.cs", string.Join("\n", commandHandlerSource)); + } + + var commandHandlersModuleTemplate = Template.Parse(SystemCommandlineContent.CommandsModuleContent); + var commandHandlersModuleSource = commandHandlersModuleTemplate.Render(new + { + Model = commandInfos, + Constants.GeneratedNamespaceName, + Constants.CommonNamespaceName, + Constants.InfrastructureNamespaceName, + Constants.CommandNamespaceName + }, member => member.Name); + context.AddSource("CommandsModule.g.cs", string.Join("\n", commandHandlersModuleSource)); + + var rootCommandHandlerTemplate = Template.Parse(SystemCommandlineContent.RootCommandImplContent); + var rootCommandHandlerSource = rootCommandHandlerTemplate.Render(new + { + Constants.GeneratedNamespaceName, + Constants.CommonNamespaceName, + Constants.ExtensionsNamespaceName + }, member => member.Name); + context.AddSource("RootCommandImpl.g.cs", string.Join("\n", rootCommandHandlerSource)); + + var cliAppTemplate = Template.Parse(SystemCommandlineContent.CliAppContent); + var cliAppSource = cliAppTemplate.Render(new + { + Constants.GeneratedNamespaceName, + Constants.InfrastructureNamespaceName, + Constants.CommonNamespaceName, + Constants.ExtensionsNamespaceName + }, member => member.Name); + context.AddSource("CliAppImpl.g.cs", string.Join("\n", cliAppSource)); + } +} diff --git a/new-cli/GitVersion.Cli.Generator/TypeVisitor.cs b/new-cli/GitVersion.Cli.Generator/TypeVisitor.cs new file mode 100644 index 0000000000..6507afdd7d --- /dev/null +++ b/new-cli/GitVersion.Cli.Generator/TypeVisitor.cs @@ -0,0 +1,34 @@ +namespace GitVersion; + +internal class TypeVisitor(Func searchQuery, CancellationToken cancellation) + : SymbolVisitor +{ + private readonly HashSet _exportedTypes = new(SymbolEqualityComparer.Default); + + public ImmutableArray GetResults() => [.. _exportedTypes]; + + public override void VisitAssembly(IAssemblySymbol symbol) + { + cancellation.ThrowIfCancellationRequested(); + symbol.GlobalNamespace.Accept(this); + } + + public override void VisitNamespace(INamespaceSymbol symbol) + { + foreach (var namespaceOrType in symbol.GetMembers()) + { + cancellation.ThrowIfCancellationRequested(); + namespaceOrType.Accept(this); + } + } + + public override void VisitNamedType(INamedTypeSymbol type) + { + cancellation.ThrowIfCancellationRequested(); + + if (searchQuery(type)) + { + _exportedTypes.Add(type); + } + } +} diff --git a/new-cli/GitVersion.Cli/GitVersion.Cli.csproj b/new-cli/GitVersion.Cli/GitVersion.Cli.csproj new file mode 100644 index 0000000000..cb8d1fadd6 --- /dev/null +++ b/new-cli/GitVersion.Cli/GitVersion.Cli.csproj @@ -0,0 +1,34 @@ + + + + Exe + gitversion + + + + dotnet-gitversion + GitVersion.Tool + Derives SemVer information from a repository following GitFlow or GitHubFlow. This is the .NET Core Global Tool allowing usage of GitVersion from command line. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/new-cli/GitVersion.Cli/Program.cs b/new-cli/GitVersion.Cli/Program.cs new file mode 100644 index 0000000000..2eb3756218 --- /dev/null +++ b/new-cli/GitVersion.Cli/Program.cs @@ -0,0 +1,37 @@ +using GitVersion; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +var modules = new IGitVersionModule[] +{ + new CoreModule(), + new LibGit2SharpCoreModule(), + new GitVersion.Generated.CommandsModule() +}; + +var cts = new CancellationTokenSource(); +Console.CancelKeyPress += (_, _) => +{ + cts.Cancel(); + cts.Dispose(); +}; + +await using var serviceProvider = RegisterModules(modules); +var app = serviceProvider.GetRequiredService(); + +var result = await app.RunAsync(args, cts.Token).ConfigureAwait(false); +if (!Console.IsInputRedirected) Console.ReadKey(); + +return result; + +static ServiceProvider RegisterModules(IEnumerable gitVersionModules) +{ + var serviceProvider = new ServiceCollection() + .RegisterModules(gitVersionModules) + .RegisterLogging() + .BuildServiceProvider(); + + return serviceProvider; +} diff --git a/new-cli/GitVersion.Cli/TestCommand.cs b/new-cli/GitVersion.Cli/TestCommand.cs new file mode 100644 index 0000000000..15c8452124 --- /dev/null +++ b/new-cli/GitVersion.Cli/TestCommand.cs @@ -0,0 +1,13 @@ +using GitVersion.Commands.Test.Settings; + +namespace GitVersion.Commands.Test; + +[Command("test", "Test command.")] +public class TestCommand : ICommand +{ + public Task InvokeAsync(TestCommandSettings settings, CancellationToken cancellationToken = default) + { + Console.WriteLine("Input file: {0}", settings.InputFile); + return Task.FromResult(0); + } +} diff --git a/new-cli/GitVersion.Cli/TestCommandSettings.cs b/new-cli/GitVersion.Cli/TestCommandSettings.cs new file mode 100644 index 0000000000..cd6166e187 --- /dev/null +++ b/new-cli/GitVersion.Cli/TestCommandSettings.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Commands.Test.Settings; + +public record TestCommandSettings : GitVersionSettings +{ + [Option("--input-file", description: "The input version file", aliases: ["-i"])] + public required string InputFile { get; init; } +} diff --git a/new-cli/GitVersion.Common.Command/CommandAttribute.cs b/new-cli/GitVersion.Common.Command/CommandAttribute.cs new file mode 100644 index 0000000000..e00f116ba4 --- /dev/null +++ b/new-cli/GitVersion.Common.Command/CommandAttribute.cs @@ -0,0 +1,11 @@ +namespace GitVersion; + +[AttributeUsage(AttributeTargets.Class, Inherited = false)] +public class CommandAttribute(string name, string description = "") : Attribute +{ + public string Name { get; } = name; + public string Description { get; } = description; +} + +[AttributeUsage(AttributeTargets.Class, Inherited = false)] +public class CommandAttribute(string name, string description = "") : CommandAttribute(name, description); diff --git a/new-cli/GitVersion.Common.Command/GitVersion.Common.Command.csproj b/new-cli/GitVersion.Common.Command/GitVersion.Common.Command.csproj new file mode 100644 index 0000000000..9f1b9ee5f6 --- /dev/null +++ b/new-cli/GitVersion.Common.Command/GitVersion.Common.Command.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/new-cli/GitVersion.Common.Command/GitVersionSettings.cs b/new-cli/GitVersion.Common.Command/GitVersionSettings.cs new file mode 100644 index 0000000000..254532441b --- /dev/null +++ b/new-cli/GitVersion.Common.Command/GitVersionSettings.cs @@ -0,0 +1,18 @@ +using GitVersion.Infrastructure; + +namespace GitVersion; + +public record GitVersionSettings +{ + public const string LogFileOption = "--log-file"; + public const string VerbosityOption = "--verbosity"; + + [Option(LogFileOption, "The log file", "-l")] + public FileInfo? LogFile { get; init; } + + [Option(VerbosityOption, "The verbosity of the logging information")] + public Verbosity? Verbosity { get; init; } = GitVersion.Infrastructure.Verbosity.Normal; + + [Option("--work-dir", "The working directory with the git repository")] + public DirectoryInfo? WorkDir { get; init; } = new(Environment.CurrentDirectory); +} diff --git a/new-cli/GitVersion.Common.Command/ICommand.cs b/new-cli/GitVersion.Common.Command/ICommand.cs new file mode 100644 index 0000000000..d8bcb1eebf --- /dev/null +++ b/new-cli/GitVersion.Common.Command/ICommand.cs @@ -0,0 +1,12 @@ +namespace GitVersion; + +public interface ICommand +{ + Task InvokeAsync(T settings, CancellationToken cancellationToken = default); +} + +public interface ICommandImpl +{ + string CommandImplName { get; } + string ParentCommandImplName { get; } +} diff --git a/new-cli/GitVersion.Common.Command/OptionAttribute.cs b/new-cli/GitVersion.Common.Command/OptionAttribute.cs new file mode 100644 index 0000000000..7122ccd4ad --- /dev/null +++ b/new-cli/GitVersion.Common.Command/OptionAttribute.cs @@ -0,0 +1,14 @@ +namespace GitVersion; + +[AttributeUsage(AttributeTargets.Property)] +public class OptionAttribute(string name, string description = "", params string[] aliases) : Attribute +{ + public string Name { get; } = name; + public string[] Aliases { get; } = aliases; + public string Description { get; } = description; + + public OptionAttribute(string name, string description = "") + : this(name, description, []) + { + } +} diff --git a/new-cli/GitVersion.Common/GitVersion.Common.csproj b/new-cli/GitVersion.Common/GitVersion.Common.csproj new file mode 100644 index 0000000000..065fa33110 --- /dev/null +++ b/new-cli/GitVersion.Common/GitVersion.Common.csproj @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/new-cli/GitVersion.Common/IService.cs b/new-cli/GitVersion.Common/IService.cs new file mode 100644 index 0000000000..19a00ca2d8 --- /dev/null +++ b/new-cli/GitVersion.Common/IService.cs @@ -0,0 +1,6 @@ +namespace GitVersion; + +public interface IService +{ + int Call(); +} diff --git a/new-cli/GitVersion.Common/Infrastructure/ICliApp.cs b/new-cli/GitVersion.Common/Infrastructure/ICliApp.cs new file mode 100644 index 0000000000..fc2a63aafe --- /dev/null +++ b/new-cli/GitVersion.Common/Infrastructure/ICliApp.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Infrastructure; + +public interface ICliApp +{ + Task RunAsync(string[] args, CancellationToken cancellationToken); +} diff --git a/new-cli/GitVersion.Common/Infrastructure/IGitVersionModule.cs b/new-cli/GitVersion.Common/Infrastructure/IGitVersionModule.cs new file mode 100644 index 0000000000..bbac2d24a2 --- /dev/null +++ b/new-cli/GitVersion.Common/Infrastructure/IGitVersionModule.cs @@ -0,0 +1,8 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Infrastructure; + +public interface IGitVersionModule +{ + IServiceCollection RegisterTypes(IServiceCollection services); +} diff --git a/new-cli/GitVersion.Common/Infrastructure/Verbosity.cs b/new-cli/GitVersion.Common/Infrastructure/Verbosity.cs new file mode 100644 index 0000000000..18ea6a2cfe --- /dev/null +++ b/new-cli/GitVersion.Common/Infrastructure/Verbosity.cs @@ -0,0 +1,32 @@ +namespace GitVersion.Infrastructure; + +/// +/// Represents verbosity. +/// +public enum Verbosity +{ + /// + /// Quiet verbosity. + /// + Quiet = 0, + + /// + /// Minimal verbosity. + /// + Minimal = 1, + + /// + /// Normal verbosity. + /// + Normal = 2, + + /// + /// Verbose verbosity. + /// + Verbose = 3, + + /// + /// Diagnostic verbosity. + /// + Diagnostic = 4 +} diff --git a/new-cli/GitVersion.Configuration/ConfigCommand.cs b/new-cli/GitVersion.Configuration/ConfigCommand.cs new file mode 100644 index 0000000000..7fde5361e2 --- /dev/null +++ b/new-cli/GitVersion.Configuration/ConfigCommand.cs @@ -0,0 +1,20 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +public record ConfigSettings : GitVersionSettings; + +[Command("config", "Manages the GitVersion configuration file.")] +public class ConfigCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(ConfigSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'config', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Configuration/GitVersion.Configuration.csproj b/new-cli/GitVersion.Configuration/GitVersion.Configuration.csproj new file mode 100644 index 0000000000..01f48f5e20 --- /dev/null +++ b/new-cli/GitVersion.Configuration/GitVersion.Configuration.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/new-cli/GitVersion.Configuration/Init/ConfigInitCommand.cs b/new-cli/GitVersion.Configuration/Init/ConfigInitCommand.cs new file mode 100644 index 0000000000..1a1298e3be --- /dev/null +++ b/new-cli/GitVersion.Configuration/Init/ConfigInitCommand.cs @@ -0,0 +1,20 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +public record ConfigInitSettings : ConfigSettings; + +[Command("init", "Inits the configuration for current repository.")] +public class ConfigInitCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(ConfigInitSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'config init', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Configuration/Show/ConfigShowCommand.cs b/new-cli/GitVersion.Configuration/Show/ConfigShowCommand.cs new file mode 100644 index 0000000000..6da714ca22 --- /dev/null +++ b/new-cli/GitVersion.Configuration/Show/ConfigShowCommand.cs @@ -0,0 +1,20 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +public record ConfigShowSettings : ConfigSettings; + +[Command("show", "Shows the effective configuration.")] +public class ConfigShowCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(ConfigShowSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'config show', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Core.Libgit2Sharp/Git/GitRepository.extended.cs b/new-cli/GitVersion.Core.Libgit2Sharp/Git/GitRepository.extended.cs new file mode 100644 index 0000000000..c7286ff0fb --- /dev/null +++ b/new-cli/GitVersion.Core.Libgit2Sharp/Git/GitRepository.extended.cs @@ -0,0 +1,3 @@ +namespace GitVersion.Git; + +internal sealed partial class GitRepository : IGitRepository; diff --git a/new-cli/GitVersion.Core.Libgit2Sharp/GitVersion.Core.Libgit2Sharp.csproj b/new-cli/GitVersion.Core.Libgit2Sharp/GitVersion.Core.Libgit2Sharp.csproj new file mode 100644 index 0000000000..a42d02992f --- /dev/null +++ b/new-cli/GitVersion.Core.Libgit2Sharp/GitVersion.Core.Libgit2Sharp.csproj @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/new-cli/GitVersion.Core.Libgit2Sharp/LibGit2SharpCoreModule.cs b/new-cli/GitVersion.Core.Libgit2Sharp/LibGit2SharpCoreModule.cs new file mode 100644 index 0000000000..40572492dc --- /dev/null +++ b/new-cli/GitVersion.Core.Libgit2Sharp/LibGit2SharpCoreModule.cs @@ -0,0 +1,9 @@ +using GitVersion.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Git; + +public class LibGit2SharpCoreModule : IGitVersionModule +{ + public IServiceCollection RegisterTypes(IServiceCollection services) => services.AddSingleton(); +} diff --git a/new-cli/GitVersion.Core.Libgit2Sharp/LockedFileException.cs b/new-cli/GitVersion.Core.Libgit2Sharp/LockedFileException.cs new file mode 100644 index 0000000000..3cef30a364 --- /dev/null +++ b/new-cli/GitVersion.Core.Libgit2Sharp/LockedFileException.cs @@ -0,0 +1,20 @@ +namespace GitVersion; + +public class LockedFileException : Exception +{ + public LockedFileException(Exception inner) : base(inner.Message, inner) + { + } + + public LockedFileException() + { + } + + public LockedFileException(string? message) : base(message) + { + } + + public LockedFileException(string? message, Exception? innerException) : base(message, innerException) + { + } +} diff --git a/new-cli/GitVersion.Core.Tester/GitVersion.Core.Tester.csproj b/new-cli/GitVersion.Core.Tester/GitVersion.Core.Tester.csproj new file mode 100644 index 0000000000..cf6cd1370c --- /dev/null +++ b/new-cli/GitVersion.Core.Tester/GitVersion.Core.Tester.csproj @@ -0,0 +1,13 @@ + + + + Exe + gv + + + + + + + + diff --git a/new-cli/GitVersion.Core.Tester/GitVersionApp.cs b/new-cli/GitVersion.Core.Tester/GitVersionApp.cs new file mode 100644 index 0000000000..e4696ff783 --- /dev/null +++ b/new-cli/GitVersion.Core.Tester/GitVersionApp.cs @@ -0,0 +1,17 @@ +using GitVersion.Git; +using GitVersion.Infrastructure; +using Microsoft.Extensions.Logging; + +namespace GitVersion; + +public class GitVersionApp(ILogger logger, IGitRepository repository) : ICliApp +{ + public Task RunAsync(string[] args, CancellationToken cancellationToken) + { + repository.DiscoverRepository(Directory.GetCurrentDirectory()); + var branches = repository.Branches.ToList(); + logger.LogInformation("Found {count} branches", branches.Count); + logger.LogInformation("Testing application for the GitVersion.Core without the command processing"); + return ValueTask.FromResult(0).AsTask(); + } +} diff --git a/new-cli/GitVersion.Core.Tester/Program.cs b/new-cli/GitVersion.Core.Tester/Program.cs new file mode 100644 index 0000000000..6ace9730e2 --- /dev/null +++ b/new-cli/GitVersion.Core.Tester/Program.cs @@ -0,0 +1,37 @@ +using GitVersion; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +var modules = new IGitVersionModule[] +{ + new CoreModule(), + new LibGit2SharpCoreModule(), +}; + +var cts = new CancellationTokenSource(); +Console.CancelKeyPress += (_, _) => +{ + cts.Cancel(); + cts.Dispose(); +}; + +await using var serviceProvider = RegisterModules(modules); +var app = serviceProvider.GetRequiredService(); + +var result = await app.RunAsync(args, cts.Token).ConfigureAwait(false); +if (!Console.IsInputRedirected) Console.ReadKey(); + +return result; + +static ServiceProvider RegisterModules(IEnumerable gitVersionModules) +{ + var serviceProvider = new ServiceCollection() + .RegisterModules(gitVersionModules) + .AddSingleton() + .RegisterLogging() + .BuildServiceProvider(); + + return serviceProvider; +} diff --git a/new-cli/GitVersion.Core/CoreModule.cs b/new-cli/GitVersion.Core/CoreModule.cs new file mode 100644 index 0000000000..eddf57e325 --- /dev/null +++ b/new-cli/GitVersion.Core/CoreModule.cs @@ -0,0 +1,16 @@ +using System.IO.Abstractions; +using GitVersion.Infrastructure; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion; + +public class CoreModule : IGitVersionModule +{ + public IServiceCollection RegisterTypes(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + return services; + } +} diff --git a/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs b/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000000..e7e5ac36a9 --- /dev/null +++ b/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,41 @@ +using GitVersion.Infrastructure; +using Microsoft.Extensions.DependencyInjection; +using Serilog; + +namespace GitVersion.Extensions; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection RegisterModules(this IServiceCollection services, IEnumerable gitVersionModules) + => gitVersionModules.Aggregate(services, (current, gitVersionModule) => gitVersionModule.RegisterTypes(current)); + + public static IServiceCollection RegisterLogging(this IServiceCollection services) + { + services.AddLogging(builder => + { + var logger = CreateLogger(); + builder.AddSerilog(logger, dispose: true); + }); + + return services; + } + + private static Serilog.Core.Logger CreateLogger() + { + var logger = new LoggerConfiguration() + // log level will dynamically be controlled by our log interceptor upon running + .MinimumLevel.ControlledBy(LoggingEnricher.LogLevel) + // the log enricher will add a new property with the log file path from the settings + // that we can use to set the path dynamically + .Enrich.With() + // serilog.sinks.map will defer the configuration of the sink to be on demand, + // allowing us to look at the properties set by the enricher to set the path appropriately + .WriteTo.Console() + .WriteTo.Map(LoggingEnricher.LogFilePathPropertyName, (logFilePath, sinkConfiguration) => + { + if (!string.IsNullOrEmpty(logFilePath)) sinkConfiguration.File(logFilePath); + }, 1) + .CreateLogger(); + return logger; + } +} diff --git a/new-cli/GitVersion.Core/GitVersion.Core.csproj b/new-cli/GitVersion.Core/GitVersion.Core.csproj new file mode 100644 index 0000000000..47fe040631 --- /dev/null +++ b/new-cli/GitVersion.Core/GitVersion.Core.csproj @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + Infrastructure\Environment.cs + + + diff --git a/new-cli/GitVersion.Core/Infrastructure/LoggingEnricher.cs b/new-cli/GitVersion.Core/Infrastructure/LoggingEnricher.cs new file mode 100644 index 0000000000..c20dadce14 --- /dev/null +++ b/new-cli/GitVersion.Core/Infrastructure/LoggingEnricher.cs @@ -0,0 +1,55 @@ +using Serilog.Core; +using Serilog.Events; + +namespace GitVersion.Infrastructure; + +public class LoggingEnricher : ILogEventEnricher +{ + public static readonly LoggingLevelSwitch LogLevel = new(); + private string? _cachedLogFilePath; + private LogEventProperty? _cachedLogFilePathProp; + + // this path and level will be set by the LogInterceptor.cs after parsing the settings + private static string _path = string.Empty; + + public const string LogFilePathPropertyName = "LogFilePath"; + + public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propFactory) + { + // the settings might not have a path, or we might not be within a command, in which case + // we won't have the setting, so a default value for the log file will be required + LogEventProperty logFilePathProp; + + if (_cachedLogFilePathProp != null && _path.Equals(_cachedLogFilePath)) + { + // The Path hasn't changed, so let's use the cached property + logFilePathProp = _cachedLogFilePathProp; + } + else + { + // We've got a new path for the log. Let's create a new property + // and cache it for future log events to use + _cachedLogFilePath = _path; + _cachedLogFilePathProp = logFilePathProp = propFactory.CreateProperty(LogFilePathPropertyName, _path); + } + + logEvent.AddPropertyIfAbsent(logFilePathProp); + } + + public static void Configure(string? logFile, Verbosity verbosity) + { + if (!string.IsNullOrWhiteSpace(logFile)) _path = logFile; + LogLevel.MinimumLevel = GetLevelForVerbosity(verbosity); + } + + private static LogEventLevel GetLevelForVerbosity(Verbosity verbosity) => VerbosityMaps[verbosity]; + + private static readonly Dictionary VerbosityMaps = new() + { + { Verbosity.Verbose, LogEventLevel.Verbose }, + { Verbosity.Diagnostic, LogEventLevel.Debug }, + { Verbosity.Normal, LogEventLevel.Information }, + { Verbosity.Minimal, LogEventLevel.Warning }, + { Verbosity.Quiet, LogEventLevel.Error }, + }; +} diff --git a/new-cli/GitVersion.Core/Service.cs b/new-cli/GitVersion.Core/Service.cs new file mode 100644 index 0000000000..4cbcecd974 --- /dev/null +++ b/new-cli/GitVersion.Core/Service.cs @@ -0,0 +1,6 @@ +namespace GitVersion; + +public class Service : IService +{ + public int Call() => 13; +} diff --git a/new-cli/GitVersion.Normalization/GitVersion.Normalization.csproj b/new-cli/GitVersion.Normalization/GitVersion.Normalization.csproj new file mode 100644 index 0000000000..01f48f5e20 --- /dev/null +++ b/new-cli/GitVersion.Normalization/GitVersion.Normalization.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/new-cli/GitVersion.Normalization/NormalizeCommand.cs b/new-cli/GitVersion.Normalization/NormalizeCommand.cs new file mode 100644 index 0000000000..ed38ea327b --- /dev/null +++ b/new-cli/GitVersion.Normalization/NormalizeCommand.cs @@ -0,0 +1,20 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +public record NormalizeSettings : GitVersionSettings; + +[Command("normalize", "Normalizes the git repository for GitVersion calculations.")] +public class NormalizeCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(NormalizeSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'normalize', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoCommand.cs b/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoCommand.cs new file mode 100644 index 0000000000..44c373ef46 --- /dev/null +++ b/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoCommand.cs @@ -0,0 +1,20 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +[Command("assemblyinfo", "Outputs version to assembly")] +public class OutputAssemblyInfoCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(OutputAssemblyInfoSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + var versionInfo = settings.VersionInfo.Value; + _logger.LogInformation($"Command : 'output assemblyinfo', LogFile : '{settings.LogFile}', WorkDir : '{settings.OutputDir}', InputFile: '{settings.InputFile}', AssemblyInfo: '{settings.AssemblyinfoFile}' "); + _logger.LogInformation($"Version info: {versionInfo}"); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoSettings.cs b/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoSettings.cs new file mode 100644 index 0000000000..b1bf5a1fc9 --- /dev/null +++ b/new-cli/GitVersion.Output/AssemblyInfo/OutputAssemblyInfoSettings.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Commands; + +public record OutputAssemblyInfoSettings : OutputSettings +{ + [Option("--assemblyinfo-file", "The assembly file")] + public required string AssemblyinfoFile { get; init; } +} diff --git a/new-cli/GitVersion.Output/GitVersion.Output.csproj b/new-cli/GitVersion.Output/GitVersion.Output.csproj new file mode 100644 index 0000000000..01f48f5e20 --- /dev/null +++ b/new-cli/GitVersion.Output/GitVersion.Output.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/new-cli/GitVersion.Output/OutputCommand.cs b/new-cli/GitVersion.Output/OutputCommand.cs new file mode 100644 index 0000000000..2791d211cf --- /dev/null +++ b/new-cli/GitVersion.Output/OutputCommand.cs @@ -0,0 +1,18 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +[Command("output", "Outputs the version object.")] +public class OutputCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(OutputSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'output', LogFile : '{settings.LogFile}', WorkDir : '{settings.WorkDir}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Output/OutputSettings.cs b/new-cli/GitVersion.Output/OutputSettings.cs new file mode 100644 index 0000000000..6b79fd728f --- /dev/null +++ b/new-cli/GitVersion.Output/OutputSettings.cs @@ -0,0 +1,12 @@ +namespace GitVersion.Commands; + +public record OutputSettings : GitVersionSettings +{ + public Lazy VersionInfo { get; } = new(() => Console.IsInputRedirected ? Console.ReadLine() ?? string.Empty : string.Empty); + + [Option("--input-file", "The input version file")] + public required FileInfo InputFile { get; init; } + + [Option("--output-dir", "The output directory with the git repository")] + public required DirectoryInfo OutputDir { get; init; } +} diff --git a/new-cli/GitVersion.Output/Project/OutputProjectCommand.cs b/new-cli/GitVersion.Output/Project/OutputProjectCommand.cs new file mode 100644 index 0000000000..2608bc51fb --- /dev/null +++ b/new-cli/GitVersion.Output/Project/OutputProjectCommand.cs @@ -0,0 +1,18 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +[Command("project", "Outputs version to project")] +public class OutputProjectCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(OutputProjectSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'output project', LogFile : '{settings.LogFile}', WorkDir : '{settings.OutputDir}', InputFile: '{settings.InputFile}', Project: '{settings.ProjectFile}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Output/Project/OutputProjectSettings.cs b/new-cli/GitVersion.Output/Project/OutputProjectSettings.cs new file mode 100644 index 0000000000..ec096cd7a7 --- /dev/null +++ b/new-cli/GitVersion.Output/Project/OutputProjectSettings.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Commands; + +public record OutputProjectSettings : OutputSettings +{ + [Option("--project-file", "The project file")] + public required string ProjectFile { get; init; } +} diff --git a/new-cli/GitVersion.Output/Wix/OutputWixCommand.cs b/new-cli/GitVersion.Output/Wix/OutputWixCommand.cs new file mode 100644 index 0000000000..abe89f7e9e --- /dev/null +++ b/new-cli/GitVersion.Output/Wix/OutputWixCommand.cs @@ -0,0 +1,18 @@ +using GitVersion.Extensions; +using Microsoft.Extensions.Logging; + +namespace GitVersion.Commands; + +[Command("wix", "Outputs version to wix file")] +public class OutputWixCommand(ILogger logger, IService service) : ICommand +{ + private readonly ILogger _logger = logger.NotNull(); + private readonly IService _service = service.NotNull(); + + public Task InvokeAsync(OutputWixSettings settings, CancellationToken cancellationToken = default) + { + var value = _service.Call(); + _logger.LogInformation($"Command : 'output wix', LogFile : '{settings.LogFile}', WorkDir : '{settings.OutputDir}', InputFile: '{settings.InputFile}', WixFile: '{settings.WixFile}' "); + return Task.FromResult(value); + } +} diff --git a/new-cli/GitVersion.Output/Wix/OutputWixSettings.cs b/new-cli/GitVersion.Output/Wix/OutputWixSettings.cs new file mode 100644 index 0000000000..745f44759d --- /dev/null +++ b/new-cli/GitVersion.Output/Wix/OutputWixSettings.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Commands; + +public record OutputWixSettings : OutputSettings +{ + [Option("--wix-file", "The wix file")] + public required string WixFile { get; init; } +} diff --git a/new-cli/GitVersion.sln.DotSettings b/new-cli/GitVersion.sln.DotSettings new file mode 100644 index 0000000000..ca580a27b8 --- /dev/null +++ b/new-cli/GitVersion.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/new-cli/GitVersion.slnx b/new-cli/GitVersion.slnx new file mode 100644 index 0000000000..5fad617683 --- /dev/null +++ b/new-cli/GitVersion.slnx @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/new-cli/command.md b/new-cli/command.md new file mode 100644 index 0000000000..c137381b07 --- /dev/null +++ b/new-cli/command.md @@ -0,0 +1,72 @@ +```sh +# Write version to stdout +gitversion --version + +# Write help to stdout +gitversion --help + +# Normalize the repository to its required state: +gitversion normalize + +# Normalize the repository inside `./project/` to its required state: +gitversion normalize --work-dir ./project/ + +# Initialize GitVersion.yml +gitversion config init + +# Write the effective GitVersion configuration (defaults + custom from GitVersion.yml) in yaml format to stdout +gitversion config show + +# Calculate the version number and output to stdout. Only the JSON with the version variables will go to stdout, errors and warnings will be logged to stderr +gitversion calculate + +# Calculate the version number and write it gitversion.json +gitversion calculate > gitversion.json + +# Calculate the version number and output to stdout. Include logging information depending on the verbosity level in the logging to stderr. +gitversion calculate --verbosity verbose + +# Calculate the version number and output to stdout. Include diagnostics info in the logging to stderr (requires `git` executable on PATH). +gitversion [diag] calculate + +# Calculate the version number and log to the file `/var/logs/gitversion.log` +gitversion calculate --logfile /var/logs/gitversion.log + +# Calculate the version number based on the configuration file `/etc/gitversion.yml` +gitversion calculate --configfile /etc/gitversion.yml + +# Calculate the version and override the `tag-prefix` configuration. +gitversion calculate --override-config tag-prefix=foo + +# Calculate the version with caching disabled. +gitversion calculate --no-cache + +# Read version variables from stdin and write to globbed AssemblyInfo.cs files +cat gitversion.json | gitversion output assemblyinfo --path ./**/AssemblyInfo.cs + +# Read version variables from stdin and write to globbed .csproj files +cat gitversion.json | gitversion output projectfiles --path ./**/*.csproj + +# Read version variables from stdin and write to an auto-detected build server. Without an `--in` argument, stdin is the default input. +cat gitversion.json | gitversion output buildserver + +# Read version variables from stdin and write to Jenkins. +cat gitversion.json | gitversion output buildserver --buildserver Jenkins + +# Read version variables from stdin and write to globbed .wxi files. +cat gitversion.json | gitversion output wix --path ./**/*.wxi + +# Read version variables from stdin and output them to environment variables +cat gitversion.json | gitversion output environment + +# Read version variables from stdin and output them to environment variables +cat gitversion.json | gitversion output environment --property FullSemVer + +# Read version variables from stdin and output only the `FullSemVer` property to stdout. +cat gitversion.json | gitversion output --property FullSemVer + +# Pipe the output of calculate to gitversion output +gitversion calculate | gitversion output assemblyinfo --path ./**/AssemblyInfo.cs + +#NOTES [diag] can be used only with calculate command +``` diff --git a/new-cli/docs/calculate.rsp b/new-cli/docs/calculate.rsp new file mode 100644 index 0000000000..a8a006be0c --- /dev/null +++ b/new-cli/docs/calculate.rsp @@ -0,0 +1 @@ +calculate -l ./logs/log.txt --work-dir . --verbosity verbose diff --git a/new-cli/docs/config-help.rsp b/new-cli/docs/config-help.rsp new file mode 100644 index 0000000000..e3f8dfac56 --- /dev/null +++ b/new-cli/docs/config-help.rsp @@ -0,0 +1 @@ +config --help diff --git a/new-cli/docs/config-init.rsp b/new-cli/docs/config-init.rsp new file mode 100644 index 0000000000..3219c72c12 --- /dev/null +++ b/new-cli/docs/config-init.rsp @@ -0,0 +1 @@ +config init diff --git a/new-cli/docs/config-show.rsp b/new-cli/docs/config-show.rsp new file mode 100644 index 0000000000..3971d07a4b --- /dev/null +++ b/new-cli/docs/config-show.rsp @@ -0,0 +1 @@ +config show diff --git a/new-cli/docs/help.rsp b/new-cli/docs/help.rsp new file mode 100644 index 0000000000..2255a80a73 --- /dev/null +++ b/new-cli/docs/help.rsp @@ -0,0 +1 @@ +--help diff --git a/new-cli/docs/normalize.rsp b/new-cli/docs/normalize.rsp new file mode 100644 index 0000000000..f9a8b6aa16 --- /dev/null +++ b/new-cli/docs/normalize.rsp @@ -0,0 +1 @@ +normalize diff --git a/new-cli/docs/output-assemblyinfo.rsp b/new-cli/docs/output-assemblyinfo.rsp new file mode 100644 index 0000000000..d632da45c7 --- /dev/null +++ b/new-cli/docs/output-assemblyinfo.rsp @@ -0,0 +1 @@ +output assemblyinfo --input-file version.json --assemblyinfo-file assembly.cs diff --git a/new-cli/docs/output-help.rsp b/new-cli/docs/output-help.rsp new file mode 100644 index 0000000000..c0cbbfae24 --- /dev/null +++ b/new-cli/docs/output-help.rsp @@ -0,0 +1 @@ +output --help diff --git a/new-cli/docs/output-project.rsp b/new-cli/docs/output-project.rsp new file mode 100644 index 0000000000..734d7e3736 --- /dev/null +++ b/new-cli/docs/output-project.rsp @@ -0,0 +1 @@ +output --output-dir ./output --input-file version.json project --project-file project.csproj diff --git a/new-cli/docs/output-wix.rsp b/new-cli/docs/output-wix.rsp new file mode 100644 index 0000000000..91992af5b6 --- /dev/null +++ b/new-cli/docs/output-wix.rsp @@ -0,0 +1 @@ +output --output-dir ./output --input-file version.json wix --wix-file project.wix diff --git a/new-cli/docs/version.rsp b/new-cli/docs/version.rsp new file mode 100644 index 0000000000..32776d21bd --- /dev/null +++ b/new-cli/docs/version.rsp @@ -0,0 +1 @@ +--version diff --git a/package-lock.json b/package-lock.json index ece3dcb744..b2349ae19b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,105 +7,175 @@ "name": "gitversion", "license": "MIT", "devDependencies": { - "remark": "^14.0.2", - "remark-cli": "^10.0.1", - "remark-frontmatter": "^4.0.1", - "remark-heading-gap": "^5.0.1", - "remark-lint": "^9.1.1", - "remark-lint-blockquote-indentation": "^3.1.1", - "remark-lint-checkbox-character-style": "^4.1.1", - "remark-lint-checkbox-content-indent": "^4.1.1", + "remark": "^15.0.1", + "remark-cli": "^12.0.1", + "remark-frontmatter": "^5.0.0", + "remark-heading-gap": "^6.0.0", + "remark-lint": "^10.0.1", + "remark-lint-blockquote-indentation": "^4.0.1", + "remark-lint-checkbox-character-style": "^5.0.1", + "remark-lint-checkbox-content-indent": "^5.0.1", "remark-lint-code": "^2.0.0", - "remark-lint-code-block-style": "^3.1.0", - "remark-lint-definition-case": "^3.1.1", - "remark-lint-definition-spacing": "^3.1.1", - "remark-lint-fenced-code-flag": "^3.1.1", - "remark-lint-fenced-code-marker": "^3.1.1", - "remark-lint-file-extension": "^2.1.1", - "remark-lint-final-definition": "^3.1.1", - "remark-lint-final-newline": "^2.1.1", - "remark-lint-hard-break-spaces": "^3.1.1", - "remark-lint-heading-increment": "^3.1.1", - "remark-lint-heading-style": "^3.1.1", + "remark-lint-code-block-style": "^4.0.1", + "remark-lint-definition-case": "^4.0.1", + "remark-lint-definition-spacing": "^4.0.1", + "remark-lint-fenced-code-flag": "^4.2.0", + "remark-lint-fenced-code-marker": "^4.0.1", + "remark-lint-file-extension": "^3.0.1", + "remark-lint-final-definition": "^4.0.2", + "remark-lint-final-newline": "^3.0.1", + "remark-lint-hard-break-spaces": "^4.1.1", + "remark-lint-heading-increment": "^4.0.1", + "remark-lint-heading-style": "^4.0.1", "remark-lint-heading-whitespace": "^1.0.0", - "remark-lint-link-title-style": "^3.1.1", - "remark-lint-list-item-bullet-indent": "^4.1.1", - "remark-lint-list-item-content-indent": "^3.1.1", - "remark-lint-list-item-indent": "^3.1.1", - "remark-lint-maximum-heading-length": "^3.1.1", - "remark-lint-no-auto-link-without-protocol": "^3.1.1", - "remark-lint-no-blockquote-without-marker": "^5.1.1", - "remark-lint-no-consecutive-blank-lines": "^4.1.2", - "remark-lint-no-dead-urls": "^1.1.0", - "remark-lint-no-duplicate-definitions": "^3.1.1", - "remark-lint-no-duplicate-headings": "^3.1.1", - "remark-lint-no-emphasis-as-heading": "^3.1.1", + "remark-lint-link-title-style": "^4.0.1", + "remark-lint-list-item-bullet-indent": "^5.0.1", + "remark-lint-list-item-content-indent": "^4.0.1", + "remark-lint-list-item-indent": "^4.0.1", + "remark-lint-maximum-heading-length": "^4.1.1", + "remark-lint-no-blockquote-without-marker": "^6.0.1", + "remark-lint-no-consecutive-blank-lines": "^5.0.1", + "remark-lint-no-dead-urls": "^2.0.1", + "remark-lint-no-duplicate-definitions": "^4.0.1", + "remark-lint-no-duplicate-headings": "^4.0.1", + "remark-lint-no-emphasis-as-heading": "^4.0.1", "remark-lint-no-empty-sections": "^4.0.0", - "remark-lint-no-empty-url": "^3.1.1", - "remark-lint-no-file-name-articles": "^2.1.1", - "remark-lint-no-file-name-consecutive-dashes": "^2.1.1", - "remark-lint-no-file-name-irregular-characters": "^2.1.1", - "remark-lint-no-file-name-mixed-case": "^2.1.1", - "remark-lint-no-file-name-outer-dashes": "^2.1.1", - "remark-lint-no-heading-content-indent": "^4.1.1", - "remark-lint-no-heading-indent": "^4.1.1", - "remark-lint-no-heading-like-paragraph": "^3.1.1", - "remark-lint-no-inline-padding": "^4.1.1", - "remark-lint-no-literal-urls": "^3.1.1", - "remark-lint-no-multiple-toplevel-headings": "^3.1.1", - "remark-lint-no-reference-like-url": "^3.1.1", + "remark-lint-no-empty-url": "^4.0.1", + "remark-lint-no-file-name-articles": "^3.0.1", + "remark-lint-no-file-name-consecutive-dashes": "^3.0.1", + "remark-lint-no-file-name-irregular-characters": "^3.0.1", + "remark-lint-no-file-name-mixed-case": "^3.0.1", + "remark-lint-no-file-name-outer-dashes": "^3.0.1", + "remark-lint-no-heading-content-indent": "^5.0.1", + "remark-lint-no-heading-indent": "^5.0.1", + "remark-lint-no-heading-like-paragraph": "^4.0.1", + "remark-lint-no-literal-urls": "^4.0.1", + "remark-lint-no-multiple-toplevel-headings": "^4.0.1", + "remark-lint-no-reference-like-url": "^4.0.1", "remark-lint-no-repeat-punctuation": "^0.1.4", - "remark-lint-no-shell-dollars": "^3.1.1", - "remark-lint-no-shortcut-reference-image": "^3.1.1", - "remark-lint-no-table-indentation": "^4.1.1", - "remark-lint-no-tabs": "^3.1.1", - "remark-lint-no-unused-definitions": "^3.1.1", - "remark-lint-ordered-list-marker-style": "^3.1.1", - "remark-lint-ordered-list-marker-value": "^3.1.1", - "remark-lint-rule-style": "^3.1.1", - "remark-lint-strong-marker": "^3.1.1", - "remark-lint-table-cell-padding": "^4.1.2", - "remark-lint-table-pipe-alignment": "^3.1.1", - "remark-lint-table-pipes": "^4.1.1", - "remark-lint-unordered-list-marker-style": "^3.1.1", + "remark-lint-no-shell-dollars": "^4.0.1", + "remark-lint-no-shortcut-reference-image": "^4.0.1", + "remark-lint-no-table-indentation": "^5.0.1", + "remark-lint-no-tabs": "^4.0.1", + "remark-lint-no-unused-definitions": "^4.0.2", + "remark-lint-ordered-list-marker-style": "^4.0.1", + "remark-lint-ordered-list-marker-value": "^4.0.1", + "remark-lint-rule-style": "^4.0.1", + "remark-lint-strong-marker": "^4.0.1", + "remark-lint-table-cell-padding": "^5.1.1", + "remark-lint-table-pipe-alignment": "^4.1.1", + "remark-lint-table-pipes": "^5.0.1", + "remark-lint-unordered-list-marker-style": "^4.0.1", "remark-lint-write-good": "^1.2.0", - "remark-preset-lint-consistent": "^5.1.1", - "remark-preset-lint-markdown-style-guide": "^5.1.2", - "remark-preset-lint-recommended": "^6.1.2", - "remark-retext": "^5.0.1", - "remark-textr": "^5.0.1", - "remark-validate-links": "^11.0.2" + "remark-preset-lint-consistent": "^6.0.1", + "remark-preset-lint-markdown-style-guide": "^6.0.1", + "remark-preset-lint-recommended": "^7.0.1", + "remark-retext": "^6.0.1", + "remark-textr": "^6.1.0", + "remark-validate-links": "^13.1.0" } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -150,13 +220,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -165,7 +235,7 @@ "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -263,37 +333,176 @@ "dev": true, "peer": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "dev": true + }, + "node_modules/@npmcli/config": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.1.0.tgz", + "integrity": "sha512-cPQmIQ2Q0vuOfrenrA3isikdMFMAHgzlXV+EmvZ8f2JeJsU5xTU2bG7ipXECiMvPF9nM+QDnMLuIg8QLw9H4xg==", + "dev": true, + "dependencies": { + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", + "mkdirp-infer-owner": "^2.0.0", + "nopt": "^5.0.0", + "proc-log": "^2.0.0", + "read-package-json-fast": "^2.0.3", + "semver": "^7.3.5", + "walk-up-path": "^1.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/map-workspaces": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz", - "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.3.tgz", + "integrity": "sha512-X6suAun5QyupNM8iHkNPh0AHdRC2rb1W+MTdMvvA/2ixgmqZwlq5cGUBgmKHUHT2LgrkKJMAXbfAoTxOigpK8Q==", + "dev": true, + "dependencies": { + "@npmcli/name-from-folder": "^1.0.1", + "glob": "^8.0.1", + "minimatch": "^5.0.1", + "read-package-json-fast": "^2.0.3" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/name-from-folder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", + "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", "dev": true }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", "dev": true, "dependencies": { - "defer-to-connect": "^1.0.1" + "defer-to-connect": "^2.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + } + }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" } }, "node_modules/@types/concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==", "dev": true, "dependencies": { "@types/node": "*" @@ -309,32 +518,47 @@ } }, "node_modules/@types/estree": { - "version": "0.0.50", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", - "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/estree-jsx": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-0.0.1.tgz", - "integrity": "sha512-gcLAYiMfQklDCPjQegGn0TBAn9it05ISEsEhlKQUddIk7o2XDokOcTN7HBO8tznM0D9dGezvHEfRZBfZf6me0A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", "dev": true, "dependencies": { "@types/estree": "*" } }, + "node_modules/@types/hast": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.1.tgz", + "integrity": "sha512-hs/iBJx2aydugBQx5ETV3ZgeSS0oIreQrFJ4bjBl0XvM4wAmDjFEALY7p0rTSLt2eL+ibjRAAs9dTPiCLtmbqQ==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/hosted-git-info": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hosted-git-info/-/hosted-git-info-3.0.5.tgz", + "integrity": "sha512-Dmngh7U003cOHPhKGyA7LWqrnvcTyILNgNPmNCxlx7j8MIi54iBliiT8XqVLIQ3GchoOjVAyBzNJVyuaJjqokg==", + "dev": true + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "dev": true + }, "node_modules/@types/is-empty": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@types/is-empty/-/is-empty-1.2.1.tgz", "integrity": "sha512-a3xgqnFTuNJDm1fjsTjHocYJ40Cz3t8utYpi5GNaxzrJC2HSD08ym+whIL7fNqiqBCdM9bcqD1H/tORWAFXoZw==", "dev": true }, - "node_modules/@types/js-yaml": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.5.tgz", - "integrity": "sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==", - "dev": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -342,13 +566,13 @@ "dev": true, "peer": true }, - "node_modules/@types/mdast": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", - "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==", + "node_modules/@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", "dev": true, "dependencies": { - "@types/unist": "*" + "@types/node": "*" } }, "node_modules/@types/ms": { @@ -358,20 +582,29 @@ "dev": true }, "node_modules/@types/nlcst": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.0.tgz", - "integrity": "sha512-3TGCfOcy8R8mMQ4CNSNOe3PG66HttvjcLzCoOpvXvDtfWOTi+uT/rxeOKm/qEwbM4SNe1O/PjdiBK2YcTjU4OQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.1.tgz", + "integrity": "sha512-+hL97wfmdLW/unulVgdR+e+8PXbbtZgoYOq3C12H3RKgAZZ38D55Jwej7JBttJ6+oFuwIRYy5qTbE/WugMsCxw==", "dev": true, "dependencies": { "@types/unist": "*" } }, "node_modules/@types/node": { - "version": "17.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz", - "integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==", + "version": "20.8.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", + "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==", "dev": true }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.1.tgz", @@ -379,9 +612,9 @@ "dev": true }, "node_modules/@types/text-table": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@types/text-table/-/text-table-0.2.2.tgz", - "integrity": "sha512-dGoI5Af7To0R2XE8wJuc6vwlavWARsCh3UKJPjWs1YEqGUqfgBI/j/4GX0yf19/DsDPPf0YAXWAp8psNeIehLg==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@types/text-table/-/text-table-0.2.3.tgz", + "integrity": "sha512-MUW7DN7e178wJ2dB9rHuhwUWRUJGrl8fCng37BEWV0r2r5VpzkRFRiMfnX6sjXlu4tMn41lrjzsVh/z1XrKc+A==", "dev": true }, "node_modules/@types/unist": { @@ -390,6 +623,18 @@ "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", "dev": true }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "node_modules/acorn": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", @@ -424,16 +669,19 @@ } }, "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ajv": { @@ -491,9 +739,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -507,7 +755,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "peer": true }, "node_modules/aria-query": { "version": "4.2.2", @@ -543,6 +792,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/array.prototype.flat": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", @@ -619,6 +878,16 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -628,23 +897,30 @@ "node": ">=8" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -657,52 +933,37 @@ "dev": true }, "node_modules/builtins": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-4.0.0.tgz", - "integrity": "sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", "dev": true, "dependencies": { "semver": "^7.0.0" } }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true, + "engines": { + "node": ">=10.6.0" + } + }, "node_modules/cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", + "keyv": "^4.0.0", "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, "engines": { "node": ">=8" } @@ -731,16 +992,14 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "dev": true, - "engines": { - "node": ">=10" - }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/chalk": { @@ -748,6 +1007,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -769,26 +1029,47 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/check-links": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/check-links/-/check-links-1.1.8.tgz", - "integrity": "sha512-lxt1EeQ1CVkmiZzPfbPufperYK0t7MvhdLs3zlRH9areA6NVT1tcGymAdJONolNWQBdCFU/sek59RpeLmVHCnw==", + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "dev": true, - "dependencies": { - "got": "^9.6.0", - "is-relative-url": "^2.0.0", - "p-map": "^2.0.0", - "p-memoize": "^2.1.0" - }, - "engines": { - "node": ">=8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -805,22 +1086,67 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "dev": true, + "dependencies": { + "is-regexp": "^3.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", "dev": true, "dependencies": { "mimic-response": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/co": { @@ -829,6 +1155,16 @@ "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=", "dev": true }, + "node_modules/collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -847,6 +1183,16 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -857,7 +1203,8 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "peer": true }, "node_modules/concat-stream": { "version": "2.0.0", @@ -874,6 +1221,18 @@ "typedarray": "^0.0.6" } }, + "node_modules/convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/core-js-pure": { "version": "3.20.2", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.2.tgz", @@ -891,7 +1250,6 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -901,6 +1259,22 @@ "node": ">= 8" } }, + "node_modules/css-selector-parser": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.5.tgz", + "integrity": "sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ] + }, "node_modules/damerau-levenshtein": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", @@ -908,6 +1282,89 @@ "dev": true, "peer": true }, + "node_modules/dead-or-alive": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dead-or-alive/-/dead-or-alive-1.0.3.tgz", + "integrity": "sha512-LJ2tGXmux1dx6FcuhwKcbHJPiR2OKiPWBY/6Yj6EfFdObK3nue69DlGFr1cUeRmtalqRhWXMztXMcEXJP59XKw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "fast-content-type-parse": "^2.0.0", + "hast-util-from-html-isomorphic": "^2.0.0", + "hast-util-is-element": "^3.0.0", + "hast-util-select": "^6.0.0", + "html-url-attributes": "^3.0.0", + "levenshtein-edit-distance": "^3.0.0", + "undici": "^6.0.0", + "unist-util-visit": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dead-or-alive/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/dead-or-alive/node_modules/levenshtein-edit-distance": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/levenshtein-edit-distance/-/levenshtein-edit-distance-3.0.1.tgz", + "integrity": "sha512-/qMCkZbrAF7jZP/voqlkfNrBtEn0TMdhCK7OEBh/zb39t/c3wCnTjwU1ZvrMfQ3OxB8sBQXIpWRMM6FiQJVG3g==", + "dev": true, + "bin": { + "levenshtein-edit-distance": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dead-or-alive/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/dead-or-alive/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/dead-or-alive/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", @@ -939,15 +1396,30 @@ } }, "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, "dependencies": { - "mimic-response": "^1.0.0" + "mimic-response": "^3.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/deep-is": { @@ -958,10 +1430,13 @@ "peer": true }, "node_modules/defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } }, "node_modules/define-properties": { "version": "1.1.3", @@ -985,19 +1460,36 @@ "node": ">=6" } }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, - "engines": { - "node": ">=0.3.1" + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/direction": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", + "dev": true, + "bin": { + "direction": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/dns-packet": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.3.1.tgz", - "integrity": "sha512-spBwIj0TK0Ey3666GwIdWVfUpLyubpU53BTCu8iPn4r4oXd9O14Hjg3EHw3ts2oed77/SeckunUYCyRlSngqHw==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -1031,12 +1523,6 @@ "node": ">=6.0.0" } }, - "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, "node_modules/e-prime": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/e-prime/-/e-prime-0.10.4.tgz", @@ -1077,6 +1563,18 @@ "node": ">=8.6" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1471,10 +1969,11 @@ } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "peer": true, "bin": { "semver": "bin/semver.js" @@ -1646,6 +2145,12 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, + "node_modules/fast-content-type-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.0.tgz", + "integrity": "sha512-fCqg/6Sps8tqk8p+kqyKqYfOF0VjPNYrqpLiqNl0RBKmD80B080AJWVV6EkSkscjToNExcXg1+Mfzftrx6+iSA==", + "dev": true + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1680,12 +2185,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -1700,9 +2199,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -1711,18 +2210,6 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -1744,6 +2231,22 @@ "dev": true, "peer": true }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/format": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", @@ -1760,9 +2263,9 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -1780,6 +2283,18 @@ "dev": true, "peer": true }, + "node_modules/function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -1803,15 +2318,18 @@ } }, "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "dependencies": { "pump": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-symbol-description": { @@ -1832,9 +2350,9 @@ } }, "node_modules/github-slugger": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", - "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", "dev": true }, "node_modules/glob": { @@ -1842,6 +2360,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1899,25 +2418,28 @@ } }, "node_modules/got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" }, "engines": { - "node": ">=8.6" + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, "node_modules/has": { @@ -1948,6 +2470,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -1981,24 +2504,350 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "node_modules/hast-util-from-dom": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.0.tgz", + "integrity": "sha512-d6235voAp/XR3Hh5uy7aGLbM3S4KamdW0WEgOaU1YoewnuYw4HXb5eRtv9g65m/RFGEfUY1Mw4UqCc5Y8L4Stg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "@types/hast": "^3.0.0", + "hastscript": "^8.0.0", + "web-namespaces": "^2.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", + "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html-isomorphic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz", + "integrity": "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-from-dom": "^5.0.0", + "hast-util-from-html": "^2.0.0", + "unist-util-remove-position": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/hast-util-from-html/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", + "property-information": "^6.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/hast-util-from-parse5/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-has-property": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz", + "integrity": "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-element": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz", + "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-select": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.2.tgz", + "integrity": "sha512-hT/SD/d/Meu+iobvgkffo1QecV8WeKWxwsNMzcTJsKw1cKTQKSR/7ArJeURLNJF9HDjp9nVoORyNNJxrvBye8Q==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "bcp-47-match": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "css-selector-parser": "^3.0.0", + "devlop": "^1.0.0", + "direction": "^2.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "not": "^0.1.0", + "nth-check": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-select/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/hast-util-select/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-string": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz", + "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" } }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -2026,12 +2875,12 @@ } }, "node_modules/import-meta-resolve": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz", - "integrity": "sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.0.3.tgz", + "integrity": "sha512-fpAppnBpZ3ymQ/dPP97TNsco1HB5+V9SYJ3chY50PP8xn4U/w+Y6ovWBmTImB/prmGsTjzPh8pQYY+EVBlr9mw==", "dev": true, "dependencies": { - "builtins": "^4.0.0" + "builtins": "^5.0.0" }, "funding": { "type": "github", @@ -2049,14 +2898,23 @@ } }, "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2074,10 +2932,13 @@ "dev": true }, "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.0.tgz", + "integrity": "sha512-TxYQaeNW/N8ymDvwAxPyRbhMBtnEwuvaTYpOQkFx1nSeusgezHniEc/l35Vo4iCq/mMiTJbpD7oYxN98hFlfmw==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/internal-slot": { "version": "1.0.3", @@ -2095,27 +2956,45 @@ } }, "node_modules/ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dev": true, + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { @@ -2160,29 +3039,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, "node_modules/is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -2225,6 +3081,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-empty": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-empty/-/is-empty-1.2.0.tgz", @@ -2240,10 +3106,19 @@ "node": ">=0.10.0" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -2252,16 +3127,30 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-ip": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", - "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.1.tgz", + "integrity": "sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==", "dev": true, "dependencies": { - "ip-regex": "^4.0.0" + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" }, "engines": { - "node": ">=8" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-negative-zero": { @@ -2303,18 +3192,18 @@ } }, "node_modules/is-online": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/is-online/-/is-online-8.5.1.tgz", - "integrity": "sha512-RKyTQx/rJqw2QOXHwy7TmXdlkpe0Hhj7GBsr6TQJaj4ebNOfameZCMspU5vYbwBBzJ2brWArdSvNVox6T6oCTQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/is-online/-/is-online-11.0.0.tgz", + "integrity": "sha512-LY3UOlRGCofw5RMhsEFHQ9xQ6jJXL9wFWWIfmSdNo8vO+DrIvan3G9hAPZiMRXddVZS2v9+CV4z9PslLhBGIyA==", "dev": true, "dependencies": { - "got": "^9.6.0", - "p-any": "^2.0.0", - "p-timeout": "^3.0.0", - "public-ip": "^4.0.1" + "got": "^13.0.0", + "p-any": "^4.0.0", + "p-timeout": "^6.1.2", + "public-ip": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2349,16 +3238,16 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-relative-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-relative-url/-/is-relative-url-2.0.0.tgz", - "integrity": "sha1-cpAtf+BLPUeS59sV+duEtyBMnO8=", + "node_modules/is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==", "dev": true, - "dependencies": { - "is-absolute-url": "^2.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-shared-array-buffer": { @@ -2420,8 +3309,25 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dev": true, - "peer": true + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } }, "node_modules/js-tokens": { "version": "4.0.0", @@ -2434,6 +3340,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -2442,9 +3349,9 @@ } }, "node_modules/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, "node_modules/json-parse-even-better-errors": { @@ -2468,13 +3375,10 @@ "peer": true }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -2497,21 +3401,12 @@ } }, "node_modules/keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { - "json-buffer": "3.0.0" - } - }, - "node_modules/kleur": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", - "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", - "dev": true, - "engines": { - "node": ">=6" + "json-buffer": "3.0.1" } }, "node_modules/language-subtag-registry": { @@ -2554,17 +3449,6 @@ "node": ">= 0.8.0" } }, - "node_modules/libnpmconfig": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", - "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", - "dev": true, - "dependencies": { - "figgy-pudding": "^3.5.1", - "find-up": "^3.0.0", - "ini": "^1.3.5" - } - }, "node_modules/lines-and-columns": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", @@ -2575,32 +3459,19 @@ } }, "node_modules/load-plugin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-4.0.1.tgz", - "integrity": "sha512-4kMi+mOSn/TR51pDo4tgxROHfBHXsrcyEYSGHcJ1o6TtRaP2PsRM5EwmYbj1uiLDvbfA/ohwuSWZJzqGiai8Dw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-5.0.0.tgz", + "integrity": "sha512-jTz8tvC0BTMtof27lTSV5SAOnCRT0Z++k+S3QeQ5CrF8ZAS5L2nhi3euf4ZhJyDkds+nOQGyPcFqdQZ9s8ELkg==", "dev": true, "dependencies": { - "import-meta-resolve": "^1.0.0", - "libnpmconfig": "^1.0.0" + "@npmcli/config": "^4.0.0", + "import-meta-resolve": "^2.0.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2632,349 +3503,608 @@ } }, "node_modules/lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "node_modules/mdast-comment-marker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-3.0.0.tgz", + "integrity": "sha512-bt08sLmTNg00/UtVDiqZKocxqvQqqyQZAg1uaRuO/4ysXV5motg7RolF5o5yy/sY1rG0v2XgZEqFWho1+2UquA==", "dev": true, "dependencies": { - "p-defer": "^1.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-mdx-expression": "^2.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-comment-marker": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.1.0.tgz", - "integrity": "sha512-/+Cfm8A83PjkqjQDB9iYqHESGuXlriCWAwRGPJjkYmxXrF4r6saxeUlOKNrf+SogTwg9E8uyHRCFHLG6/BAAdA==", + "node_modules/mdast-comment-marker/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-directive": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz", + "integrity": "sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q==", "dev": true, "dependencies": { - "mdast-util-mdx-expression": "^1.1.0" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-directive/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-directive/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, "node_modules/mdast-util-from-markdown": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", - "integrity": "sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-frontmatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-1.0.0.tgz", - "integrity": "sha512-7itKvp0arEVNpCktOET/eLFAYaZ+0cNjVtFtIPxgQ5tV+3i+D4SDDTjTzPWl44LT59PC+xdx+glNTawBdF98Mw==", + "node_modules/mdast-util-from-markdown/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-from-markdown/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/mdast-util-from-markdown/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, "dependencies": { - "micromark-extension-frontmatter": "^1.0.0" + "@types/mdast": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-heading-style": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-2.0.0.tgz", - "integrity": "sha512-q9+WW2hJduW51LgV2r/fcU5wIt2GLFf0yYHxyi0f2aaxnC63ErBSOAJlhP6nbQ6yeG5rTCozbwOi4QNDPKV0zw==", + "node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-mdx-expression": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.1.1.tgz", - "integrity": "sha512-RDLRkBFmBKCJl6/fQdxxKL2BqNtoPFoNBmQAlj5ZNKOijIWRKjdhPkeufsUOaexLj+78mhJc+L7d1MYka8/LdQ==", + "node_modules/mdast-util-frontmatter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", + "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", "dev": true, "dependencies": { - "@types/estree-jsx": "^0.0.1" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "escape-string-regexp": "^5.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-extension-frontmatter": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-to-markdown": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.2.6.tgz", - "integrity": "sha512-doJZmTEGagHypWvJ8ltinmwUsT9ZaNgNIQW6Gl7jNdsI1QZkTHTimYW561Niy2s8AEPAqEgV0dIh2UOVlSXUJA==", + "node_modules/mdast-util-frontmatter/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "longest-streak": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "micromark-util-decode-string": "^1.0.0", - "unist-util-visit": "^4.0.0", - "zwitch": "^2.0.0" + "@types/unist": "*" + } + }, + "node_modules/mdast-util-frontmatter/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mdast-util-to-nlcst": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-nlcst/-/mdast-util-to-nlcst-5.2.1.tgz", - "integrity": "sha512-Xznpj85MsJnLQjBboajOovT2fAAvbbbmYutpFgzLi9pjZEOkgGzjq+t6fHcge8uzZ5uEkj5pigzw2QrnIVq/kw==", + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/nlcst": "^1.0.0", - "@types/unist": "^2.0.0", - "nlcst-to-string": "^3.0.0", - "unist-util-position": "^4.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-to-nlcst/node_modules/nlcst-to-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.0.tgz", - "integrity": "sha512-Y8HQWKw/zrHTCnu2zcFBN1dV6vN0NUG7s5fkEj380G8tF3R+vA2KG+tDl2QoHVQCTHGHVXwoni2RQkDSFQb1PA==", + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz", + "integrity": "sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==", "dev": true, "dependencies": { - "@types/nlcst": "^1.0.0" + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-to-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", - "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==", + "node_modules/mdast-util-mdx-expression/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.2.tgz", + "integrity": "sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA==", + "dev": true, + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-remove-position": "^5.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "node_modules/mdast-util-mdx-jsx/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "engines": { - "node": ">=6" + "@types/unist": "*" } }, - "node_modules/mem/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } + "node_modules/mdast-util-mdx-jsx/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true }, - "node_modules/micromark": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.0.10.tgz", - "integrity": "sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg==", + "node_modules/mdast-util-mdx-jsx/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromark-core-commonmark": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz", - "integrity": "sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==", + "node_modules/mdast-util-mdx-jsx/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromark-extension-frontmatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-1.0.0.tgz", - "integrity": "sha512-EXjmRnupoX6yYuUJSQhrQ9ggK0iQtQlpi6xeJzVD5xscyAI+giqco5fdymayZhJMbIFecjnE2yz85S9NzIgQpg==", + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", "dev": true, "dependencies": { - "fault": "^2.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/micromark-factory-destination": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", - "integrity": "sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw==", + "node_modules/mdast-util-mdxjs-esm/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "@types/unist": "*" } }, - "node_modules/micromark-factory-label": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz", - "integrity": "sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==", + "node_modules/mdast-util-phrasing": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz", + "integrity": "sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromark-factory-space": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz", - "integrity": "sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew==", + "node_modules/mdast-util-phrasing/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" + "@types/unist": "*" } }, - "node_modules/micromark-factory-title": { + "node_modules/mdast-util-phrasing/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/mdast-util-to-hast": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-to-hast/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/mdast-util-to-hast/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-to-markdown/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-to-markdown/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-nlcst/-/mdast-util-to-nlcst-7.0.0.tgz", + "integrity": "sha512-YfWgABD6izaK7Tzx37V4268THKeusHU+S2qet98h9vrffMxwd/2jqFKxNYz9cCAPYA8p/5BXQuF313JuVFDC9A==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^3.0.0", + "unist-util-position": "^5.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/mdast-util-to-nlcst/node_modules/nlcst-to-string": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", + "dev": true, + "dependencies": { + "@types/nlcst": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/nlcst-to-string/node_modules/@types/nlcst": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz", - "integrity": "sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.2.tgz", + "integrity": "sha512-ykxL/GDDUhqikjU0LIywZvEwb1NTYXTEWf+XgMSS2o6IXIakafPccxZmxgZcvJPZ3yFl2kdL1gJZz3U3iZF3QA==", + "dev": true, + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/nlcst-to-string/node_modules/@types/unist": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", + "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "dev": true + }, + "node_modules/mdast-util-to-nlcst/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-nlcst/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", "dev": true, "funding": [ { @@ -2987,17 +4117,29 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-factory-whitespace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz", - "integrity": "sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==", + "node_modules/micromark-core-commonmark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", "dev": true, "funding": [ { @@ -3010,16 +4152,44 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.1.0.tgz", - "integrity": "sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==", + "node_modules/micromark-extension-frontmatter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", + "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", + "dev": true, + "dependencies": { + "fault": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", "dev": true, "funding": [ { @@ -3032,14 +4202,15 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-chunked": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz", - "integrity": "sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==", + "node_modules/micromark-factory-label": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", "dev": true, "funding": [ { @@ -3052,13 +4223,16 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-classify-character": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz", - "integrity": "sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==", + "node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", "dev": true, "funding": [ { @@ -3071,15 +4245,14 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-combine-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz", - "integrity": "sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==", + "node_modules/micromark-factory-title": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", "dev": true, "funding": [ { @@ -3092,14 +4265,16 @@ } ], "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz", - "integrity": "sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==", + "node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", "dev": true, "funding": [ { @@ -3112,13 +4287,16 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-decode-string": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz", - "integrity": "sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==", + "node_modules/micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "dev": true, "funding": [ { @@ -3131,16 +4309,14 @@ } ], "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-encode": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz", - "integrity": "sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==", + "node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", "dev": true, "funding": [ { @@ -3151,12 +4327,15 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } }, - "node_modules/micromark-util-html-tag-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.0.0.tgz", - "integrity": "sha512-NenEKIshW2ZI/ERv9HtFNsrn3llSPZtY337LID/24WeLqMzeZhBEE6BQ0vS2ZBjshm5n40chKtJ3qjAbVV8S0g==", + "node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", "dev": true, "funding": [ { @@ -3167,12 +4346,17 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, - "node_modules/micromark-util-normalize-identifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz", - "integrity": "sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==", + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", "dev": true, "funding": [ { @@ -3185,13 +4369,14 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/micromark-util-resolve-all": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz", - "integrity": "sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==", + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", "dev": true, "funding": [ { @@ -3204,13 +4389,13 @@ } ], "dependencies": { - "micromark-util-types": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-util-sanitize-uri": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz", - "integrity": "sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg==", + "node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", "dev": true, "funding": [ { @@ -3223,15 +4408,16 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/micromark-util-subtokenize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz", - "integrity": "sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==", + "node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", "dev": true, "funding": [ { @@ -3242,18 +4428,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } + ] }, - "node_modules/micromark-util-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz", - "integrity": "sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==", + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", "dev": true, "funding": [ { @@ -3266,10 +4446,10 @@ } ] }, - "node_modules/micromark-util-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.0.2.tgz", - "integrity": "sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==", + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", "dev": true, "funding": [ { @@ -3280,17 +4460,105 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ] - }, - "node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", "dev": true, - "engines": { - "node": ">=4" + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, + "node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -3301,10 +4569,12 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3318,13 +4588,39 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-infer-owner": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz", + "integrity": "sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "infer-owner": "^1.0.4", + "mkdirp": "^1.0.3" + }, + "engines": { + "node": ">=10" } }, "node_modules/ms": { @@ -3366,6 +4662,21 @@ "eslint-plugin-react-hooks": "^4.0.0" } }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3376,12 +4687,39 @@ } }, "node_modules/normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/not": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/not/-/not-0.1.0.tgz", + "integrity": "sha512-5PDmaAsVfnWUgTUbJ3ERwn7u79Z0dYxN9ErxCpVJJqe2RK0PJ3z+iFUxuqjwtlDDegXvtWoxD/3Fzxox7tFGWA==", + "dev": true + }, + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" } }, "node_modules/object-assign": { @@ -3524,155 +4862,117 @@ "node": ">= 0.8.0" } }, - "node_modules/p-any": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-any/-/p-any-2.1.0.tgz", - "integrity": "sha512-JAERcaMBLYKMq+voYw36+x5Dgh47+/o7yuv2oQYuSSUml4YeqJEFznBrY2UeEkoSHqBua6hz518n/PsowTYLLg==", + "node_modules/p-all": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-all/-/p-all-5.0.0.tgz", + "integrity": "sha512-pofqu/1FhCVa+78xNAptCGc9V45exFz2pvBRyIvgXkNM0Rh18Py7j8pQuSjA+zpabI46v9hRjNWmL9EAFcEbpw==", "dev": true, "dependencies": { - "p-cancelable": "^2.0.0", - "p-some": "^4.0.0", - "type-fest": "^0.3.0" + "p-map": "^6.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/p-any/node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "node_modules/p-any": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-any/-/p-any-4.0.0.tgz", + "integrity": "sha512-S/B50s+pAVe0wmEZHmBs/9yJXeZ5KhHzOsgKzt0hRdgkoR3DxW9ts46fcsWi/r3VnzsnkKS7q4uimze+zjdryw==", "dev": true, + "dependencies": { + "p-cancelable": "^3.0.0", + "p-some": "^6.0.0" + }, "engines": { - "node": ">=4" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "node_modules/p-any/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=12.20" } }, - "node_modules/p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz", + "integrity": "sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^1.1.1" }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", "dev": true, "engines": { - "node": ">=6" - } - }, - "node_modules/p-memoize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-memoize/-/p-memoize-2.1.0.tgz", - "integrity": "sha512-c6+a2iV4JyX0r4+i2IBJYO0r6LZAT2fg/tcB6GQbv1uzZsfsmKT7Ej5DRT1G6Wi7XUJSV2ZiP9+YEtluvhCmkg==", - "dev": true, - "dependencies": { - "mem": "^4.0.0", - "mimic-fn": "^1.0.0" + "node": ">=16" }, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-some": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-some/-/p-some-4.1.0.tgz", - "integrity": "sha512-MF/HIbq6GeBqTrTIl5OJubzkGU+qfFhAFi0gnTAK6rgEIJIknEiABHOTtQu4e6JiXjIwuMPMUFQzyHh5QjCl1g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-some/-/p-some-6.0.0.tgz", + "integrity": "sha512-CJbQCKdfSX3fIh8/QKgS+9rjm7OBNUTmwWswAFQAhc8j1NR1dsEDETUEuVUtQHZpV+J03LqWBEwvu0g1Yn+TYg==", "dev": true, "dependencies": { - "aggregate-error": "^3.0.0", - "p-cancelable": "^2.0.0" + "aggregate-error": "^4.0.0", + "p-cancelable": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-some/node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12.20" } }, "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "dev": true, - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parent-module": { @@ -3688,54 +4988,188 @@ "node": ">=6" } }, + "node_modules/parse-entities": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", + "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/parse-json": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-6.0.2.tgz", - "integrity": "sha512-SA5aMiaIjXkAiBrW/yPgLgQAQg42f7K3ACO+2l/zOvtQBwX58DMUsFJXelW2fx3yMBmWOVkR6j1MGsdSbCA4UA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.0.tgz", + "integrity": "sha512-ihtdrgbqdONYD156Ap6qTcaGcGdkdAxodO1wLqQ/j7HP1u2sFYppINiq4jyC8F+Nm+4fVufylCV00QmkTHkSUg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.0", + "@babel/code-frame": "^7.21.4", "error-ex": "^1.3.2", - "json-parse-even-better-errors": "^2.3.1", - "lines-and-columns": "^2.0.2" + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/passive-voice": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/passive-voice/-/passive-voice-0.1.0.tgz", - "integrity": "sha1-Fv+RrkC6DpLEPmcXY/3IQqcCcLE=", - "dev": true - }, - "node_modules/path-exists": { + "node_modules/parse-json/node_modules/json-parse-even-better-errors": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", "dev": true, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "node_modules/parse-json/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-key": { - "version": "3.1.1", + "node_modules/parse-latin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz", + "integrity": "sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==", + "dev": true, + "dependencies": { + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-modify-children": "^4.0.0", + "unist-util-visit-children": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-latin/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/parse-latin/node_modules/nlcst-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz", + "integrity": "sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA==", + "dev": true, + "dependencies": { + "@types/nlcst": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/parse-latin/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/parse-latin/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/parse-latin/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/passive-voice": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/passive-voice/-/passive-voice-0.1.0.tgz", + "integrity": "sha1-Fv+RrkC6DpLEPmcXY/3IQqcCcLE=", + "dev": true + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -3747,6 +5181,31 @@ "dev": true, "peer": true }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -3778,13 +5237,13 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "node_modules/proc-log": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", "dev": true, "engines": { - "node": ">=4" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/progress": { @@ -3809,6 +5268,16 @@ "react-is": "^16.13.1" } }, + "node_modules/property-information": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/propose": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/propose/-/propose-0.0.5.tgz", @@ -3819,26 +5288,26 @@ } }, "node_modules/public-ip": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/public-ip/-/public-ip-4.0.4.tgz", - "integrity": "sha512-EJ0VMV2vF6Cu7BIPo3IMW1Maq6ME+fbR0NcPmqDfpfNGIRPue1X8QrGjrg/rfjDkOsIkKHIf2S5FlEa48hFMTA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/public-ip/-/public-ip-7.0.1.tgz", + "integrity": "sha512-DdNcqcIbI0wEeCBcqX+bmZpUCvrDMJHXE553zgyG1MZ8S1a/iCCxmK9iTjjql+SpHSv4cZkmRv5/zGYW93AlCw==", "dev": true, "dependencies": { "dns-socket": "^4.2.2", - "got": "^9.6.0", - "is-ip": "^3.1.0" + "got": "^13.0.0", + "is-ip": "^5.0.1" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "dependencies": { "end-of-stream": "^1.1.0", @@ -3855,6 +5324,28 @@ "node": ">=6" } }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/quotation": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/quotation/-/quotation-2.0.3.tgz", + "integrity": "sha512-yEc24TEgCFLXx7D4JHJJkK4JFVtatO8fziwUxY4nB/Jbea9o9CVS3gt22mA0W7rPYAGW2fWzYDSOtD94PwOyqA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -3862,6 +5353,19 @@ "dev": true, "peer": true }, + "node_modules/read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -3926,15 +5430,15 @@ } }, "node_modules/remark": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/remark/-/remark-14.0.2.tgz", - "integrity": "sha512-A3ARm2V4BgiRXaUo5K0dRvJ1lbogrbXnhkJRmD0yw092/Yl0kOCZt1k9ZeElEwkZsWGsMumz6qL5MfNJH9nOBA==", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/remark/-/remark-15.0.1.tgz", + "integrity": "sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "remark-parse": "^10.0.0", - "remark-stringify": "^10.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", @@ -3942,13 +5446,15 @@ } }, "node_modules/remark-cli": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-10.0.1.tgz", - "integrity": "sha512-+eln31zLE69JwBMoa8nd2sPC0DFZyiWgBrshL8aKb3L2XXTRMuEKWE/IAtNPYEtcktceAQw+OpmqVy8pAmGOwQ==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-12.0.1.tgz", + "integrity": "sha512-2NAEOACoTgo+e+YAaCTODqbrWyhMVmlUyjxNCkTrDRHHQvH6+NbrnqVvQaLH/Q8Ket3v90A43dgAJmXv8y5Tkw==", "dev": true, "dependencies": { - "remark": "^14.0.0", - "unified-args": "^9.0.0" + "import-meta-resolve": "^4.0.0", + "markdown-extensions": "^2.0.0", + "remark": "^15.0.0", + "unified-args": "^11.0.0" }, "bin": { "remark": "cli.js" @@ -3958,745 +5464,721 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-cli/node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/remark-frontmatter": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-4.0.1.tgz", - "integrity": "sha512-38fJrB0KnmD3E33a5jZC/5+gGAC2WKNiPw1/fdXJvijBlhA7RCsvJklrYJakS0HedninvaCYW8lQGf9C918GfA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz", + "integrity": "sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-frontmatter": "^1.0.0", - "micromark-extension-frontmatter": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-frontmatter": "^2.0.0", + "micromark-extension-frontmatter": "^2.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-heading-gap": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-heading-gap/-/remark-heading-gap-5.0.1.tgz", - "integrity": "sha512-Jt2Jh9K5tS7+gpMwddv7hQFpFiYYwB1LkcpvElx7DuNHIfx7LglMKVM/j0DojEVbSCX9U8wV4IotMYzdjk1++A==", + "node_modules/remark-frontmatter/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-frontmatter/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-frontmatter/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.1.1.tgz", - "integrity": "sha512-zhe6twuqgkx/9KgZyNyaO0cceA4jQuJcyzMOBC+JZiAzMN6mFUmcssWZyY30ko8ut9vQDMX/pyQnolGn+Fg/Tw==", + "node_modules/remark-frontmatter/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "remark-message-control": "^7.0.0", - "unified": "^10.1.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-blockquote-indentation": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.1.1.tgz", - "integrity": "sha512-u9cjedM6zcK8vRicis5n/xeOSDIC3FGBCKc3K9pqw+nNrOjY85FwxDQKZZ/kx7rmkdRZEhgyHak+wzPBllcxBQ==", + "node_modules/remark-frontmatter/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-character-style": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.1.1.tgz", - "integrity": "sha512-KPSW3wfHfB8m9hzrtHiBHCTUIsOPX5nZR7VM+2pMjwqnhI6Mp94DKprkNo1ekNZALNeoZIDWZUSYxSiiwFfmVQ==", + "node_modules/remark-frontmatter/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-content-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.1.1.tgz", - "integrity": "sha512-apkM6sqCwAHwNV0v6KuEbq50fH3mTAV4wKTwI1nWgEj33/nf4+RvLLPgznoc2olZyeAIHR69EKPQiernjCXPOw==", + "node_modules/remark-heading-gap": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/remark-heading-gap/-/remark-heading-gap-6.0.0.tgz", + "integrity": "sha512-xsJJZ0BC9J6XFY0c7segxuSKrJ95EDHEh06+b5FOgbhyJ9Z7yWKxWEJpsa2Bp4gkeMAEkoODH4mjWIV0JD2Urg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/mdast": "^4.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-code/-/remark-lint-code-2.0.0.tgz", - "integrity": "sha1-A+DC6Qru2+h1qHlf6s9XmIt9lXw=", + "node_modules/remark-heading-gap/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", "dev": true, "dependencies": { - "unified-lint-rule": "^1.0.0", - "unist-util-visit": "^1.0.0" + "@types/unist": "*" } }, - "node_modules/remark-lint-code-block-style": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.1.0.tgz", - "integrity": "sha512-Hv4YQ8ueLGpjItla4CkcOkcfGj+nlquqylDgCm1/xKnW+Ke2a4qVTMVJrP9Krp4FWmXgktJLDHjhRH+pzhDXLg==", + "node_modules/remark-heading-gap/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-heading-gap/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code/node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/remark-heading-gap/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code/node_modules/unist-util-is": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "dev": true - }, - "node_modules/remark-lint-code/node_modules/unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", - "dev": true, - "dependencies": { - "unist-util-visit-parents": "^2.0.0" - } - }, - "node_modules/remark-lint-code/node_modules/unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", - "dev": true, - "dependencies": { - "unist-util-is": "^3.0.0" - } - }, - "node_modules/remark-lint-definition-case": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-definition-case/-/remark-lint-definition-case-3.1.1.tgz", - "integrity": "sha512-dirX0BSfbm1Ixx4Hv4xRQliEP1rw8dDitw2Om3XcO2QqF8bWrzF06/xeMlDNAaT77Cxqb9S7bODo/q+CYUxyWQ==", + "node_modules/remark-heading-gap/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-definition-spacing": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.1.1.tgz", - "integrity": "sha512-PR+cYvc0FMtFWjkaXePysW88r7Y7eIwbpUGPFDIWE48fiRiz8U3VIk05P3loQCpCkbmUeInAAYD8tIFPTg4Jlg==", + "node_modules/remark-heading-gap/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-emphasis-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-3.1.1.tgz", - "integrity": "sha512-VduuT+KAr0vA78xBLJdIcenCQja4mAd81aNACfdz7BUPLphIQa84D5uzl+nZatSaCXLebCNp5jP/bzVUsBmRKw==", + "node_modules/remark-lint": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-10.0.1.tgz", + "integrity": "sha512-1+PYGFziOg4pH7DDf1uMd4AR3YuO2EMnds/SdIWMPGT7CAfDRSnAmpxPsJD0Ds3IKpn97h3d5KPGf1WFOg6hXQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "remark-message-control": "^8.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-fenced-code-flag": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.1.1.tgz", - "integrity": "sha512-FFVZmYsBccKIIEgOtgdZEpQdARtAat1LTLBydnIpyNIvcntzWwtrtlj9mtjL8ZoSRre8HtwmEnBFyOfmM/NWaA==", + "node_modules/remark-lint-blockquote-indentation": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-4.0.1.tgz", + "integrity": "sha512-7BhOsImFgTD7IIliu2tt+yJbx5gbMbXCOspc3VdYf/87iLJdWKqJoMy2V6DZG7kBjBlBsIZi38fDDngJttXt4w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-fenced-code-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.1.1.tgz", - "integrity": "sha512-x/t8sJWPvE46knKz6zW03j9VX5477srHUmRFbnXhZ3K8e37cYVUIvfbPhcPCAosSsOki9+dvGfZsWQiKuUNNfQ==", + "node_modules/remark-lint-blockquote-indentation/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-blockquote-indentation/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-blockquote-indentation/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-file-extension": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.1.1.tgz", - "integrity": "sha512-r6OMe27YZzr2NFjPMbBxgm8RZxigRwzeFSjapPlqcxk0Q0w/6sosJsceBNlGGlk00pltvv7NPqSexbXUjirrQQ==", + "node_modules/remark-lint-blockquote-indentation/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-final-definition": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.1.1.tgz", - "integrity": "sha512-94hRV+EBIuLVFooiimsZwh5ZPEcTqjy5wr7LgqxoUUWy+srTanndaLoki7bxQJeIcWUnomZncsJAyL0Lo7toxw==", + "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-final-newline": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.1.1.tgz", - "integrity": "sha512-cgKYaI7ujUse/kV4KajLv2j1kmi1CxpAu+w7wIU0/Faihhb3sZAf4a5ACf2Wu8NoTSIr1Q//3hDysG507PIoDg==", + "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-hard-break-spaces": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.1.1.tgz", - "integrity": "sha512-UfwFvESpX32qwyHJeluuUuRPWmxJDTkmjnWv2r49G9fC4Jrzm4crdJMs3sWsrGiQ3mSex6bgp/8rqDgtBng2IA==", + "node_modules/remark-lint-blockquote-indentation/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-increment": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-heading-increment/-/remark-lint-heading-increment-3.1.1.tgz", - "integrity": "sha512-DtiMwZNAE/iAZWuZGjTXxYjNDQ375r59C99aVeVp1nKaovIufKuHWAm9U/9FAGBJNgBx6Ovfdej4YwIxd0yAPw==", + "node_modules/remark-lint-blockquote-indentation/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.1.1.tgz", - "integrity": "sha512-Qm7ZAF+s46ns0Wo5TlHGIn/PPMMynytn8SSLEdMIo6Uo/+8PAcmQ3zU1pj57KYxfyDoN5iQPgPIwPYMLYQ2TSQ==", + "node_modules/remark-lint-checkbox-character-style": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-5.0.1.tgz", + "integrity": "sha512-6qilm7XQXOcTvjFEqqNY57Ki7md9rkSdpMIfIzVXdEnI4Npl2BnUff6ANrGRM7qTgJTrloaf8H0eQ91urcU6Og==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-heading-style": "^2.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-whitespace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-heading-whitespace/-/remark-lint-heading-whitespace-1.0.0.tgz", - "integrity": "sha512-DykoBIXNbkihg64D+mztSOv3l82RTH4tIZW/HUB4QM4NpIEB+pVIPQpCYD0K4pTgvKiwoqsj4NY8qJ1EhNHAmQ==", + "node_modules/remark-lint-checkbox-character-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "mdast-util-to-string": "^1.0.4", - "unified-lint-rule": "^1.0.2", - "unist-util-visit": "^1.3.0" + "@types/unist": "*" } }, - "node_modules/remark-lint-heading-whitespace/node_modules/mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } + "node_modules/remark-lint-checkbox-character-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true }, - "node_modules/remark-lint-heading-whitespace/node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/remark-lint-checkbox-character-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-is": { + "node_modules/remark-lint-checkbox-character-style/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "dev": true - }, - "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-link-title-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-link-title-style/-/remark-lint-link-title-style-3.1.1.tgz", - "integrity": "sha512-JWWiuUFy/N2iwQ3eWIxFy6olX8D7xCFw8LoM0vZI2CHTZJrmDMaWwnl8jziP+HHHheFX3wkVqsoaYod536ArRw==", + "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-bullet-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.1.1.tgz", - "integrity": "sha512-NFvXVj1Nm12+Ma48NOjZCGb/D0IhmUcxyrTCpPp+UNJhEWrmFxM8nSyIiZgXadgXErnuv+xm2Atw7TAcZ9a1Cg==", + "node_modules/remark-lint-checkbox-character-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-content-indent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-content-indent/-/remark-lint-list-item-content-indent-3.1.1.tgz", - "integrity": "sha512-gcZhAXLd1onkutTEqQTybyANjdxvlOlu0y/AU4H3f6L99UGC85ymRhEeu5vGSkvsKKPR1FrMTEH6G2nNgtavgg==", + "node_modules/remark-lint-checkbox-character-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-indent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.1.1.tgz", - "integrity": "sha512-OSTG64e52v8XBmmeT0lefpiAfCMYHJxMMUrMnhTjLVyWAbEO0vqqR5bLvfLwzK+P4nY2D/8XKku0hw35dM86Rw==", + "node_modules/remark-lint-checkbox-content-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-5.0.1.tgz", + "integrity": "sha512-R1gV4vGkgJQZQFIGve1paj4mVDUWlgX0KAHhjNpSyzuwuSIDoxWpEuSJSxcnczESgcjM4yVrZqEGMYi/fqZK0w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-spacing": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-spacing/-/remark-lint-list-item-spacing-4.1.1.tgz", - "integrity": "sha512-MqXmahPgYrvfA7SPqmcAC6fI40jIgXG33EeE/MhFvMLWh04k+fqGf2O2aH1KT664MlwM4oETbTI4xj3/KCIHZA==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-checkbox-content-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-checkbox-content-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-maximum-heading-length": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-heading-length/-/remark-lint-maximum-heading-length-3.1.1.tgz", - "integrity": "sha512-hTOvRDnULpu0S+k51lovT28TLBgtw8XR0qq+mECSsoyuT4C38UBjQRic5OPo68AZMH0ad/93uj6yvfFtH0K8Lg==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-maximum-line-length": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.1.2.tgz", - "integrity": "sha512-KwddpVmNifTHNXwTQQgVufuUvv0hhu9kJVvmpNdEvfEc7tc3wBkaavyi3kKsUB8WwMhGtZuXVWy6OdPC1axzhw==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-auto-link-without-protocol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.1.1.tgz", - "integrity": "sha512-lCjBuoSUWjN1kO0J7vqQgn7HUF/WeOHOqc3oiq9LMRXIovKWqPCBi77o8Npv8KfV+JXeRl+hrupfbhJXlLturA==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-blockquote-without-marker": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.1.1.tgz", - "integrity": "sha512-7jL7eKS25kKRhQ7SKKB5eRfNleDMWKWAmZ5Y/votJdDoM+6qsopLLumPWaSzP0onyV3dyHRhPfBtqelt3hvcyA==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-consecutive-blank-lines": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.1.2.tgz", - "integrity": "sha512-wRsR3kFgHaZ4mO3KASU43oXGLGezNZ64yNs1ChPUacKh0Bm7cwGnxN9GHGAbOXspwrYrN2eCDxzCbdPEZi2qKw==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-dead-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-1.1.0.tgz", - "integrity": "sha512-it3EZmMQ+hwGhUf60NkXN0mMIFuFkS0cxdbgEbhZ/Fj1PlUBpe3gDBtWJ/sqNwSNvQlNSzpvMQkNHSoAhlsVjA==", + "node_modules/remark-lint-code": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-code/-/remark-lint-code-2.0.0.tgz", + "integrity": "sha1-A+DC6Qru2+h1qHlf6s9XmIt9lXw=", "dev": true, "dependencies": { - "check-links": "^1.1.8", - "is-online": "^8.2.1", - "unified-lint-rule": "^1.0.4", - "unist-util-visit": "^2.0.1" - }, - "engines": { - "node": ">=6" + "unified-lint-rule": "^1.0.0", + "unist-util-visit": "^1.0.0" } }, - "node_modules/remark-lint-no-dead-urls/node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/remark-lint-code-block-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-4.0.1.tgz", + "integrity": "sha512-d4mHsEpv1yqXWl2dd+28tGRX0Lzk5qw7cfxAQVkOXPUONhsMFwXJEBeeqZokeG4lOKtkKdIJR7ezScDfWR0X4w==", "dev": true, + "license": "MIT", "dependencies": { - "wrapped": "^1.0.1" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-dead-urls/node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", + "node_modules/remark-lint-code-block-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "dependencies": { + "@types/unist": "*" } }, - "node_modules/remark-lint-no-dead-urls/node_modules/unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "node_modules/remark-lint-code-block-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-code-block-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-dead-urls/node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "node_modules/remark-lint-code-block-style/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-duplicate-definitions": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.1.1.tgz", - "integrity": "sha512-9p+nBz8VvV+t4g/ALNLVN8naV+ffAzC4ADyg9QivzmKwLjyF93Avt4HYNlb2GZ+aoXRQSVG1wjjWFeDC9c7Tdg==", + "node_modules/remark-lint-code-block-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-duplicate-headings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-headings/-/remark-lint-no-duplicate-headings-3.1.1.tgz", - "integrity": "sha512-gSO/BngGkxF35Fsctzt3YMwGEZ8F7f71zx7h0Y97DylyL6WXVuWP4saCmQTlbB4FpD0UXEnRROJ6fBFDvJlzOA==", + "node_modules/remark-lint-code-block-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-emphasis-as-heading": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-emphasis-as-heading/-/remark-lint-no-emphasis-as-heading-3.1.1.tgz", - "integrity": "sha512-F45yuLsYVP4r6OjVtePKk7Aymnf3rBLHXYjnSJggEaYn0j+72xOBLrqmj6ii5YGfDsBwG2pDNTBx4vm3xM7P0Q==", + "node_modules/remark-lint-code-block-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-empty-sections": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-empty-sections/-/remark-lint-no-empty-sections-4.0.0.tgz", - "integrity": "sha512-Tx1nCu7Dq3dsJ500402sSvM0uVK/6khSuEjx8K8u9aHN+Y4vjL6h88xVzdzCmZq2J2yqyFnvMjG1y7lQv+DRvg==", + "node_modules/remark-lint-code-block-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-visit": "^1.0.0" - } - }, - "node_modules/remark-lint-no-empty-sections/node_modules/mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", - "dev": true, + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-empty-sections/node_modules/unified-lint-rule": { + "node_modules/remark-lint-code/node_modules/unified-lint-rule": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", @@ -4709,13 +6191,13 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-is": { + "node_modules/remark-lint-code/node_modules/unist-util-is": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", "dev": true }, - "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-visit": { + "node_modules/remark-lint-code/node_modules/unist-util-visit": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", @@ -4724,7 +6206,7 @@ "unist-util-visit-parents": "^2.0.0" } }, - "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-visit-parents": { + "node_modules/remark-lint-code/node_modules/unist-util-visit-parents": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", @@ -4733,1444 +6215,1366 @@ "unist-util-is": "^3.0.0" } }, - "node_modules/remark-lint-no-empty-url": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-empty-url/-/remark-lint-no-empty-url-3.1.1.tgz", - "integrity": "sha512-zxIkDMggf6R/NCDkYAsaVHaFhklkp6WvV/wdeJAzT3BverGFnM8QIHUAv8YIQvCGqYWov275SVN1eu81DoU95g==", + "node_modules/remark-lint-definition-case": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-case/-/remark-lint-definition-case-4.0.1.tgz", + "integrity": "sha512-BItJMeXyEBKW/beM7gFLMt3flnyNoRDd8yNFq+7pIeFjO7KWGRxBWUaNgk/tFEPyQcGeCqrNS3nS0ic7qi7I2w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-articles": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.1.1.tgz", - "integrity": "sha512-7fiHKQUGvP4WOsieZ1dxm8WQWWjXjPj0Uix6pk2dSTJqxvaosjKH1AV0J/eVvliat0BGH8Cz4SUbuz5vG6YbdQ==", + "node_modules/remark-lint-definition-case/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "@types/unist": "*" } }, - "node_modules/remark-lint-no-file-name-consecutive-dashes": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.1.1.tgz", - "integrity": "sha512-tM4IpURGuresyeIBsXT5jsY3lZakgO6IO59ixcFt015bFjTOW54MrBvdJxA60QHhf5DAyHzD8wGeULPSs7ZQfg==", + "node_modules/remark-lint-definition-case/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-definition-case/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-irregular-characters": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-irregular-characters/-/remark-lint-no-file-name-irregular-characters-2.1.1.tgz", - "integrity": "sha512-rVeCv1XRdLtp/rxLaiFKElaIHuIlokypV/c2aCG3VVYcQ4+ZmJxq018kEsolR2+Dv9m3vKp8Fy1482US4g4WKA==", + "node_modules/remark-lint-definition-case/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-mixed-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-mixed-case/-/remark-lint-no-file-name-mixed-case-2.1.1.tgz", - "integrity": "sha512-mJU3hYzyXNo8NkoSafPcsgr+Gema+vDCzNWlLw05UdFXJK/cVy+6DVsbrEFjrz8L+WF7uQmUHBtTvd91SqoItg==", + "node_modules/remark-lint-definition-case/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-outer-dashes": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.1.1.tgz", - "integrity": "sha512-2kRcVNzZb0zS3jE+Iaa6MEpplhqXSdsHBILS+BxJ4cDGAAIdeipY8hKaDLdZi+34wvrfnDxNgvNLcHpgqO+OZA==", + "node_modules/remark-lint-definition-case/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-content-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.1.1.tgz", - "integrity": "sha512-W4zF7MA72IDC5JB0qzciwsnioL5XlnoE0r1F7sDS0I5CJfQtHYOLlxb3UAIlgRCkBokPWCp0E4o1fsY/gQUKVg==", + "node_modules/remark-lint-definition-case/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-heading-style": "^2.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.1.1.tgz", - "integrity": "sha512-3vIfT7gPdpE9D7muIQ6YzSF1q27H9SbsDD7ClJRkEWxMiAzBg0obOZFOIBYukUkmGWdOR5P1EDn5n9TEzS1Fyg==", + "node_modules/remark-lint-definition-spacing": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-4.0.1.tgz", + "integrity": "sha512-ZjShKaBUGeHrZyIZWwOZOxX3guj/P7gRR5wbDADQctL4oK+ZLQfOvJFmAsF1nD4gNr0Ficjd0AuiWxQcc1qTMA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-like-paragraph": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-like-paragraph/-/remark-lint-no-heading-like-paragraph-3.1.1.tgz", - "integrity": "sha512-eDQkw1ir0j2VVmZd60Hy3CUAj85U7zKf59bGEBdXr2OQYJQhvme7XqKwY8QfMlBqn9lYg1/DxsGWt0+5ESIogw==", + "node_modules/remark-lint-definition-spacing/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-definition-spacing/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-definition-spacing/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-punctuation": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-punctuation/-/remark-lint-no-heading-punctuation-3.1.1.tgz", - "integrity": "sha512-ZexHx4rmsjKVF1/Fvdig0yOgpWl0wFa43+sqg880HT3PW9KmEczjSRkwlMaTlVgDzC0paNn2FXfQMuEQW4YDLg==", + "node_modules/remark-lint-definition-spacing/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-inline-padding": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.1.1.tgz", - "integrity": "sha512-++IMm6ohOPKNOrybqjP9eiclEtVX/Rd2HpF2UD9icrC1X5nvrI6tlfN55tePaFvWAB7pe6MW4LzNEMnWse61Lw==", + "node_modules/remark-lint-definition-spacing/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-literal-urls": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.1.1.tgz", - "integrity": "sha512-tZZ4gtZMA//ZAf7GJTE8S9yjzqXUfUTlR/lvU7ffc7NeSurqCBwAtHqeXVCHiD39JnlHVSW2MLYhvHp53lBGvA==", + "node_modules/remark-lint-definition-spacing/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.1.1.tgz", - "integrity": "sha512-bM//SIBvIkoGUpA8hR5QibJ+7C2R50PTIRrc4te93YNRG+ie8bJzjwuO9jIMedoDfJB6/+7EqO9FYBivjBZ3MA==", + "node_modules/remark-lint-definition-spacing/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-reference-like-url": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-reference-like-url/-/remark-lint-no-reference-like-url-3.1.1.tgz", - "integrity": "sha512-ELO2uez1NO9wEb2nNRY4uVBfw4TYYUHWOnLajExGY92+i3Ylt3EmMwRONT2maJX5qKj4cu8uPi7HAkMIxq8jFg==", + "node_modules/remark-lint-emphasis-marker": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-4.0.0.tgz", + "integrity": "sha512-xIRiB4PFWUOyIslN/UOPL6Lh+J0VD4R11+jo+W4hpGMNsg58l+2SgtdbinlXzDeoBxmaaka9n/sYpJ7cJWEIPQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-repeat-punctuation": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/remark-lint-no-repeat-punctuation/-/remark-lint-no-repeat-punctuation-0.1.4.tgz", - "integrity": "sha512-JJduCs4FimdBcR1AB576SqIYOjt+7t8OjTnnlZMvjnw7lzkuL0+nNNHyNXVPaK6jxaLjEUhrH2/smU6vZFUT7g==", + "node_modules/remark-lint-emphasis-marker/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "unified-lint-rule": "^1.0.3", - "unist-util-map": "^1.0.4", - "unist-util-to-list-of-char": "^0.1.3" + "@types/unist": "*" } }, - "node_modules/remark-lint-no-repeat-punctuation/node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/remark-lint-emphasis-marker/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-emphasis-marker/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shell-dollars": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.1.1.tgz", - "integrity": "sha512-Q3Ad1TaOPxbYog5+Of/quPG3Fy+dMKiHjT8KsU7NDiHG6YJOnAJ3f3w+y13CIlNIaKc/MrisgcthhrZ7NsgXfA==", + "node_modules/remark-lint-emphasis-marker/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shortcut-reference-image": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.1.1.tgz", - "integrity": "sha512-m8tH+loDagd1JUns/T4eyulVXgVvE+ZSs7owRUOmP+dgsKJuO5sl1AdN9eyKDVMEvxHF3Pm5WqE62QIRNM48mA==", + "node_modules/remark-lint-emphasis-marker/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shortcut-reference-link": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.1.1.tgz", - "integrity": "sha512-oDJ92/jXQ842HgrBGgZdP7FA+N2jBMCBU2+jRElkS+OWVut0UaDILtNavNy/e85B3SLPj3RoXKF96M4vfJ7B2A==", + "node_modules/remark-lint-emphasis-marker/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-table-indentation": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.1.1.tgz", - "integrity": "sha512-eklvBxUSrkVbJxeokepOvFZ3n2V6zaJERIiOowR+y/Bz4dRHDMij1Ojg55AMO9yUMvxWPV3JPOeThliAcPmrMg==", + "node_modules/remark-lint-emphasis-marker/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-tabs": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.1.1.tgz", - "integrity": "sha512-+MjXoHSSqRFUUz6XHgB1z7F5zIETxhkY+lC5LsOYb1r2ZdujZQWzBzNW5ya4HH5JiDVBPhp8MrqM9cP1v7tB5g==", + "node_modules/remark-lint-emphasis-marker/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "vfile-location": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-undefined-references": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.1.1.tgz", - "integrity": "sha512-J20rKfTGflLiTI3T5JlLZSmINk6aDGmZi1y70lpU69LDfAyHAKgDK6sSW9XDeFmCPPdm8Ybxe5Gf2a70k+GcVQ==", + "node_modules/remark-lint-fenced-code-flag": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-4.2.0.tgz", + "integrity": "sha512-QWGTrnYbcopOFZR98djDREmKApLonJ7hmXE7pEcOGee9JY/EUIVS7Lq54Hy9CtU3cVIvQQmiMTxCwUhfddDJFA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "quotation": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-unused-definitions": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.1.1.tgz", - "integrity": "sha512-/GtyBukhAxi5MEX/g/m+FzDEflSbTe2/cpe2H+tJZyDmiLhjGXRdwWnPRDp+mB9g1iIZgVRCk7T4v90RbQX/mw==", + "node_modules/remark-lint-fenced-code-flag/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-fenced-code-flag/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-fenced-code-flag/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-ordered-list-marker-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.1.1.tgz", - "integrity": "sha512-IWcWaJoaSb4yoSOuvDbj9B2uXp9kSj58DqtrMKo8MoRShmbj1onVfulTxoTLeLtI11NvW+mj3jPSpqjMjls+5Q==", + "node_modules/remark-lint-fenced-code-flag/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-ordered-list-marker-value": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-3.1.1.tgz", - "integrity": "sha512-+bQZbo+v/A8CuLrO71gobJuKR4/sfnPgWyEggSa+zq+LXPK1HiMDjap0Wr07uYgcUXsXIPh+HD/5J5by6JL+vg==", + "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-rule-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.1.1.tgz", - "integrity": "sha512-+oZe0ph4DWHGwPkQ/FpqiGp4WULTXB1edftnnNbizYT+Wr+/ux7GNTx78oXH/PHwlnOtVIExMc4W/vDXrUj/DQ==", + "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-strong-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.1.1.tgz", - "integrity": "sha512-tX9Os2C48Hh8P8CouY4dcnAhGnR3trL+NCDqIvJvFDR9Rvm9yfNQaY2N4ZHWVY0iUicq9DpqEiJTgUsT8AGv/w==", + "node_modules/remark-lint-fenced-code-flag/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-cell-padding": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.1.2.tgz", - "integrity": "sha512-cx5BXjHtpACa7Z51Vuqzy9BI4Z8Hnxz7vklhhrubkoB7mbctP/mR+Nh4B8eE5VtgFYJNHFwIltl96PuoctFCeQ==", + "node_modules/remark-lint-fenced-code-flag/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-pipe-alignment": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipe-alignment/-/remark-lint-table-pipe-alignment-3.1.1.tgz", - "integrity": "sha512-WOHv2yL4ZwXHM06MIyQNnGFYKz9m2k/GFIA/6hpArF8Ph/3v8CF0J/Hb3Yyfg39e5nODw3D2G3okCO+xgyGQGA==", + "node_modules/remark-lint-fenced-code-marker": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-4.0.1.tgz", + "integrity": "sha512-uI91OcVPKjNxV+vpjDW9T64hkE0a/CRn3JhwdMxUAJYpVsKnA7PFPSFJOx/abNsVZHNSe7ZFGgGdaH/lqgSizA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-pipes": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.1.1.tgz", - "integrity": "sha512-mJnB2FpjJTE4s9kE1JX8gcCjCFvtGPjzXUiQy0sbPHn2YM9EWG7kvFWYoqWK4w569CEQJyxZraEPltmhDjQTjg==", + "node_modules/remark-lint-fenced-code-marker/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-fenced-code-marker/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-fenced-code-marker/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-unordered-list-marker-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.1.1.tgz", - "integrity": "sha512-JwH8oIDi9f5Z8cTQLimhJ/fkbPwI3OpNSifjYyObNNuc4PG4/NUoe5ZuD10uPmPYHZW+713RZ8S5ucVCkI8dDA==", + "node_modules/remark-lint-fenced-code-marker/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-write-good": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remark-lint-write-good/-/remark-lint-write-good-1.2.0.tgz", - "integrity": "sha512-HYiwM16RRBm979yDb/IVwPe1eFhzA1HATe1WucRiYWS10jcPRgJe9FihH7W5uzQFDqX5aRbTtu/yPdq+hPnYkw==", + "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "nlcst-to-string": "^2.0.0", - "unified-lint-rule": "^1.0.1", - "unist-util-visit": "^1.1.1", - "write-good": "^1.0.2" + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-write-good/node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-write-good/node_modules/unist-util-is": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "dev": true - }, - "node_modules/remark-lint-write-good/node_modules/unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "node_modules/remark-lint-fenced-code-marker/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-write-good/node_modules/unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "node_modules/remark-lint-fenced-code-marker/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/remark-message-control": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.1.1.tgz", - "integrity": "sha512-xKRWl1NTBOKed0oEtCd8BUfH5m4s8WXxFFSoo7uUwx6GW/qdCy4zov5LfPyw7emantDmhfWn5PdIZgcbVcWMDQ==", + "node_modules/remark-lint-file-extension": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-3.0.1.tgz", + "integrity": "sha512-1Ca5Dgu9J/j1fb7nvzNXh2xy4ija03igiP5i4le64LfrlloGax4VWcG/M7uL+CpRTFVqEJMWw0iKDEZxYSgImg==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-comment-marker": "^2.0.0", - "unified": "^10.0.0", - "unified-message-control": "^4.0.0", - "vfile": "^5.0.0" + "@types/mdast": "^4.0.0", + "quotation": "^2.0.0", + "unified-lint-rule": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-parse": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz", - "integrity": "sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw==", + "node_modules/remark-lint-file-extension/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-file-extension/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-file-extension/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-preset-lint-consistent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/remark-preset-lint-consistent/-/remark-preset-lint-consistent-5.1.1.tgz", - "integrity": "sha512-DZQfomiVi/1x7NRByWrOiIC+olEGa1PpyykKrowvYp5qr/Seq60FqU7OjBJxtcOLzgnQcu9Y2JXdHxFi4AAPXQ==", + "node_modules/remark-lint-file-extension/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-blockquote-indentation": "^3.0.0", - "remark-lint-checkbox-character-style": "^4.0.0", - "remark-lint-code-block-style": "^3.0.0", - "remark-lint-emphasis-marker": "^3.0.0", - "remark-lint-fenced-code-marker": "^3.0.0", - "remark-lint-heading-style": "^3.0.0", - "remark-lint-link-title-style": "^3.0.0", - "remark-lint-list-item-content-indent": "^3.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "remark-lint-rule-style": "^3.0.0", - "remark-lint-strong-marker": "^3.0.0", - "remark-lint-table-cell-padding": "^4.0.0", - "unified": "^10.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-preset-lint-markdown-style-guide": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/remark-preset-lint-markdown-style-guide/-/remark-preset-lint-markdown-style-guide-5.1.2.tgz", - "integrity": "sha512-MIAhnz0wDOq/MqLucSaAPquKGFE2I5SxqRjgWT+ZGK7TmqTxrro53e11/Pc19xPX4evmzI5CZdvaRnIoxP3ysQ==", - "dev": true, - "dependencies": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-blockquote-indentation": "^3.0.0", - "remark-lint-code-block-style": "^3.0.0", - "remark-lint-definition-case": "^3.0.0", - "remark-lint-definition-spacing": "^3.0.0", - "remark-lint-emphasis-marker": "^3.0.0", - "remark-lint-fenced-code-flag": "^3.0.0", - "remark-lint-fenced-code-marker": "^3.0.0", - "remark-lint-file-extension": "^2.0.0", - "remark-lint-final-definition": "^3.0.0", - "remark-lint-hard-break-spaces": "^3.0.0", - "remark-lint-heading-increment": "^3.0.0", - "remark-lint-heading-style": "^3.0.0", - "remark-lint-link-title-style": "^3.0.0", - "remark-lint-list-item-content-indent": "^3.0.0", - "remark-lint-list-item-indent": "^3.0.0", - "remark-lint-list-item-spacing": "^4.0.0", - "remark-lint-maximum-heading-length": "^3.0.0", - "remark-lint-maximum-line-length": "^3.0.0", - "remark-lint-no-blockquote-without-marker": "^5.0.0", - "remark-lint-no-consecutive-blank-lines": "^4.0.0", - "remark-lint-no-duplicate-headings": "^3.0.0", - "remark-lint-no-emphasis-as-heading": "^3.0.0", - "remark-lint-no-file-name-articles": "^2.0.0", - "remark-lint-no-file-name-consecutive-dashes": "^2.0.0", - "remark-lint-no-file-name-irregular-characters": "^2.0.0", - "remark-lint-no-file-name-mixed-case": "^2.0.0", - "remark-lint-no-file-name-outer-dashes": "^2.0.0", - "remark-lint-no-heading-punctuation": "^3.0.0", - "remark-lint-no-inline-padding": "^4.0.0", - "remark-lint-no-literal-urls": "^3.0.0", - "remark-lint-no-multiple-toplevel-headings": "^3.0.0", - "remark-lint-no-shell-dollars": "^3.0.0", - "remark-lint-no-shortcut-reference-image": "^3.0.0", - "remark-lint-no-shortcut-reference-link": "^3.0.0", - "remark-lint-no-table-indentation": "^4.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "remark-lint-ordered-list-marker-value": "^3.0.0", - "remark-lint-rule-style": "^3.0.0", - "remark-lint-strong-marker": "^3.0.0", - "remark-lint-table-cell-padding": "^4.0.0", - "remark-lint-table-pipe-alignment": "^3.0.0", - "remark-lint-table-pipes": "^4.0.0", - "remark-lint-unordered-list-marker-style": "^3.0.0", - "unified": "^10.0.0" + "node_modules/remark-lint-file-extension/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-preset-lint-recommended": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.1.2.tgz", - "integrity": "sha512-x9kWufNY8PNAhY4fsl+KD3atgQdo4imP3GDAQYbQ6ylWVyX13suPRLkqnupW0ODRynfUg8ZRt8pVX0wMHwgPAg==", + "node_modules/remark-lint-file-extension/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-final-newline": "^2.0.0", - "remark-lint-hard-break-spaces": "^3.0.0", - "remark-lint-list-item-bullet-indent": "^4.0.0", - "remark-lint-list-item-indent": "^3.0.0", - "remark-lint-no-blockquote-without-marker": "^5.0.0", - "remark-lint-no-duplicate-definitions": "^3.0.0", - "remark-lint-no-heading-content-indent": "^4.0.0", - "remark-lint-no-inline-padding": "^4.0.0", - "remark-lint-no-literal-urls": "^3.0.0", - "remark-lint-no-shortcut-reference-image": "^3.0.0", - "remark-lint-no-shortcut-reference-link": "^3.0.0", - "remark-lint-no-undefined-references": "^4.0.0", - "remark-lint-no-unused-definitions": "^3.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "unified": "^10.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-retext": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-retext/-/remark-retext-5.0.1.tgz", - "integrity": "sha512-h3kOjKNy7oJfohqXlKp+W4YDigHD3rw01x91qvQP/cUkK5nJrDl6yEYwTujQCAXSLZrsBxywlK3ntzIX6c29aA==", + "node_modules/remark-lint-file-extension/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "mdast-util-to-nlcst": "^5.0.0", - "unified": "^10.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-stringify": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-10.0.2.tgz", - "integrity": "sha512-6wV3pvbPvHkbNnWB0wdDvVFHOe1hBRAx1Q/5g/EpH4RppAII6J8Gnwe7VbHuXaoKIF6LAg6ExTel/+kNqSQ7lw==", + "node_modules/remark-lint-final-definition": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-4.0.2.tgz", + "integrity": "sha512-fz3UAcFQef77Zb8rz4za2R6y7pdyJot22iGtFoNIKdtbcNa8IKKEVoY3NIfrsLfhrjwzcha1Sp3fFA9NF6lc4w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-textr": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-textr/-/remark-textr-5.0.1.tgz", - "integrity": "sha512-Kd5q7I1LsZ04meMZJJwBze/wxiLhAItRTGevDeyx3K/WMd4juO6WbGLro0/99Ui6I+lYx/l90v0Ax4dVPj3/0Q==", + "node_modules/remark-lint-final-definition/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "textr": "^0.3.0", - "unified": "^10.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "*" + } + }, + "node_modules/remark-lint-final-definition/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-final-definition/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-validate-links": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/remark-validate-links/-/remark-validate-links-11.0.2.tgz", - "integrity": "sha512-SfVDWgF/Albdou1TmrCpq4AvJyvMnPflnaLLPUuFFxKO4Jp1o7fK2sinqPt+WW0DXS4JmtXPXm2FOkB8FJ08tQ==", + "node_modules/remark-lint-final-definition/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/mdast": "^3.0.0", - "github-slugger": "^1.0.0", - "hosted-git-info": "^4.0.0", - "mdast-util-to-string": "^3.0.0", - "propose": "0.0.5", - "to-vfile": "^7.0.0", + "@types/unist": "^3.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", - "unified-engine": "^9.0.0", - "unist-util-visit": "^4.0.0", - "vfile": "^5.0.0" + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", + "node_modules/remark-lint-final-definition/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, "dependencies": { - "is-core-module": "^2.8.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/resolve-from": { + "node_modules/remark-lint-final-definition/node_modules/unist-util-stringify-position": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, - "engines": { - "node": ">=4" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "node_modules/remark-lint-final-definition/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "lowercase-keys": "^1.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/remark-lint-final-definition/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "node_modules/remark-lint-final-newline": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-3.0.1.tgz", + "integrity": "sha512-q5diKHD6BMbzqWqgvYPOB8AJgLrMzEMBAprNXjcpKoZ/uCRqly+gxjco+qVUMtMWSd+P+KXZZEqoa7Y6QiOudw==", "dev": true, + "license": "MIT", "dependencies": { - "mri": "^1.1.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "vfile-location": "^5.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "node_modules/remark-lint-final-newline/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "dependencies": { + "@types/unist": "*" + } }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/remark-lint-final-newline/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-final-newline/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/remark-lint-final-newline/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, "dependencies": { - "shebang-regex": "^3.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "node_modules/remark-lint-final-newline/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "node_modules/remark-lint-final-newline/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/sliced": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/remark-lint-final-newline/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "safe-buffer": "~5.2.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/string-width": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz", - "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==", + "node_modules/remark-lint-hard-break-spaces": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-4.1.1.tgz", + "integrity": "sha512-AKDPDt39fvmr3yk38OKZEWJxxCOOUBE+96AsBfs+ExS5LW6oLa9041X5ahFDQHvHGzdoremEIaaElursaPEkNg==", "dev": true, + "license": "MIT", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/string.prototype.matchall": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz", - "integrity": "sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg==", + "node_modules/remark-lint-hard-break-spaces/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.3.1", - "side-channel": "^1.0.4" + "@types/unist": "*" + } + }, + "node_modules/remark-lint-hard-break-spaces/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-hard-break-spaces/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "node_modules/remark-lint-hard-break-spaces/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, - "peer": true, - "engines": { - "node": ">=4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/remark-lint-hard-break-spaces/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "engines": { - "node": ">=8" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/remark-lint-hard-break-spaces/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/remark-lint-heading-increment": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-increment/-/remark-lint-heading-increment-4.0.1.tgz", + "integrity": "sha512-uat7RTQn0hGlMv62p7yjLlg3tO3RljFbH6C+0M+5BNEF+s3NrA8jJgqW0UwLLNdCd3EABCKaWloHumT57ND7PQ==", "dev": true, - "peer": true, - "engines": { - "node": ">= 0.4" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "node_modules/remark-lint-heading-increment/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } }, - "node_modules/textr": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/textr/-/textr-0.3.0.tgz", - "integrity": "sha1-cXNhKGlirI3za3omGft3OhW5t/c=", + "node_modules/remark-lint-heading-increment/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "node_modules/remark-lint-heading-increment/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/remark-lint-heading-increment/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "is-number": "^7.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">=8.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/to-vfile": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.3.tgz", - "integrity": "sha512-QO0A9aE6Z/YkmQadJ0syxpmNXtcQiu0qAtCKYKD5cS3EfgfFTAXfgLX6AOaBrSfWSek5nfsMf3gBZ9KGVFcLuw==", + "node_modules/remark-lint-heading-increment/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "is-buffer": "^2.0.0", - "vfile": "^5.1.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/too-wordy": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/too-wordy/-/too-wordy-0.3.4.tgz", - "integrity": "sha512-EU+UA4zHc06TkVQaravNNVdqX763/ENTIOKiKlqSJ6WKCPwLxHjvY3d0uEJYaq92iojyHPwD2iaYbZKjdw3icA==", + "node_modules/remark-lint-heading-increment/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "engines": { - "node": ">=6", - "npm": ">=5" - } - }, - "node_modules/trough": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", - "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "peer": true, "dependencies": { - "minimist": "^1.2.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, - "bin": { - "json5": "lib/cli.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/remark-lint-heading-increment/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, "dependencies": { - "prelude-ls": "^1.2.1" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "node_modules/remark-lint-heading-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-4.0.1.tgz", + "integrity": "sha512-+rUpJ/N2CGC5xPgZ18XgsCsUBtadgEhdTi0BJPrsFmHPzL22BUHajeg9im8Y7zphUcbi1qFiKuxZd2nzDgZSXQ==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" + "@types/mdast": "^4.0.0", + "mdast-util-heading-style": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unified": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.1.tgz", - "integrity": "sha512-v4ky1+6BN9X3pQrOdkFIPWAaeDsHPE1svRDxq7YpTc2plkIqFMwukfqM+l0ewpP9EfwARlt9pPFAeWYhHm8X9w==", + "node_modules/remark-lint-heading-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "@types/unist": "*" } }, - "node_modules/unified-args": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/unified-args/-/unified-args-9.0.2.tgz", - "integrity": "sha512-qSqryjoqfJSII4E4Z2Jx7MhXX2MuUIn6DsrlmL8UnWFdGtrWvEtvm7Rx5fKT5TPUz7q/Fb4oxwIHLCttvAuRLQ==", + "node_modules/remark-lint-heading-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-heading-style/node_modules/mdast-util-heading-style": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-3.0.0.tgz", + "integrity": "sha512-tsUfM9Kj9msjlemA/38Z3pvraQay880E3zP2NgIthMoGcpU9bcPX9oSM6QC/+eFXGGB4ba+VCB1dKAPHB7Veug==", "dev": true, "dependencies": { - "@types/text-table": "^0.2.0", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "chokidar": "^3.0.0", - "fault": "^2.0.0", - "json5": "^2.0.0", - "minimist": "^1.0.0", - "text-table": "^0.2.0", - "unified-engine": "^9.0.0" + "@types/mdast": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unified-engine": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-9.0.5.tgz", - "integrity": "sha512-frQ6lUNlkTwVC0JELJqSSITpE7MLrLJqAWmDrUFj5Do6A4/3n6eX5Jyg8fhe4Dbwwh38spqUJd39FtRFG34QWg==", + "node_modules/remark-lint-heading-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "@types/concat-stream": "^1.0.0", - "@types/debug": "^4.0.0", - "@types/is-empty": "^1.0.0", - "@types/js-yaml": "^4.0.0", - "@types/node": "^17.0.0", - "@types/unist": "^2.0.0", - "concat-stream": "^2.0.0", - "debug": "^4.0.0", - "fault": "^2.0.0", - "glob": "^7.0.0", - "ignore": "^5.0.0", - "is-buffer": "^2.0.0", - "is-empty": "^1.0.0", + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "load-plugin": "^4.0.0", - "parse-json": "^6.0.0", - "to-vfile": "^7.0.0", "trough": "^2.0.0", - "unist-util-inspect": "^7.0.0", - "vfile-message": "^3.0.0", - "vfile-reporter": "^7.0.0", - "vfile-statistics": "^2.0.0" + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unified-lint-rule": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.1.1.tgz", - "integrity": "sha512-vsLHyLZFstqtGse2gvrGwasOmH8M2y+r2kQMoDSWzSqUkQx2MjHjvZuGSv5FUaiv4RQO1bHRajy7lSGp7XWq5A==", + "node_modules/remark-lint-heading-style/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", + "@types/unist": "^3.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unified-message-control": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", - "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", + "node_modules/remark-lint-heading-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit": "^3.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0", - "vfile-message": "^3.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unified-message-control/node_modules/unist-util-visit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", - "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "node_modules/remark-lint-heading-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unified-message-control/node_modules/unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", + "node_modules/remark-lint-heading-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-generated": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.0.tgz", - "integrity": "sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-inspect": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-7.0.0.tgz", - "integrity": "sha512-2Utgv78I7PUu461Y9cdo+IUiiKSKpDV5CE/XD6vTj849a3xlpDAScvSJ6cQmtFBGgAmCn2wR7jLuXhpg1XLlJw==", + "node_modules/remark-lint-heading-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-map": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/unist-util-map/-/unist-util-map-1.0.5.tgz", - "integrity": "sha512-dFil/AN6vqhnQWNCZk0GF/G3+Q5YwsB+PqjnzvpO2wzdRtUJ1E8PN+XRE/PRr/G3FzKjRTJU0haqE0Ekl+O3Ag==", + "node_modules/remark-lint-heading-whitespace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-heading-whitespace/-/remark-lint-heading-whitespace-1.0.0.tgz", + "integrity": "sha512-DykoBIXNbkihg64D+mztSOv3l82RTH4tIZW/HUB4QM4NpIEB+pVIPQpCYD0K4pTgvKiwoqsj4NY8qJ1EhNHAmQ==", "dev": true, "dependencies": { - "object-assign": "^4.0.1" + "mdast-util-to-string": "^1.0.4", + "unified-lint-rule": "^1.0.2", + "unist-util-visit": "^1.3.0" } }, - "node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-heading-whitespace/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-stringify-position": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", - "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "node_modules/remark-lint-heading-whitespace/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0" + "wrapped": "^1.0.1" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-to-list-of-char": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/unist-util-to-list-of-char/-/unist-util-to-list-of-char-0.1.3.tgz", - "integrity": "sha512-f8GrLHdhBKfaW6mzJc25BKeUOqhsuiRXlGrXBtb3pmRT3QCuYS+jH4g7Uf52hjV7TLQN4PGnjzrTFMFXAQaprA==", - "dev": true, - "dependencies": { - "unist-util-generated": "^1.1.6", - "unist-util-visit": "^1.4.0" - } - }, - "node_modules/unist-util-to-list-of-char/node_modules/unist-util-generated": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz", - "integrity": "sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-to-list-of-char/node_modules/unist-util-is": { + "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-is": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", "dev": true }, - "node_modules/unist-util-to-list-of-char/node_modules/unist-util-visit": { + "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-visit": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", @@ -6179,7 +7583,7 @@ "unist-util-visit-parents": "^2.0.0" } }, - "node_modules/unist-util-to-list-of-char/node_modules/unist-util-visit-parents": { + "node_modules/remark-lint-heading-whitespace/node_modules/unist-util-visit-parents": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", @@ -6188,3969 +7592,17283 @@ "unist-util-is": "^3.0.0" } }, - "node_modules/unist-util-visit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.0.tgz", - "integrity": "sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ==", + "node_modules/remark-lint-link-title-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-link-title-style/-/remark-lint-link-title-style-4.0.1.tgz", + "integrity": "sha512-MtmnYrhjhRXR0zeiyYf/7GBlUF5KAPypJb345KjyDluOhI4Wj4VAXvVQuov/MFc3y8p/1yVwv3QDYv6yue8/wQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-visit-parents": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz", - "integrity": "sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg==", + "node_modules/remark-lint-link-title-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "@types/unist": "*" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "node_modules/remark-lint-link-title-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-link-title-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, "dependencies": { - "punycode": "^2.1.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/url-parse-lax": { + "node_modules/remark-lint-link-title-style/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "prepend-http": "^2.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">=4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/uvu": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.3.tgz", - "integrity": "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==", + "node_modules/remark-lint-link-title-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - }, - "bin": { - "uvu": "bin.js" + "@types/unist": "^3.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, - "node_modules/vfile": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.0.tgz", - "integrity": "sha512-Tj44nY/48OQvarrE4FAjUfrv7GZOYzPbl5OD65HxVKwLJKMPU7zmfV8cCgCnzKWnSfYG2f3pxu+ALqs7j22xQQ==", + "node_modules/remark-lint-link-title-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-lint-link-title-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-message": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.0.tgz", - "integrity": "sha512-4QJbBk+DkPEhBXq3f260xSaWtjE4gPKOfulzfMFF8ZNwaPZieWsg3iVlcmF04+eebzpcpeXOOFMfrYzJHVYg+g==", + "node_modules/remark-lint-link-title-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-reporter": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-7.0.3.tgz", - "integrity": "sha512-q+ruTWxFHbow359TDqoNJn5THdwRDeV+XUOtzdT/OESgaGw05CjL68ImlbzRzqS5xL62Y1IaIWb8x+RbaNjayA==", + "node_modules/remark-lint-list-item-bullet-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-5.0.1.tgz", + "integrity": "sha512-LKuTxkw5aYChzZoF3BkfaBheSCHs0T8n8dPHLQEuOLo6iC5wy98iyryz0KZ61GD8stlZgQO2KdWSdnP6vr40Iw==", "dev": true, + "license": "MIT", "dependencies": { - "@types/supports-color": "^8.0.0", - "string-width": "^5.0.0", - "supports-color": "^9.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-sort": "^3.0.0", - "vfile-statistics": "^2.0.0" + "@types/mdast": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-reporter/node_modules/supports-color": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.1.tgz", - "integrity": "sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-list-item-bullet-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-list-item-bullet-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-sort": { + "node_modules/remark-lint-list-item-bullet-indent/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-3.0.0.tgz", - "integrity": "sha512-fJNctnuMi3l4ikTVcKpxTbzHeCgvDhnI44amA3NVDvA6rTC6oKCFpCVyT5n2fFMr3ebfr+WVQZedOCd73rzSxg==", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "dependencies": { - "vfile-message": "^3.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-statistics": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-2.0.0.tgz", - "integrity": "sha512-foOWtcnJhKN9M2+20AOTlWi2dxNfAoeNIoxD5GXcO182UJyId4QrXa41fWrgcfV3FWTjdEDy3I4cpLVcQscIMA==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "dependencies": { - "vfile-message": "^3.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/weasel-words": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/weasel-words/-/weasel-words-0.1.1.tgz", - "integrity": "sha1-cTeUZYXHP+RIggE4U70ADF1oek4=", - "dev": true - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, "dependencies": { - "isexe": "^2.0.0" + "@types/unist": "^3.0.0" }, - "bin": { - "node-which": "bin/node-which" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-list-item-bullet-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "node_modules/remark-lint-list-item-content-indent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-content-indent/-/remark-lint-list-item-content-indent-4.0.1.tgz", + "integrity": "sha512-KSopxxp64O6dLuTQ2sWaTqgjKWr1+AoB1QCTektMJ3mfHfn0QyZzC2CZbBU22KGzBhiYXv9cIxlJlxUtq2NqHg==", "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/wrapped": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", - "integrity": "sha1-x4PZ2Aeyc+mwHoUWgKk4yHyQckI=", + "node_modules/remark-lint-list-item-content-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "dependencies": { - "co": "3.1.0", - "sliced": "^1.0.1" + "@types/unist": "*" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "node_modules/remark-lint-list-item-content-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "node_modules/write-good": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/write-good/-/write-good-1.0.8.tgz", - "integrity": "sha512-P1Ct7+DNrOcr2JAxDZ3Q5i5sx2LSveu7iLaoUL0A+YiG0GKf0l5+9j3rwMeyh6JeTL1+HfQV1rnwEvzhNIvpFw==", + "node_modules/remark-lint-list-item-content-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "dependencies": { - "adverb-where": "^0.2.2", - "commander": "^2.19.0", - "e-prime": "^0.10.4", - "no-cliches": "^0.3.0", - "passive-voice": "^0.1.0", - "too-wordy": "^0.3.1", - "weasel-words": "^0.1.1" - }, - "bin": { - "write-good": "bin/write-good.js", - "writegood": "bin/write-good.js" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, - "engines": { - "node": ">=6", - "npm": ">=5" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/zwitch": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz", - "integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==", + "node_modules/remark-lint-list-item-content-indent/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "type": "opencollective", + "url": "https://opencollective.com/unified" } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + }, + "node_modules/remark-lint-list-item-content-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "@babel/highlight": "^7.16.7" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "node_modules/remark-lint-list-item-content-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@babel/runtime": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", - "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "node_modules/remark-lint-list-item-content-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "regenerator-runtime": "^0.13.4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@babel/runtime-corejs3": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.16.8.tgz", - "integrity": "sha512-3fKhuICS1lMz0plI5ktOE/yEtBRMVxplzRkdn6mJQ197XiY0JnrzYV0+Mxozq3JZ8SBV9Ecurmw1XsGbwOf+Sg==", + "node_modules/remark-lint-list-item-content-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "core-js-pure": "^3.20.2", - "regenerator-runtime": "^0.13.4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@eslint/eslintrc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", - "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "node_modules/remark-lint-list-item-indent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-4.0.1.tgz", + "integrity": "sha512-gJd1Q+jOAeTgmGRsdMpnRh01DUrAm0O5PCQxE8ttv1QZOV015p/qJH+B4N6QSmcUuPokHLAh9USuq05C73qpiA==", "dev": true, - "peer": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.2.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, + "license": "MIT", "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - } + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@humanwhocodes/config-array": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", - "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "node_modules/remark-lint-list-item-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "dependencies": { + "@types/unist": "*" } }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, - "peer": true - }, - "@leichtgewicht/ip-codec": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz", - "integrity": "sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg==", - "dev": true - }, - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "node_modules/remark-lint-list-item-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "node_modules/remark-lint-list-item-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "defer-to-connect": "^1.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@types/concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "node_modules/remark-lint-list-item-indent/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "@types/node": "*" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "node_modules/remark-lint-list-item-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "@types/ms": "*" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@types/estree": { - "version": "0.0.50", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", - "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", - "dev": true - }, - "@types/estree-jsx": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-0.0.1.tgz", - "integrity": "sha512-gcLAYiMfQklDCPjQegGn0TBAn9it05ISEsEhlKQUddIk7o2XDokOcTN7HBO8tznM0D9dGezvHEfRZBfZf6me0A==", + "node_modules/remark-lint-list-item-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "@types/estree": "*" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@types/is-empty": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@types/is-empty/-/is-empty-1.2.1.tgz", - "integrity": "sha512-a3xgqnFTuNJDm1fjsTjHocYJ40Cz3t8utYpi5GNaxzrJC2HSD08ym+whIL7fNqiqBCdM9bcqD1H/tORWAFXoZw==", - "dev": true - }, - "@types/js-yaml": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.5.tgz", - "integrity": "sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==", - "dev": true - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "node_modules/remark-lint-list-item-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "@types/mdast": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz", - "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==", + "node_modules/remark-lint-list-item-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "@types/unist": "*" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", - "dev": true + "node_modules/remark-lint-list-item-spacing": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-spacing/-/remark-lint-list-item-spacing-5.0.0.tgz", + "integrity": "sha512-d6p+1tcwNE+Pp6Tu2DwiKlyC1zYY3f1igL6AlcBIH0RmROVEfZR4IDFH/LcVyTkzqh1lPMFAJXWK4bpScpcO3g==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "@types/nlcst": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.0.tgz", - "integrity": "sha512-3TGCfOcy8R8mMQ4CNSNOe3PG66HttvjcLzCoOpvXvDtfWOTi+uT/rxeOKm/qEwbM4SNe1O/PjdiBK2YcTjU4OQ==", + "node_modules/remark-lint-list-item-spacing/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { + "dependencies": { "@types/unist": "*" } }, - "@types/node": { - "version": "17.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz", - "integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==", - "dev": true - }, - "@types/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw==", - "dev": true - }, - "@types/text-table": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@types/text-table/-/text-table-0.2.2.tgz", - "integrity": "sha512-dGoI5Af7To0R2XE8wJuc6vwlavWARsCh3UKJPjWs1YEqGUqfgBI/j/4GX0yf19/DsDPPf0YAXWAp8psNeIehLg==", - "dev": true - }, - "@types/unist": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", + "node_modules/remark-lint-list-item-spacing/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "peer": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "node_modules/remark-lint-list-item-spacing/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": {} - }, - "adverb-where": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/adverb-where/-/adverb-where-0.2.5.tgz", - "integrity": "sha512-JiQe2U1UR8l10jPrXv/PmlDhOLZpsxqjvTp+k6Dm5wYDUULdMZytDRmovkXU8X6V9o0sg0FBdetv3VXHAZZK5Q==", - "dev": true + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "node_modules/remark-lint-list-item-spacing/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/remark-lint-list-item-spacing/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "node_modules/remark-lint-list-item-spacing/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "ansi-regex": { + "node_modules/remark-lint-list-item-spacing/node_modules/vfile": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "color-convert": "^2.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "node_modules/remark-lint-list-item-spacing/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "aria-query": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", - "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "node_modules/remark-lint-maximum-heading-length": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-heading-length/-/remark-lint-maximum-heading-length-4.1.1.tgz", + "integrity": "sha512-99yonukJ+e0uhx0zGH4uq6H9mhO7FA1ufmuToODH1N+X3ja61Grvlvvlq9UbP9+gbfbWgN97QGKPaTlE29FpaQ==", "dev": true, - "peer": true, - "requires": { - "@babel/runtime": "^7.10.2", - "@babel/runtime-corejs3": "^7.10.2" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "node_modules/remark-lint-maximum-heading-length/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", - "is-string": "^1.0.7" + "dependencies": { + "@types/unist": "*" } }, - "array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "node_modules/remark-lint-maximum-heading-length/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-maximum-heading-length/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "array.prototype.flatmap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz", - "integrity": "sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA==", + "node_modules/remark-lint-maximum-heading-length/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "node_modules/remark-lint-maximum-heading-length/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "axe-core": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz", - "integrity": "sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA==", + "node_modules/remark-lint-maximum-heading-length/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "axobject-query": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", - "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", + "node_modules/remark-lint-maximum-heading-length/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true - }, - "bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", - "dev": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "node_modules/remark-lint-maximum-heading-length/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true + "node_modules/remark-lint-maximum-heading-length/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/remark-lint-maximum-line-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-4.0.1.tgz", + "integrity": "sha512-hQlh8UrRfhkO4FU7z7t1Bu5ethj1y2iBncO5AOWF38RAmlHaZdB2lQxNA8IvUZITGJYpT1aThdFTEf+58lv08Q==", "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/remark-lint-maximum-line-length/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "fill-range": "^7.0.1" + "dependencies": { + "@types/unist": "*" } }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "node_modules/remark-lint-maximum-line-length/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "builtins": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-4.0.0.tgz", - "integrity": "sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw==", + "node_modules/remark-lint-maximum-line-length/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "semver": "^7.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "node_modules/remark-lint-maximum-line-length/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, "dependencies": { - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true - }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "character-entities": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.1.tgz", - "integrity": "sha512-OzmutCf2Kmc+6DrFrrPS8/tDh2+DpnrfzdICHWhcVC9eOd0N1PXmQEE1a8iM4IziIAG+8tmTq3K+oo0ubH6RRQ==", - "dev": true - }, - "check-links": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/check-links/-/check-links-1.1.8.tgz", - "integrity": "sha512-lxt1EeQ1CVkmiZzPfbPufperYK0t7MvhdLs3zlRH9areA6NVT1tcGymAdJONolNWQBdCFU/sek59RpeLmVHCnw==", + "node_modules/remark-lint-maximum-line-length/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "got": "^9.6.0", - "is-relative-url": "^2.0.0", - "p-map": "^2.0.0", - "p-memoize": "^2.1.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "node_modules/remark-lint-maximum-line-length/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "node_modules/remark-lint-no-blockquote-without-marker": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-6.0.1.tgz", + "integrity": "sha512-b4IOkNcG7C16HYAdKUeAhO7qPt45m+v7SeYbVrqvbSFtlD3EUBL8fgHRgLK1mdujFXDP1VguOEMx+Txv8JOT4w==", "dev": true, - "requires": { - "mimic-response": "^1.0.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-directive": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "co": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", - "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=", - "dev": true - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "color-name": "~1.1.4" + "dependencies": { + "@types/unist": "*" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "core-js-pure": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.2.tgz", - "integrity": "sha512-CmWHvSKn2vNL6p6StNp1EmMIfVY/pqn3JLAjfZQ8WZGPOlGoO92EkX9/Mk81i6GxvoPXjUqEQnpM3rJ5QxxIOg==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "damerau-levenshtein": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", - "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "ms": "2.1.2" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "decode-named-character-reference": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.1.tgz", - "integrity": "sha512-YV/0HQHreRwKb7uBopyIkLG17jG6Sv2qUchk9qSoVJ2f+flwRsPNBO0hAnjt6mTNYUT+vw9Gy2ihXg4sUWPi2w==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "character-entities": "^2.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "node_modules/remark-lint-no-consecutive-blank-lines": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-5.0.1.tgz", + "integrity": "sha512-yLtYCrEBtGDao4ozmZruRzjMYAcBVFK69PoYjPfNwFO8pQ/LPt8KCq6oyg1ronNyRbDYEGqVdLIHcT/zL3LjPA==", "dev": true, - "requires": { - "mimic-response": "^1.0.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-directive": "^3.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "object-keys": "^1.0.12" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "dequal": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", - "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", - "dev": true + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "diff": { + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-position": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "dns-packet": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.3.1.tgz", - "integrity": "sha512-spBwIj0TK0Ey3666GwIdWVfUpLyubpU53BTCu8iPn4r4oXd9O14Hjg3EHw3ts2oed77/SeckunUYCyRlSngqHw==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "@leichtgewicht/ip-codec": "^2.0.1" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "dns-socket": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/dns-socket/-/dns-socket-4.2.2.tgz", - "integrity": "sha512-BDeBd8najI4/lS00HSKpdFia+OvUMytaVjfzR9n5Lq8MlZRSvtbI+uLtx1+XmQFls5wFU9dssccTmQQ6nfpjdg==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "dns-packet": "^5.2.4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true + "node_modules/remark-lint-no-dead-urls": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-2.0.1.tgz", + "integrity": "sha512-8+uY2GWENktvnTnmDHsAW/DxuPiAmZiKoW5HGuCrGmlqEVh4jPZJ2IGbQgfpyrMKIwp32NYo7Jt+aKb52QJ6sQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "dead-or-alive": "^1.0.0", + "devlop": "^1.0.0", + "is-online": "^11.0.0", + "p-all": "^5.0.0", + "p-limit": "^6.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "e-prime": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/e-prime/-/e-prime-0.10.4.tgz", - "integrity": "sha512-tzBmM2mFSnAq5BuxPSyin6qXb3yMe1wufJN7L7ZPcEWS5S+jI2dhKQEoqHVEcSMMXo/j5lcWpX5jzA6wLSmX6w==", + "node_modules/remark-lint-no-dead-urls/node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-dead-urls/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/remark-lint-no-dead-urls/node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", "dev": true, - "requires": { - "once": "^1.4.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "node_modules/remark-lint-no-dead-urls/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "ansi-colors": "^4.1.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/remark-lint-no-dead-urls/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "is-arrayish": "^0.2.1" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "node_modules/remark-lint-no-dead-urls/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/remark-lint-no-dead-urls/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "dev": true, - "peer": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/remark-lint-no-dead-urls/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "eslint": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", - "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "node_modules/remark-lint-no-duplicate-definitions": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-4.0.1.tgz", + "integrity": "sha512-Ek+A/xDkv5Nn+BXCFmf+uOrFSajCHj6CjhsHjtROgVUeEPj726yYekDBoDRA0Y3+z+U30AsJoHgf/9Jj1IFSug==", "dev": true, - "peer": true, - "requires": { - "@eslint/eslintrc": "^1.0.5", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.3.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.2.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-duplicate-definitions/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "peer": true - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "peer": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "peer": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } + "@types/unist": "*" } }, - "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-duplicate-definitions/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "debug": "^3.2.7", - "resolve": "^1.20.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-duplicate-definitions/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "peer": true, - "requires": { - "ms": "^2.1.1" - } - } + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-module-utils": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", - "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, - "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "dependencies": { + "@types/unist": "^3.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-duplicate-definitions/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "peer": true, - "requires": { - "ms": "^2.1.1" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "peer": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "peer": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "peer": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "peer": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "peer": true - } + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", - "has": "^1.0.3", - "is-core-module": "^2.8.0", - "is-glob": "^4.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" - }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "peer": true, - "requires": { - "ms": "2.0.0" - } - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "peer": true - } + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-plugin-jsx-a11y": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz", - "integrity": "sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g==", + "node_modules/remark-lint-no-duplicate-headings": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-headings/-/remark-lint-no-duplicate-headings-4.0.1.tgz", + "integrity": "sha512-6lggqnpIe5FepikjYF2me3ovKV4oD/rAz8WmwVbLR2cLkce1iH+PB7jyxk/A2gQQqrDcIlRMA5Ct2Yj56cEwhQ==", "dev": true, - "peer": true, - "requires": { - "@babel/runtime": "^7.16.3", - "aria-query": "^4.2.2", - "array-includes": "^3.1.4", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.3.5", - "axobject-query": "^2.2.0", - "damerau-levenshtein": "^1.0.7", - "emoji-regex": "^9.2.2", - "has": "^1.0.3", - "jsx-ast-utils": "^3.2.1", - "language-tags": "^1.0.5", - "minimatch": "^3.0.4" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-plugin-react": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz", - "integrity": "sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "array-includes": "^3.1.4", - "array.prototype.flatmap": "^1.2.5", - "doctrine": "^2.1.0", - "estraverse": "^5.3.0", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.0.4", - "object.entries": "^1.1.5", - "object.fromentries": "^2.0.5", - "object.hasown": "^1.1.0", - "object.values": "^1.1.5", - "prop-types": "^15.7.2", - "resolve": "^2.0.0-next.3", - "semver": "^6.3.0", - "string.prototype.matchall": "^4.0.6" - }, "dependencies": { - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "peer": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "resolve": { - "version": "2.0.0-next.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", - "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", - "dev": true, - "peer": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "peer": true - } + "@types/unist": "*" } }, - "eslint-plugin-react-hooks": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz", - "integrity": "sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-duplicate-headings/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, - "peer": true, - "requires": {} + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "eslint-scope": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", - "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-utils": { + "node_modules/remark-lint-no-duplicate-headings/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - } + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "espree": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", - "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.1.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "node_modules/remark-lint-no-duplicate-headings/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.1.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/remark-lint-no-emphasis-as-heading": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-emphasis-as-heading/-/remark-lint-no-emphasis-as-heading-4.0.1.tgz", + "integrity": "sha512-zzI/C330qdKO9FB3h6IUtOG36FSrS5nfJ7qxp0atXGYtHyg+Ag7dPC/0FzchOVsxofQm0QTstVoIARt/9TiN5g==", "dev": true, - "peer": true, - "requires": { - "estraverse": "^5.2.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "peer": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "extend": { + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/@types/unist": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "fault": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", - "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "format": "^0.2.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "file-entry-cache": { + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/vfile": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "flat-cache": "^3.0.4" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/remark-lint-no-emphasis-as-heading/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "to-regex-range": "^5.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/remark-lint-no-empty-sections": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-empty-sections/-/remark-lint-no-empty-sections-4.0.0.tgz", + "integrity": "sha512-Tx1nCu7Dq3dsJ500402sSvM0uVK/6khSuEjx8K8u9aHN+Y4vjL6h88xVzdzCmZq2J2yqyFnvMjG1y7lQv+DRvg==", "dev": true, - "requires": { - "locate-path": "^3.0.0" + "dependencies": { + "mdast-util-to-string": "^1.0.2", + "unified-lint-rule": "^1.0.0", + "unist-util-visit": "^1.0.0" } }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "node_modules/remark-lint-no-empty-sections/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", "dev": true, - "peer": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "flatted": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "node_modules/remark-lint-no-empty-sections/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", "dev": true, - "peer": true - }, - "format": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", - "integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=", - "dev": true + "dependencies": { + "wrapped": "^1.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", "dev": true }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "peer": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", "dev": true, - "peer": true + "dependencies": { + "unist-util-visit-parents": "^2.0.0" + } }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "node_modules/remark-lint-no-empty-sections/node_modules/unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", "dev": true, - "peer": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "dependencies": { + "unist-util-is": "^3.0.0" } }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/remark-lint-no-empty-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-empty-url/-/remark-lint-no-empty-url-4.0.1.tgz", + "integrity": "sha512-FSQIO+Q63kNNSUfbvvWPz6ES4q1gJIc4aMjohch9bfKwcv6wWZc6UkjlMMi823I124p6onrY/F8KKECv06H5YQ==", "dev": true, - "requires": { - "pump": "^3.0.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "node_modules/remark-lint-no-empty-url/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "dependencies": { + "@types/unist": "*" } }, - "github-slugger": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", - "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", + "node_modules/remark-lint-no-empty-url/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "node_modules/remark-lint-no-empty-url/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/remark-lint-no-empty-url/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "is-glob": "^4.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "globals": { - "version": "13.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", - "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "node_modules/remark-lint-no-empty-url/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" + "dependencies": { + "@types/unist": "^3.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-empty-url/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, "dependencies": { - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - } + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "node_modules/remark-lint-no-empty-url/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/remark-lint-no-file-name-articles": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-3.0.1.tgz", + "integrity": "sha512-h31ZDDJV2T6g9WLBrXg1CJ1m8M170O/tlDPAEPGCa/rxwKvMcfum4yicaot0ZKbUZ1uEPjVSUPDeo3sU0zciCQ==", "dev": true, - "peer": true, - "requires": { - "function-bind": "^1.1.1" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "node_modules/remark-lint-no-file-name-articles/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/remark-lint-no-file-name-articles/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "node_modules/remark-lint-no-file-name-articles/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "node_modules/remark-lint-no-file-name-articles/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "has-symbols": "^1.0.2" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "node_modules/remark-lint-no-file-name-articles/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "lru-cache": "^6.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/remark-lint-no-file-name-articles/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "import-meta-resolve": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz", - "integrity": "sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==", + "node_modules/remark-lint-no-file-name-articles/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "builtins": "^4.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "node_modules/remark-lint-no-file-name-consecutive-dashes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-3.0.1.tgz", + "integrity": "sha512-qGJRZ81sowEjv1dBodbHZ29pDZbrFpxiQQ6gBvkkHkkoYPekdnr8iUxmV38HcqH8+JNW1O4ELr+m71AA9/34Mw==", "dev": true, - "peer": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" + "dependencies": { + "@types/unist": "*" } }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", - "dev": true - }, - "is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "has-bigints": "^1.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "binary-extensions": "^2.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true - }, - "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "node_modules/remark-lint-no-file-name-irregular-characters": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-irregular-characters/-/remark-lint-no-file-name-irregular-characters-3.0.1.tgz", + "integrity": "sha512-kNm16eDnPqbN05W0RLIedHi40YzHf1esPHbNKv12AljKWptdCTS72uGjAbqUSZ48dRoKtJzL0HJ0OAqXIWUyxA==", "dev": true, - "peer": true, - "requires": { - "has": "^1.0.3" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "has-tostringtag": "^1.0.0" + "dependencies": { + "@types/unist": "*" } }, - "is-empty": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-empty/-/is-empty-1.2.0.tgz", - "integrity": "sha1-3pu1snhzigWgsJpX4ftNSjQan2s=", + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "is-extglob": "^2.1.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-ip": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", - "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "ip-regex": "^4.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "node_modules/remark-lint-no-file-name-irregular-characters/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "node_modules/remark-lint-no-file-name-mixed-case": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-mixed-case/-/remark-lint-no-file-name-mixed-case-3.0.1.tgz", + "integrity": "sha512-cXVY0gM6DIHHK+mUhQVZ/WLh4cNfzEDpM54LNJBnflR9n9r6eNLR3JlWFRviTL4xRrQ5FXisBSlBa87BquiFVA==", "dev": true, - "peer": true, - "requires": { - "has-tostringtag": "^1.0.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-online": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/is-online/-/is-online-8.5.1.tgz", - "integrity": "sha512-RKyTQx/rJqw2QOXHwy7TmXdlkpe0Hhj7GBsr6TQJaj4ebNOfameZCMspU5vYbwBBzJ2brWArdSvNVox6T6oCTQ==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "got": "^9.6.0", - "p-any": "^2.0.0", - "p-timeout": "^3.0.0", - "public-ip": "^4.0.1" + "dependencies": { + "@types/unist": "*" } }, - "is-plain-obj": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", - "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-relative-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-relative-url/-/is-relative-url-2.0.0.tgz", - "integrity": "sha1-cpAtf+BLPUeS59sV+duEtyBMnO8=", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "is-absolute-url": "^2.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "has-tostringtag": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "node_modules/remark-lint-no-file-name-mixed-case/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "has-symbols": "^1.0.2" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/remark-lint-no-file-name-outer-dashes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-3.0.1.tgz", + "integrity": "sha512-QIMrBPZKZ6BwQRPM65HhEHcJv6+wZnZ4z2ikvx2ht40cSmIN7ZTL7wKKJlnpF+4Ioi9XUj+cRHWqEhwJ9LCQIw==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "argparse": "^2.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "json-buffer": { + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "minimist": "^1.2.5" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "jsx-ast-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", - "integrity": "sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA==", + "node_modules/remark-lint-no-heading-content-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-5.0.1.tgz", + "integrity": "sha512-YIWktnZo7M9aw7PGnHdshvetSH3Y0qW+Fm143R66zsk5lLzn1XA5NEd/MtDzP8tSxxV+gcv+bDd5St1QUI4oSQ==", "dev": true, - "peer": true, - "requires": { - "array-includes": "^3.1.3", - "object.assign": "^4.1.2" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "json-buffer": "3.0.0" + "dependencies": { + "@types/unist": "*" } }, - "kleur": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", - "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "language-subtag-registry": { - "version": "0.3.21", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", - "integrity": "sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", + "node_modules/remark-lint-no-heading-content-indent/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "language-subtag-registry": "~0.3.2" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "levenshtein-edit-distance": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/levenshtein-edit-distance/-/levenshtein-edit-distance-1.0.0.tgz", - "integrity": "sha1-iVuvR4zOi1waDSfkXXwdl4pmHkk=", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "peer": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "libnpmconfig": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", - "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "figgy-pudding": "^3.5.1", - "find-up": "^3.0.0", - "ini": "^1.3.5" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "lines-and-columns": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", - "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", - "dev": true - }, - "load-plugin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-4.0.1.tgz", - "integrity": "sha512-4kMi+mOSn/TR51pDo4tgxROHfBHXsrcyEYSGHcJ1o6TtRaP2PsRM5EwmYbj1uiLDvbfA/ohwuSWZJzqGiai8Dw==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "import-meta-resolve": "^1.0.0", - "libnpmconfig": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "node_modules/remark-lint-no-heading-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-5.0.1.tgz", + "integrity": "sha512-R/KkR9Qfh0AM3asadSnQQXMHu6BNZxPbxLI9h9JBPIZM+EtzycDlhaAHbOlQUdaHA5UEANhYENZBLrueH50Cdg==", "dev": true, - "peer": true - }, - "longest-streak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.1.tgz", - "integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==", - "dev": true + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "node_modules/remark-lint-no-heading-indent/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" + "dependencies": { + "@types/unist": "*" } }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "node_modules/remark-lint-no-heading-indent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/remark-lint-no-heading-indent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "yallist": "^4.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "node_modules/remark-lint-no-heading-indent/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "p-defer": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-comment-marker": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.1.0.tgz", - "integrity": "sha512-/+Cfm8A83PjkqjQDB9iYqHESGuXlriCWAwRGPJjkYmxXrF4r6saxeUlOKNrf+SogTwg9E8uyHRCFHLG6/BAAdA==", + "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "mdast-util-mdx-expression": "^1.1.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-from-markdown": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz", - "integrity": "sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q==", + "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-frontmatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-1.0.0.tgz", - "integrity": "sha512-7itKvp0arEVNpCktOET/eLFAYaZ+0cNjVtFtIPxgQ5tV+3i+D4SDDTjTzPWl44LT59PC+xdx+glNTawBdF98Mw==", + "node_modules/remark-lint-no-heading-indent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "micromark-extension-frontmatter": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-heading-style": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-2.0.0.tgz", - "integrity": "sha512-q9+WW2hJduW51LgV2r/fcU5wIt2GLFf0yYHxyi0f2aaxnC63ErBSOAJlhP6nbQ6yeG5rTCozbwOi4QNDPKV0zw==", + "node_modules/remark-lint-no-heading-indent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "@types/mdast": "^3.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-mdx-expression": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.1.1.tgz", - "integrity": "sha512-RDLRkBFmBKCJl6/fQdxxKL2BqNtoPFoNBmQAlj5ZNKOijIWRKjdhPkeufsUOaexLj+78mhJc+L7d1MYka8/LdQ==", + "node_modules/remark-lint-no-heading-like-paragraph": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-like-paragraph/-/remark-lint-no-heading-like-paragraph-4.0.1.tgz", + "integrity": "sha512-1sscTjv/F/mK5cNThz6fu57xcLgLdB0rl9vJ3BEwh7U4V5cIKp1tdFQhaguweSBnKCjCVaiU7HsEdle01Ai07Q==", "dev": true, - "requires": { - "@types/estree-jsx": "^0.0.1" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-to-markdown": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.2.6.tgz", - "integrity": "sha512-doJZmTEGagHypWvJ8ltinmwUsT9ZaNgNIQW6Gl7jNdsI1QZkTHTimYW561Niy2s8AEPAqEgV0dIh2UOVlSXUJA==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "longest-streak": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "micromark-util-decode-string": "^1.0.0", - "unist-util-visit": "^4.0.0", - "zwitch": "^2.0.0" + "dependencies": { + "@types/unist": "*" } }, - "mdast-util-to-nlcst": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-nlcst/-/mdast-util-to-nlcst-5.2.1.tgz", - "integrity": "sha512-Xznpj85MsJnLQjBboajOovT2fAAvbbbmYutpFgzLi9pjZEOkgGzjq+t6fHcge8uzZ5uEkj5pigzw2QrnIVq/kw==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "@types/nlcst": "^1.0.0", - "@types/unist": "^2.0.0", - "nlcst-to-string": "^3.0.0", - "unist-util-position": "^4.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0" - }, "dependencies": { - "nlcst-to-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.0.tgz", - "integrity": "sha512-Y8HQWKw/zrHTCnu2zcFBN1dV6vN0NUG7s5fkEj380G8tF3R+vA2KG+tDl2QoHVQCTHGHVXwoni2RQkDSFQb1PA==", - "dev": true, - "requires": { - "@types/nlcst": "^1.0.0" - } - } + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "mdast-util-to-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", - "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==", - "dev": true - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - } + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.0.10.tgz", - "integrity": "sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-core-commonmark": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz", - "integrity": "sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-extension-frontmatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-1.0.0.tgz", - "integrity": "sha512-EXjmRnupoX6yYuUJSQhrQ9ggK0iQtQlpi6xeJzVD5xscyAI+giqco5fdymayZhJMbIFecjnE2yz85S9NzIgQpg==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "fault": "^2.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-factory-destination": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", - "integrity": "sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw==", + "node_modules/remark-lint-no-heading-like-paragraph/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-factory-label": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz", - "integrity": "sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==", + "node_modules/remark-lint-no-heading-punctuation": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-punctuation/-/remark-lint-no-heading-punctuation-4.0.0.tgz", + "integrity": "sha512-7V23C3Q4yX9zEOLZdbv6o8wVxxeWB/F+h9by55zPyk2AwbqF2t2xevnAmN3XFmKZABDTqLwjQxtK6bCVv/S1PQ==", "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-factory-space": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz", - "integrity": "sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "*" } }, - "micromark-factory-title": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz", - "integrity": "sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-heading-punctuation/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, - "requires": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-factory-whitespace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz", - "integrity": "sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.1.0.tgz", - "integrity": "sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-chunked": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz", - "integrity": "sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-classify-character": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz", - "integrity": "sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-combine-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz", - "integrity": "sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==", + "node_modules/remark-lint-no-heading-punctuation/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-decode-numeric-character-reference": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz", - "integrity": "sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==", + "node_modules/remark-lint-no-literal-urls": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-4.0.1.tgz", + "integrity": "sha512-RhTANFkFFXE6bM+WxWcPo2TTPEfkWG3lJZU50ycW7tJJmxUzDNzRed/z80EVJIdGwFa0NntVooLUJp3xrogalQ==", "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-decode-string": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz", - "integrity": "sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==", + "node_modules/remark-lint-no-literal-urls/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "dependencies": { + "@types/unist": "*" } }, - "micromark-util-encode": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz", - "integrity": "sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==", - "dev": true - }, - "micromark-util-html-tag-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.0.0.tgz", - "integrity": "sha512-NenEKIshW2ZI/ERv9HtFNsrn3llSPZtY337LID/24WeLqMzeZhBEE6BQ0vS2ZBjshm5n40chKtJ3qjAbVV8S0g==", + "node_modules/remark-lint-no-literal-urls/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "micromark-util-normalize-identifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz", - "integrity": "sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==", + "node_modules/remark-lint-no-literal-urls/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, - "requires": { - "micromark-util-symbol": "^1.0.0" + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-resolve-all": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz", - "integrity": "sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==", + "node_modules/remark-lint-no-literal-urls/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "micromark-util-types": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-sanitize-uri": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz", - "integrity": "sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg==", + "node_modules/remark-lint-no-literal-urls/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-subtokenize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz", - "integrity": "sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==", + "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "micromark-util-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz", - "integrity": "sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==", - "dev": true - }, - "micromark-util-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.0.2.tgz", - "integrity": "sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==", - "dev": true - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true + "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true + "node_modules/remark-lint-no-literal-urls/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "node_modules/remark-lint-no-literal-urls/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "brace-expansion": "^1.1.7" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "node_modules/remark-lint-no-multiple-toplevel-headings": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-4.0.1.tgz", + "integrity": "sha512-8sepobIOu3PlDOuMH7jtri+LH4tFNVQU+aqKSkrlNRdp831fYz9S+jA2crTVqWqxVbTwiF96uJWePv8/9qmHnA==", "dev": true, - "peer": true - }, - "nlcst-to-string": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-2.0.4.tgz", - "integrity": "sha512-3x3jwTd6UPG7vi5k4GEzvxJ5rDA7hVUIRNHPblKuMVP9Z3xmlsd9cgLcpAMkc5uPOBna82EeshROFhsPkbnTZg==", - "dev": true + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "no-cliches": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/no-cliches/-/no-cliches-0.3.4.tgz", - "integrity": "sha512-oUqnng1vhKLaA4GR+OzVbLuZZ7OOguKCtMHxHMiyP8+9mXidKfoCyc030LbAyNI3xcgCHHyitK3Q8wP+w6DwVQ==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": {} - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", - "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", - "dev": true + "dependencies": { + "@types/unist": "*" + } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", - "dev": true, - "peer": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "peer": true - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.entries": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", - "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "object.fromentries": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", - "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "object.hasown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", - "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "wrappy": "1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "node_modules/remark-lint-no-reference-like-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-reference-like-url/-/remark-lint-no-reference-like-url-4.0.1.tgz", + "integrity": "sha512-GXS73779bPnJSqvCfOK2XzGzCWL5ggyk53KE049oOYTS55vmc26PjeW+ykbGfXIazRazZ1DLGaAqNoU9jCnZ4w==", "dev": true, - "peer": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-any": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-any/-/p-any-2.1.0.tgz", - "integrity": "sha512-JAERcaMBLYKMq+voYw36+x5Dgh47+/o7yuv2oQYuSSUml4YeqJEFznBrY2UeEkoSHqBua6hz518n/PsowTYLLg==", + "node_modules/remark-lint-no-reference-like-url/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "requires": { - "p-cancelable": "^2.0.0", - "p-some": "^4.0.0", - "type-fest": "^0.3.0" - }, "dependencies": { - "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true - } + "@types/unist": "*" } }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "node_modules/remark-lint-no-reference-like-url/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/remark-lint-no-reference-like-url/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "p-try": "^2.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-locate": { + "node_modules/remark-lint-no-reference-like-url/node_modules/unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "p-limit": "^2.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "p-memoize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-memoize/-/p-memoize-2.1.0.tgz", - "integrity": "sha512-c6+a2iV4JyX0r4+i2IBJYO0r6LZAT2fg/tcB6GQbv1uzZsfsmKT7Ej5DRT1G6Wi7XUJSV2ZiP9+YEtluvhCmkg==", + "node_modules/remark-lint-no-reference-like-url/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "requires": { - "mem": "^4.0.0", - "mimic-fn": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-some": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-some/-/p-some-4.1.0.tgz", - "integrity": "sha512-MF/HIbq6GeBqTrTIl5OJubzkGU+qfFhAFi0gnTAK6rgEIJIknEiABHOTtQu4e6JiXjIwuMPMUFQzyHh5QjCl1g==", + "node_modules/remark-lint-no-reference-like-url/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "aggregate-error": "^3.0.0", - "p-cancelable": "^2.0.0" - }, "dependencies": { - "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true - } + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "node_modules/remark-lint-no-reference-like-url/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "p-finally": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "node_modules/remark-lint-no-reference-like-url/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true, - "requires": { - "callsites": "^3.0.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "parse-json": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-6.0.2.tgz", - "integrity": "sha512-SA5aMiaIjXkAiBrW/yPgLgQAQg42f7K3ACO+2l/zOvtQBwX58DMUsFJXelW2fx3yMBmWOVkR6j1MGsdSbCA4UA==", + "node_modules/remark-lint-no-repeat-punctuation": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/remark-lint-no-repeat-punctuation/-/remark-lint-no-repeat-punctuation-0.1.4.tgz", + "integrity": "sha512-JJduCs4FimdBcR1AB576SqIYOjt+7t8OjTnnlZMvjnw7lzkuL0+nNNHyNXVPaK6jxaLjEUhrH2/smU6vZFUT7g==", "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "error-ex": "^1.3.2", - "json-parse-even-better-errors": "^2.3.1", - "lines-and-columns": "^2.0.2" + "dependencies": { + "unified-lint-rule": "^1.0.3", + "unist-util-map": "^1.0.4", + "unist-util-to-list-of-char": "^0.1.3" } }, - "passive-voice": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/passive-voice/-/passive-voice-0.1.0.tgz", - "integrity": "sha1-Fv+RrkC6DpLEPmcXY/3IQqcCcLE=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/remark-lint-no-repeat-punctuation/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", "dev": true, - "peer": true + "dependencies": { + "wrapped": "^1.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "node_modules/remark-lint-no-shell-dollars": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-4.0.1.tgz", + "integrity": "sha512-UPE1DNCIkLtnS3YFD065Gkq5lQqfndBDpX8Ct/Zjn7M0/hzCyf9B6tpwCU0I20m9jzhS/CSY6mxYnAiEg+KkFA==", "dev": true, - "peer": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "collapse-white-space": "^2.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "node_modules/remark-lint-no-shell-dollars/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "node_modules/remark-lint-no-shell-dollars/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "node_modules/remark-lint-no-shell-dollars/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "node_modules/remark-lint-no-shell-dollars/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "peer": true, - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "propose": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/propose/-/propose-0.0.5.tgz", - "integrity": "sha1-SKBl2ex9TIZn9AULFcSi2F28pWs=", + "node_modules/remark-lint-no-shell-dollars/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "requires": { - "levenshtein-edit-distance": "^1.0.0" + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "public-ip": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/public-ip/-/public-ip-4.0.4.tgz", - "integrity": "sha512-EJ0VMV2vF6Cu7BIPo3IMW1Maq6ME+fbR0NcPmqDfpfNGIRPue1X8QrGjrg/rfjDkOsIkKHIf2S5FlEa48hFMTA==", + "node_modules/remark-lint-no-shell-dollars/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "requires": { - "dns-socket": "^4.2.2", - "got": "^9.6.0", - "is-ip": "^3.1.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "node_modules/remark-lint-no-shell-dollars/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "node_modules/remark-lint-no-shortcut-reference-image": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-4.0.1.tgz", + "integrity": "sha512-hQhJ3Dr8ZWRdj7qm6+9vcPpqtGchhENA2UHOmcTraLf6dN1cFATCgY/HbTbRIN6NkG/EEClTgRC1QCokWR2Mmw==", "dev": true, - "peer": true + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "*" + } }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, - "requires": { - "picomatch": "^2.2.1" + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "regexp.prototype.flags": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", - "integrity": "sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, - "peer": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, - "peer": true + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "remark": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/remark/-/remark-14.0.2.tgz", - "integrity": "sha512-A3ARm2V4BgiRXaUo5K0dRvJ1lbogrbXnhkJRmD0yw092/Yl0kOCZt1k9ZeElEwkZsWGsMumz6qL5MfNJH9nOBA==", + "node_modules/remark-lint-no-shortcut-reference-link": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-4.0.0.tgz", + "integrity": "sha512-6jka2Zz3I6G2MvDcKrwADYhTOxHMFMK854u1cfBEIH5/XnCCXROtoqiiDtbZw+NJqbmwsBKvGL4t2gnmEJUmgg==", "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "remark-parse": "^10.0.0", - "remark-stringify": "^10.0.0", - "unified": "^10.0.0" + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-5.0.1.tgz", + "integrity": "sha512-LHw9MGsuilM+3HkbRFZmdSE4T+sziaQzULH5ImYkLH2MLF8GKnAm2mgtveLZcW01wqFV2oEbpF1Y/s/QloXT7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-table-indentation/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-table-indentation/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-4.0.1.tgz", + "integrity": "sha512-+lhGUgY3jhTwWn1x+tTIJNy5Fbs2NcYXCobRY7xeszY0VKPCBF2GyELafOVnr+iTmosXLuhZPp5YwNezQKH9IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "vfile-location": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-tabs/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-tabs/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-5.0.0.tgz", + "integrity": "sha512-O0q8bHpRHK1T85oqO+uep4BkvQnZZp3y+wahDeeLLq9dCJfF56sq6Tt5OOTt1BAOZlpobS3OPQHUiJWYP6hX1w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-undefined-references/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-undefined-references/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-4.0.2.tgz", + "integrity": "sha512-KRzPmvfq6b3LSEcAQZobAn+5eDfPTle0dPyDEywgPSc3E7MIdRZQenL9UL8iIqHQWK4FvdUD0GX8FXGqu5EuCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-no-unused-definitions/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-4.0.1.tgz", + "integrity": "sha512-vZTAbstcBPbGwJacwldGzdGmKwy5/4r29SZ9nQkME4alEl5B1ReSBlYa8t7QnTSW7+tqvA9Sg71RPadgAKWa4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-4.0.1.tgz", + "integrity": "sha512-HQb1MrArvApREC1/I6bkiFlZVDjngsuII29n8E8StnAaHOMN3hVYy6wJ9Uk+O3+X9O8v7fDsZPqFUHSfJhERXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-ordered-list-marker-value/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-4.0.1.tgz", + "integrity": "sha512-gl1Ft13oTS3dJUCsWZzxD/5dAwI1HON67KU7uNfODD5gXJ8Y11deOWbun190ma7XbYdD7P0l8VT2HeRtEQzrWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-rule-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-rule-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-4.0.1.tgz", + "integrity": "sha512-KaGtj/OWEP4eoafevnlp3NsEVwC7yGEjBJ6uFMzfjNoXyjATdfZ2euB/AfKVt/A/FdZeeMeVoAUFH4DL+hScLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-strong-marker/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-5.1.1.tgz", + "integrity": "sha512-6fgVA1iINBoAJaZMOnSsxrF9Qj9+hmCqrsrqZqgJJETjT1ODGH64iAN1/6vHR7dIwmy73d6ysB2WrGyKhVlK3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-table-cell-padding/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipe-alignment/-/remark-lint-table-pipe-alignment-4.1.1.tgz", + "integrity": "sha512-9VxivIJaDonrd/Jgkim1oYQ5MIqhWmyJggr2AqtiizwqxT4epRsWmLOz+/sk7PtTGoT/MtwndhlbM3lxuVXFow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipe-alignment/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-5.0.1.tgz", + "integrity": "sha512-oOkRC0WRRDwvodfffGafoBFBTGwy9udQgKtxN53apmZpOmaUAxTi833ite0jMo078+LehNftO5bxrElZ9EQUlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-table-pipes/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-4.0.1.tgz", + "integrity": "sha512-HMrVQC0Qbr8ktSy+1lJGRGU10qecL3T14L6s/THEQXR5Tk0wcsLLG0auNvB4r2+H+ClhVO/Vnm1TEosh1OCsfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-write-good": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remark-lint-write-good/-/remark-lint-write-good-1.2.0.tgz", + "integrity": "sha512-HYiwM16RRBm979yDb/IVwPe1eFhzA1HATe1WucRiYWS10jcPRgJe9FihH7W5uzQFDqX5aRbTtu/yPdq+hPnYkw==", + "dev": true, + "dependencies": { + "nlcst-to-string": "^2.0.0", + "unified-lint-rule": "^1.0.1", + "unist-util-visit": "^1.1.1", + "write-good": "^1.0.2" + } + }, + "node_modules/remark-lint-write-good/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dev": true, + "dependencies": { + "wrapped": "^1.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-write-good/node_modules/unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "node_modules/remark-lint-write-good/node_modules/unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "dependencies": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "node_modules/remark-lint-write-good/node_modules/unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "dependencies": { + "unist-util-is": "^3.0.0" + } + }, + "node_modules/remark-lint/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-lint/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-lint/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-message-control": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-8.0.0.tgz", + "integrity": "sha512-brpzOO+jdyE/mLqvqqvbogmhGxKygjpCUCG/PwSCU43+JZQ+RM+sSzkCWBcYvgF3KIAVNIoPsvXjBkzO7EdsYQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-comment-marker": "^3.0.0", + "unified-message-control": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-message-control/node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-message-control/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-message-control/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-message-control/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-message-control/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-parse/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-parse/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-consistent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-consistent/-/remark-preset-lint-consistent-6.0.1.tgz", + "integrity": "sha512-SOLdA36UOU1hiGFm6HAqN9+DORGJPVWxU/EvPVkknTr9V4ULhlzHEJ8OVRMVX3jqoy4lrwb4IqiboVz0YLA7+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "remark-lint": "^10.0.0", + "remark-lint-blockquote-indentation": "^4.0.0", + "remark-lint-checkbox-character-style": "^5.0.0", + "remark-lint-code-block-style": "^4.0.0", + "remark-lint-emphasis-marker": "^4.0.0", + "remark-lint-fenced-code-marker": "^4.0.0", + "remark-lint-heading-style": "^4.0.0", + "remark-lint-link-title-style": "^4.0.0", + "remark-lint-list-item-content-indent": "^4.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "remark-lint-ordered-list-marker-value": "^4.0.0", + "remark-lint-rule-style": "^4.0.0", + "remark-lint-strong-marker": "^4.0.0", + "remark-lint-table-cell-padding": "^5.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-consistent/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-preset-lint-consistent/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-consistent/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-consistent/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-consistent/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-markdown-style-guide": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-markdown-style-guide/-/remark-preset-lint-markdown-style-guide-6.0.1.tgz", + "integrity": "sha512-hVCRMC8PZlI9hnXkZdrvg4n4j1aD//xHWj26Q7iFAbDB3JKtW1Ne72P7QNVyppmdrR6Gj84zhG3qphOLo8/i8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "remark-lint": "^10.0.0", + "remark-lint-blockquote-indentation": "^4.0.0", + "remark-lint-code-block-style": "^4.0.0", + "remark-lint-definition-case": "^4.0.0", + "remark-lint-definition-spacing": "^4.0.0", + "remark-lint-emphasis-marker": "^4.0.0", + "remark-lint-fenced-code-flag": "^4.0.0", + "remark-lint-fenced-code-marker": "^4.0.0", + "remark-lint-file-extension": "^3.0.0", + "remark-lint-final-definition": "^4.0.0", + "remark-lint-hard-break-spaces": "^4.0.0", + "remark-lint-heading-increment": "^4.0.0", + "remark-lint-heading-style": "^4.0.0", + "remark-lint-link-title-style": "^4.0.0", + "remark-lint-list-item-content-indent": "^4.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-lint-list-item-spacing": "^5.0.0", + "remark-lint-maximum-heading-length": "^4.0.0", + "remark-lint-maximum-line-length": "^4.0.0", + "remark-lint-no-blockquote-without-marker": "^6.0.0", + "remark-lint-no-consecutive-blank-lines": "^5.0.0", + "remark-lint-no-duplicate-headings": "^4.0.0", + "remark-lint-no-emphasis-as-heading": "^4.0.0", + "remark-lint-no-file-name-articles": "^3.0.0", + "remark-lint-no-file-name-consecutive-dashes": "^3.0.0", + "remark-lint-no-file-name-irregular-characters": "^3.0.0", + "remark-lint-no-file-name-mixed-case": "^3.0.0", + "remark-lint-no-file-name-outer-dashes": "^3.0.0", + "remark-lint-no-heading-punctuation": "^4.0.0", + "remark-lint-no-literal-urls": "^4.0.0", + "remark-lint-no-multiple-toplevel-headings": "^4.0.0", + "remark-lint-no-shell-dollars": "^4.0.0", + "remark-lint-no-shortcut-reference-image": "^4.0.0", + "remark-lint-no-shortcut-reference-link": "^4.0.0", + "remark-lint-no-table-indentation": "^5.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "remark-lint-ordered-list-marker-value": "^4.0.0", + "remark-lint-rule-style": "^4.0.0", + "remark-lint-strong-marker": "^4.0.0", + "remark-lint-table-cell-padding": "^5.0.0", + "remark-lint-table-pipe-alignment": "^4.0.0", + "remark-lint-table-pipes": "^5.0.0", + "remark-lint-unordered-list-marker-style": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-markdown-style-guide/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-preset-lint-markdown-style-guide/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-markdown-style-guide/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-markdown-style-guide/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-markdown-style-guide/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-recommended": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-7.0.1.tgz", + "integrity": "sha512-j1CY5u48PtZl872BQ40uWSQMT3R4gXKp0FUgevMu5gW7hFMtvaCiDq+BfhzeR8XKKiW9nIMZGfIMZHostz5X4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "remark-lint": "^10.0.0", + "remark-lint-final-newline": "^3.0.0", + "remark-lint-hard-break-spaces": "^4.0.0", + "remark-lint-list-item-bullet-indent": "^5.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-lint-no-blockquote-without-marker": "^6.0.0", + "remark-lint-no-duplicate-definitions": "^4.0.0", + "remark-lint-no-heading-content-indent": "^5.0.0", + "remark-lint-no-literal-urls": "^4.0.0", + "remark-lint-no-shortcut-reference-image": "^4.0.0", + "remark-lint-no-shortcut-reference-link": "^4.0.0", + "remark-lint-no-undefined-references": "^5.0.0", + "remark-lint-no-unused-definitions": "^4.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-recommended/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/remark-preset-lint-recommended/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-recommended/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-recommended/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-preset-lint-recommended/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-retext": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-retext/-/remark-retext-6.0.1.tgz", + "integrity": "sha512-GZk8Fa/h88+OhmUlJuqEFX4Pi7OvgI3pq1bHyr/NJibTQxANH8/aZGoOflh4zDAwVDdvgoEk5XOJsWQ8UfjFnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/nlcst": "^2.0.0", + "mdast-util-to-nlcst": "^7.0.0", + "parse-latin": "^7.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-retext/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-retext/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-retext/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-retext/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-retext/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-retext/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-stringify/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-stringify/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-stringify/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-textr": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/remark-textr/-/remark-textr-6.1.0.tgz", + "integrity": "sha512-3A61/6Dn8x5wS7f9BubnIjwZfttEw9+PWVFtwOvRzKXLmZDV1mgi9MJeaQ9BNzWhojsSRHWLNa2JHKCOOI5DfA==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "textr": "^0.3.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-textr/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-textr/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-textr/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/remark-validate-links/-/remark-validate-links-13.1.0.tgz", + "integrity": "sha512-z+glZ4zoRyrWimQHtoqJEFJdPoIR1R1SDr/JoWjmS6EsYlyhxNuCHtIt165gmV7ltOSFJ+rGsipqRGfBPInd7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hosted-git-info": "^3.0.0", + "@types/mdast": "^4.0.0", + "github-slugger": "^2.0.0", + "hosted-git-info": "^7.0.0", + "mdast-util-to-hast": "^13.0.0", + "mdast-util-to-string": "^4.0.0", + "propose": "0.0.5", + "trough": "^2.0.0", + "unified-engine": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark-validate-links/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark-validate-links/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-validate-links/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark/node_modules/@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/remark/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/remark/node_modules/unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/resolve": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", + "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", + "dev": true, + "peer": true, + "dependencies": { + "is-core-module": "^2.8.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/responselike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "dev": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", + "dev": true + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz", + "integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==", + "dev": true + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz", + "integrity": "sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.3.1", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "dev": true, + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "dev": true, + "dependencies": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/textr": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/textr/-/textr-0.3.0.tgz", + "integrity": "sha1-cXNhKGlirI3za3omGft3OhW5t/c=", + "dev": true + }, + "node_modules/time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "dev": true, + "dependencies": { + "convert-hrtime": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/too-wordy": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/too-wordy/-/too-wordy-0.3.4.tgz", + "integrity": "sha512-EU+UA4zHc06TkVQaravNNVdqX763/ENTIOKiKlqSJ6WKCPwLxHjvY3d0uEJYaq92iojyHPwD2iaYbZKjdw3icA==", + "dev": true, + "engines": { + "node": ">=6", + "npm": ">=5" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", + "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "node_modules/unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "peer": true, + "dependencies": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici": { + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/unified-args": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/unified-args/-/unified-args-11.0.0.tgz", + "integrity": "sha512-4q3OQ2EbNIaxVX1pMoB/QdFxw9BSOWBGUwn5LK3UJict+6i0ud18A1DZ177+2r5hC2nYFOw1jbCp27ydl44Zhg==", + "dev": true, + "dependencies": { + "@types/text-table": "^0.2.0", + "chalk": "^5.0.0", + "chokidar": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "json5": "^2.0.0", + "minimist": "^1.0.0", + "strip-ansi": "^7.0.0", + "text-table": "^0.2.0", + "unified-engine": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-args/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/unified-engine": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-11.1.0.tgz", + "integrity": "sha512-RS3K5PgNjDRQN9eNIefLUDxpfyWIItmKcjBhD1VnYYT/h7xpheZoZBtb5gtwFyKWZlhKCGRVQknIm1M8qHZfIg==", + "dev": true, + "dependencies": { + "@types/concat-stream": "^2.0.0", + "@types/debug": "^4.0.0", + "@types/is-empty": "^1.0.0", + "@types/node": "^20.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "concat-stream": "^2.0.0", + "debug": "^4.0.0", + "glob": "^10.0.0", + "ignore": "^5.0.0", + "is-empty": "^1.0.0", + "is-plain-obj": "^4.0.0", + "load-plugin": "^5.0.0", + "parse-json": "^7.0.0", + "trough": "^2.0.0", + "unist-util-inspect": "^8.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0", + "vfile-reporter": "^8.0.0", + "vfile-statistics": "^3.0.0", + "yaml": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-engine/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/unified-engine/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/unified-engine/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/unified-engine/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/unified-engine/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-engine/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-engine/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-5.0.0.tgz", + "integrity": "sha512-B2cSAkpuMVVmPP90KCfKdBhm1e9KYJ+zK3x5BCa0N65zpq1Ybkc9C77+M5qwR8FWO7RF3LM5QRRPZtgjW6DUCw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/unified-message-control/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-inspect": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-8.0.0.tgz", + "integrity": "sha512-/3Wn/wU6/H6UEo4FoYUeo8KUePN8ERiZpQYFWYoihOsr1DoDuv80PeB0hobVZyYSvALa2e556bG1A1/AbwU4yg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-inspect/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/unist-util-map": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unist-util-map/-/unist-util-map-1.0.5.tgz", + "integrity": "sha512-dFil/AN6vqhnQWNCZk0GF/G3+Q5YwsB+PqjnzvpO2wzdRtUJ1E8PN+XRE/PRr/G3FzKjRTJU0haqE0Ekl+O3Ag==", + "dev": true, + "dependencies": { + "object-assign": "^4.0.1" + } + }, + "node_modules/unist-util-modify-children": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz", + "integrity": "sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/unist-util-remove-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", + "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/unist-util-remove-position/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-to-list-of-char": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/unist-util-to-list-of-char/-/unist-util-to-list-of-char-0.1.3.tgz", + "integrity": "sha512-f8GrLHdhBKfaW6mzJc25BKeUOqhsuiRXlGrXBtb3pmRT3QCuYS+jH4g7Uf52hjV7TLQN4PGnjzrTFMFXAQaprA==", + "dev": true, + "dependencies": { + "unist-util-generated": "^1.1.6", + "unist-util-visit": "^1.4.0" + } + }, + "node_modules/unist-util-to-list-of-char/node_modules/unist-util-generated": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.6.tgz", + "integrity": "sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-to-list-of-char/node_modules/unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "node_modules/unist-util-to-list-of-char/node_modules/unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "dependencies": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "node_modules/unist-util-to-list-of-char/node_modules/unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "dependencies": { + "unist-util-is": "^3.0.0" + } + }, + "node_modules/unist-util-visit-children": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz", + "integrity": "sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-children/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true, + "peer": true + }, + "node_modules/vfile-location": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/vfile-location/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-8.1.0.tgz", + "integrity": "sha512-NfHyHdkCcy0BsXiLA3nId29TY7W7hgpc8nd8Soe3imATx5N4/+mkLYdMR+Y6Zvu6BXMMi0FZsD4FLCm1dN85Pg==", + "dev": true, + "dependencies": { + "@types/supports-color": "^8.0.0", + "string-width": "^6.0.0", + "supports-color": "^9.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0", + "vfile-sort": "^4.0.0", + "vfile-statistics": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/vfile-reporter/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-sort": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-4.0.0.tgz", + "integrity": "sha512-lffPI1JrbHDTToJwcq0rl6rBmkjQmMuXkAxsZPRS9DXbaJQvc642eCg6EGxcX2i1L+esbuhq+2l9tBll5v8AeQ==", + "dev": true, + "dependencies": { + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-sort/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/vfile-sort/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-sort/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-sort/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-statistics": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-3.0.0.tgz", + "integrity": "sha512-/qlwqwWBWFOmpXujL/20P+Iuydil0rZZNglR+VNm6J0gpLHwuVM5s7g2TfVoswbXjZ4HuIhLMySEyIw5i7/D8w==", + "dev": true, + "dependencies": { + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-statistics/node_modules/@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "node_modules/vfile-statistics/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-statistics/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-statistics/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/walk-up-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", + "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", + "dev": true + }, + "node_modules/weasel-words": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/weasel-words/-/weasel-words-0.1.1.tgz", + "integrity": "sha1-cTeUZYXHP+RIggE4U70ADF1oek4=", + "dev": true + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "peer": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrapped": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", + "integrity": "sha1-x4PZ2Aeyc+mwHoUWgKk4yHyQckI=", + "dev": true, + "dependencies": { + "co": "3.1.0", + "sliced": "^1.0.1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-good": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/write-good/-/write-good-1.0.8.tgz", + "integrity": "sha512-P1Ct7+DNrOcr2JAxDZ3Q5i5sx2LSveu7iLaoUL0A+YiG0GKf0l5+9j3rwMeyh6JeTL1+HfQV1rnwEvzhNIvpFw==", + "dev": true, + "dependencies": { + "adverb-where": "^0.2.2", + "commander": "^2.19.0", + "e-prime": "^0.10.4", + "no-cliches": "^0.3.0", + "passive-voice": "^0.1.0", + "too-wordy": "^0.3.1", + "weasel-words": "^0.1.1" + }, + "bin": { + "write-good": "bin/write-good.js", + "writegood": "bin/write-good.js" + }, + "engines": { + "node": ">=6", + "npm": ">=5" + } + }, + "node_modules/yaml": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", + "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yocto-queue": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zwitch": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz", + "integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "requires": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "dev": true, + "peer": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/runtime-corejs3": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.16.8.tgz", + "integrity": "sha512-3fKhuICS1lMz0plI5ktOE/yEtBRMVxplzRkdn6mJQ197XiY0JnrzYV0+Mxozq3JZ8SBV9Ecurmw1XsGbwOf+Sg==", + "dev": true, + "peer": true, + "requires": { + "core-js-pure": "^3.20.2", + "regenerator-runtime": "^0.13.4" + } + }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "peer": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "peer": true + } + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "peer": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true, + "peer": true + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + } + } + }, + "@leichtgewicht/ip-codec": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "dev": true + }, + "@npmcli/config": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.1.0.tgz", + "integrity": "sha512-cPQmIQ2Q0vuOfrenrA3isikdMFMAHgzlXV+EmvZ8f2JeJsU5xTU2bG7ipXECiMvPF9nM+QDnMLuIg8QLw9H4xg==", + "dev": true, + "requires": { + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", + "mkdirp-infer-owner": "^2.0.0", + "nopt": "^5.0.0", + "proc-log": "^2.0.0", + "read-package-json-fast": "^2.0.3", + "semver": "^7.3.5", + "walk-up-path": "^1.0.0" + } + }, + "@npmcli/map-workspaces": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.3.tgz", + "integrity": "sha512-X6suAun5QyupNM8iHkNPh0AHdRC2rb1W+MTdMvvA/2ixgmqZwlq5cGUBgmKHUHT2LgrkKJMAXbfAoTxOigpK8Q==", + "dev": true, + "requires": { + "@npmcli/name-from-folder": "^1.0.1", + "glob": "^8.0.1", + "minimatch": "^5.0.1", + "read-package-json-fast": "^2.0.3" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@npmcli/name-from-folder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", + "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", + "dev": true + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, + "@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "requires": { + "defer-to-connect": "^2.0.0" + } + }, + "@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "requires": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, + "@types/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "dev": true, + "requires": { + "@types/ms": "*" + } + }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "@types/hast": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.1.tgz", + "integrity": "sha512-hs/iBJx2aydugBQx5ETV3ZgeSS0oIreQrFJ4bjBl0XvM4wAmDjFEALY7p0rTSLt2eL+ibjRAAs9dTPiCLtmbqQ==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/hosted-git-info": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hosted-git-info/-/hosted-git-info-3.0.5.tgz", + "integrity": "sha512-Dmngh7U003cOHPhKGyA7LWqrnvcTyILNgNPmNCxlx7j8MIi54iBliiT8XqVLIQ3GchoOjVAyBzNJVyuaJjqokg==", + "dev": true + }, + "@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "dev": true + }, + "@types/is-empty": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/is-empty/-/is-empty-1.2.1.tgz", + "integrity": "sha512-a3xgqnFTuNJDm1fjsTjHocYJ40Cz3t8utYpi5GNaxzrJC2HSD08ym+whIL7fNqiqBCdM9bcqD1H/tORWAFXoZw==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true, + "peer": true + }, + "@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", + "dev": true + }, + "@types/nlcst": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.1.tgz", + "integrity": "sha512-+hL97wfmdLW/unulVgdR+e+8PXbbtZgoYOq3C12H3RKgAZZ38D55Jwej7JBttJ6+oFuwIRYy5qTbE/WugMsCxw==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/node": { + "version": "20.8.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.0.tgz", + "integrity": "sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==", + "dev": true + }, + "@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw==", + "dev": true + }, + "@types/text-table": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@types/text-table/-/text-table-0.2.3.tgz", + "integrity": "sha512-MUW7DN7e178wJ2dB9rHuhwUWRUJGrl8fCng37BEWV0r2r5VpzkRFRiMfnX6sjXlu4tMn41lrjzsVh/z1XrKc+A==", + "dev": true + }, + "@types/unist": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", + "dev": true + }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "peer": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peer": true, + "requires": {} + }, + "adverb-where": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/adverb-where/-/adverb-where-0.2.5.tgz", + "integrity": "sha512-JiQe2U1UR8l10jPrXv/PmlDhOLZpsxqjvTp+k6Dm5wYDUULdMZytDRmovkXU8X6V9o0sg0FBdetv3VXHAZZK5Q==", + "dev": true + }, + "aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "requires": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "peer": true + }, + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "dev": true, + "peer": true, + "requires": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + } + }, + "array-includes": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", + "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + } + }, + "array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "dev": true + }, + "array.prototype.flat": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", + "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0" + } + }, + "array.prototype.flatmap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz", + "integrity": "sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0" + } + }, + "ast-types-flow": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", + "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "dev": true, + "peer": true + }, + "axe-core": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz", + "integrity": "sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA==", + "dev": true, + "peer": true + }, + "axobject-query": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", + "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", + "dev": true, + "peer": true + }, + "bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "requires": { + "semver": "^7.0.0" + } + }, + "cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true + }, + "cacheable-request": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "peer": true + }, + "ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "character-entities": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.1.tgz", + "integrity": "sha512-OzmutCf2Kmc+6DrFrrPS8/tDh2+DpnrfzdICHWhcVC9eOd0N1PXmQEE1a8iM4IziIAG+8tmTq3K+oo0ubH6RRQ==", + "dev": true + }, + "character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true + }, + "character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true + }, + "character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "requires": { + "escape-string-regexp": "5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true + } + } + }, + "clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "dev": true, + "requires": { + "is-regexp": "^3.0.0" + } + }, + "clone-response": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "co": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", + "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=", + "dev": true + }, + "collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "peer": true + }, + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "dev": true + }, + "core-js-pure": { + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.2.tgz", + "integrity": "sha512-CmWHvSKn2vNL6p6StNp1EmMIfVY/pqn3JLAjfZQ8WZGPOlGoO92EkX9/Mk81i6GxvoPXjUqEQnpM3rJ5QxxIOg==", + "dev": true, + "peer": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "css-selector-parser": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.5.tgz", + "integrity": "sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g==", + "dev": true + }, + "damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "dev": true, + "peer": true + }, + "dead-or-alive": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dead-or-alive/-/dead-or-alive-1.0.3.tgz", + "integrity": "sha512-LJ2tGXmux1dx6FcuhwKcbHJPiR2OKiPWBY/6Yj6EfFdObK3nue69DlGFr1cUeRmtalqRhWXMztXMcEXJP59XKw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "fast-content-type-parse": "^2.0.0", + "hast-util-from-html-isomorphic": "^2.0.0", + "hast-util-is-element": "^3.0.0", + "hast-util-select": "^6.0.0", + "html-url-attributes": "^3.0.0", + "levenshtein-edit-distance": "^3.0.0", + "undici": "^6.0.0", + "unist-util-visit": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "levenshtein-edit-distance": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/levenshtein-edit-distance/-/levenshtein-edit-distance-3.0.1.tgz", + "integrity": "sha512-/qMCkZbrAF7jZP/voqlkfNrBtEn0TMdhCK7OEBh/zb39t/c3wCnTjwU1ZvrMfQ3OxB8sBQXIpWRMM6FiQJVG3g==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decode-named-character-reference": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.1.tgz", + "integrity": "sha512-YV/0HQHreRwKb7uBopyIkLG17jG6Sv2qUchk9qSoVJ2f+flwRsPNBO0hAnjt6mTNYUT+vw9Gy2ihXg4sUWPi2w==", + "dev": true, + "requires": { + "character-entities": "^2.0.0" + } + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "requires": { + "mimic-response": "^3.1.0" + }, + "dependencies": { + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "peer": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", + "dev": true + }, + "devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "requires": { + "dequal": "^2.0.0" + } + }, + "direction": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", + "dev": true + }, + "dns-packet": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", + "dev": true, + "requires": { + "@leichtgewicht/ip-codec": "^2.0.1" + } + }, + "dns-socket": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/dns-socket/-/dns-socket-4.2.2.tgz", + "integrity": "sha512-BDeBd8najI4/lS00HSKpdFia+OvUMytaVjfzR9n5Lq8MlZRSvtbI+uLtx1+XmQFls5wFU9dssccTmQQ6nfpjdg==", + "dev": true, + "requires": { + "dns-packet": "^5.2.4" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "e-prime": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/e-prime/-/e-prime-0.10.4.tgz", + "integrity": "sha512-tzBmM2mFSnAq5BuxPSyin6qXb3yMe1wufJN7L7ZPcEWS5S+jI2dhKQEoqHVEcSMMXo/j5lcWpX5jzA6wLSmX6w==", + "dev": true + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "peer": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "peer": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true + }, + "eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "dev": true, + "peer": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "peer": true + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "peer": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "peer": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "peer": true, + "requires": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", + "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", + "dev": true, + "peer": true, + "requires": { + "debug": "^3.2.7", + "find-up": "^2.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "peer": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "peer": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "peer": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "peer": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "peer": true + } + } + }, + "eslint-plugin-import": { + "version": "2.25.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", + "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "dev": true, + "peer": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.2", + "has": "^1.0.3", + "is-core-module": "^2.8.0", + "is-glob": "^4.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.5", + "resolve": "^1.20.0", + "tsconfig-paths": "^3.12.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "peer": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "peer": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "peer": true + } + } + }, + "eslint-plugin-jsx-a11y": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz", + "integrity": "sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g==", + "dev": true, + "peer": true, + "requires": { + "@babel/runtime": "^7.16.3", + "aria-query": "^4.2.2", + "array-includes": "^3.1.4", + "ast-types-flow": "^0.0.7", + "axe-core": "^4.3.5", + "axobject-query": "^2.2.0", + "damerau-levenshtein": "^1.0.7", + "emoji-regex": "^9.2.2", + "has": "^1.0.3", + "jsx-ast-utils": "^3.2.1", + "language-tags": "^1.0.5", + "minimatch": "^3.0.4" + } + }, + "eslint-plugin-react": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz", + "integrity": "sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw==", + "dev": true, + "peer": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flatmap": "^1.2.5", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.0.4", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.0", + "object.values": "^1.1.5", + "prop-types": "^15.7.2", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.6" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "peer": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "dev": true, + "peer": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "peer": true + } + } + }, + "eslint-plugin-react-hooks": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz", + "integrity": "sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA==", + "dev": true, + "peer": true, + "requires": {} + }, + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "peer": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true, + "peer": true + }, + "espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "peer": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "peer": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "fast-content-type-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.0.tgz", + "integrity": "sha512-fCqg/6Sps8tqk8p+kqyKqYfOF0VjPNYrqpLiqNl0RBKmD80B080AJWVV6EkSkscjToNExcXg1+Mfzftrx6+iSA==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "peer": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true, + "peer": true + }, + "fault": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", + "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", + "dev": true, + "requires": { + "format": "^0.2.0" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "peer": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true, + "peer": true + }, + "foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + } + }, + "format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true, + "peer": true + }, + "function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "peer": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", + "dev": true + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "peer": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true + } + } + }, + "got": { + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "dev": true, + "requires": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true, + "peer": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true, + "peer": true + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "peer": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "hast-util-from-dom": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.0.tgz", + "integrity": "sha512-d6235voAp/XR3Hh5uy7aGLbM3S4KamdW0WEgOaU1YoewnuYw4HXb5eRtv9g65m/RFGEfUY1Mw4UqCc5Y8L4Stg==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "hastscript": "^8.0.0", + "web-namespaces": "^2.0.0" + } + }, + "hast-util-from-html": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", + "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "hast-util-from-html-isomorphic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz", + "integrity": "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "hast-util-from-dom": "^5.0.0", + "hast-util-from-html": "^2.0.0", + "unist-util-remove-position": "^5.0.0" + } + }, + "hast-util-from-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", + "property-information": "^6.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "hast-util-has-property": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz", + "integrity": "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, + "hast-util-is-element": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz", + "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, + "hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, + "hast-util-select": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.2.tgz", + "integrity": "sha512-hT/SD/d/Meu+iobvgkffo1QecV8WeKWxwsNMzcTJsKw1cKTQKSR/7ArJeURLNJF9HDjp9nVoORyNNJxrvBye8Q==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "bcp-47-match": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "css-selector-parser": "^3.0.0", + "devlop": "^1.0.0", + "direction": "^2.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "not": "^0.1.0", + "nth-check": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + } + } + }, + "hast-util-to-string": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz", + "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, + "hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0" + } + }, + "hastscript": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + } + }, + "hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "requires": { + "lru-cache": "^10.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true + } + } + }, + "html-url-attributes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz", + "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-meta-resolve": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.0.3.tgz", + "integrity": "sha512-fpAppnBpZ3ymQ/dPP97TNsco1HB5+V9SYJ3chY50PP8xn4U/w+Y6ovWBmTImB/prmGsTjzPh8pQYY+EVBlr9mw==", + "dev": true, + "requires": { + "builtins": "^5.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "peer": true + }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.0.tgz", + "integrity": "sha512-TxYQaeNW/N8ymDvwAxPyRbhMBtnEwuvaTYpOQkFx1nSeusgezHniEc/l35Vo4iCq/mMiTJbpD7oYxN98hFlfmw==", + "dev": true + }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "peer": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "ip-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", + "dev": true + }, + "is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "dev": true + }, + "is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dev": true, + "requires": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "peer": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true, + "peer": true + }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "dev": true, + "peer": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "peer": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true + }, + "is-empty": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-empty/-/is-empty-1.2.0.tgz", + "integrity": "sha1-3pu1snhzigWgsJpX4ftNSjQan2s=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "dev": true + }, + "is-ip": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.1.tgz", + "integrity": "sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==", + "dev": true, + "requires": { + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" + } + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "peer": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "dev": true, + "peer": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-online": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/is-online/-/is-online-11.0.0.tgz", + "integrity": "sha512-LY3UOlRGCofw5RMhsEFHQ9xQ6jJXL9wFWWIfmSdNo8vO+DrIvan3G9hAPZiMRXddVZS2v9+CV4z9PslLhBGIyA==", + "dev": true, + "requires": { + "got": "^11.8.5", + "p-any": "^4.0.0", + "p-timeout": "^6.1.2", + "public-ip": "^7.0.1" + } + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "dev": true + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==", + "dev": true + }, + "is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true, + "peer": true + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "peer": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "peer": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "peer": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true, + "peer": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, + "jsx-ast-utils": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", + "integrity": "sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA==", + "dev": true, + "peer": true, + "requires": { + "array-includes": "^3.1.3", + "object.assign": "^4.1.2" + } + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "language-subtag-registry": { + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", + "integrity": "sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==", + "dev": true, + "peer": true + }, + "language-tags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", + "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", + "dev": true, + "peer": true, + "requires": { + "language-subtag-registry": "~0.3.2" + } + }, + "levenshtein-edit-distance": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/levenshtein-edit-distance/-/levenshtein-edit-distance-1.0.0.tgz", + "integrity": "sha1-iVuvR4zOi1waDSfkXXwdl4pmHkk=", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "peer": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "dev": true + }, + "load-plugin": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-5.0.0.tgz", + "integrity": "sha512-jTz8tvC0BTMtof27lTSV5SAOnCRT0Z++k+S3QeQ5CrF8ZAS5L2nhi3euf4ZhJyDkds+nOQGyPcFqdQZ9s8ELkg==", + "dev": true, + "requires": { + "@npmcli/config": "^4.0.0", + "import-meta-resolve": "^2.0.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "peer": true + }, + "longest-streak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.1.tgz", + "integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + }, + "markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "dev": true + }, + "mdast-comment-marker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-3.0.0.tgz", + "integrity": "sha512-bt08sLmTNg00/UtVDiqZKocxqvQqqyQZAg1uaRuO/4ysXV5motg7RolF5o5yy/sY1rG0v2XgZEqFWho1+2UquA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx-expression": "^2.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + } + } + }, + "mdast-util-directive": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz", + "integrity": "sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + } + } + }, + "mdast-util-from-markdown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + } + } + }, + "mdast-util-frontmatter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", + "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "escape-string-regexp": "^5.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-extension-frontmatter": "^2.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true + } + } + }, + "mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "dev": true, + "requires": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + } + }, + "mdast-util-mdx-expression": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz", + "integrity": "sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + } + } + }, + "mdast-util-mdx-jsx": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.2.tgz", + "integrity": "sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-remove-position": "^5.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "dev": true, + "requires": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + } + } + }, + "mdast-util-phrasing": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz", + "integrity": "sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + } + } + }, + "mdast-util-to-hast": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "dev": true, + "requires": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + } + } + }, + "mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + } + } + }, + "mdast-util-to-nlcst": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-nlcst/-/mdast-util-to-nlcst-7.0.0.tgz", + "integrity": "sha512-YfWgABD6izaK7Tzx37V4268THKeusHU+S2qet98h9vrffMxwd/2jqFKxNYz9cCAPYA8p/5BXQuF313JuVFDC9A==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^3.0.0", + "unist-util-position": "^5.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "nlcst-to-string": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", + "dev": true, + "requires": { + "@types/nlcst": "^1.0.0" + }, + "dependencies": { + "@types/nlcst": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.2.tgz", + "integrity": "sha512-ykxL/GDDUhqikjU0LIywZvEwb1NTYXTEWf+XgMSS2o6IXIakafPccxZmxgZcvJPZ3yFl2kdL1gJZz3U3iZF3QA==", + "dev": true, + "requires": { + "@types/unist": "^2" + } + }, + "@types/unist": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", + "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==", + "dev": true + } + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "micromark": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", + "dev": true, + "requires": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-core-commonmark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "dev": true, + "requires": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-extension-frontmatter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", + "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", + "dev": true, + "requires": { + "fault": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-destination": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-label": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", + "dev": true, + "requires": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-title": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", + "dev": true, + "requires": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-factory-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", + "dev": true, + "requires": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-combine-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", + "dev": true, + "requires": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "requires": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "dev": true + }, + "micromark-util-html-tag-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", + "dev": true + }, + "micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", + "dev": true, + "requires": { + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", + "dev": true, + "requires": { + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "dev": true, + "requires": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "micromark-util-subtokenize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "dev": true, + "requires": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true + }, + "micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "mkdirp-infer-owner": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz", + "integrity": "sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "infer-owner": "^1.0.4", + "mkdirp": "^1.0.3" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true, + "peer": true + }, + "nlcst-to-string": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-2.0.4.tgz", + "integrity": "sha512-3x3jwTd6UPG7vi5k4GEzvxJ5rDA7hVUIRNHPblKuMVP9Z3xmlsd9cgLcpAMkc5uPOBna82EeshROFhsPkbnTZg==", + "dev": true + }, + "no-cliches": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/no-cliches/-/no-cliches-0.3.4.tgz", + "integrity": "sha512-oUqnng1vhKLaA4GR+OzVbLuZZ7OOguKCtMHxHMiyP8+9mXidKfoCyc030LbAyNI3xcgCHHyitK3Q8wP+w6DwVQ==", + "dev": true, + "requires": {} + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true + }, + "not": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/not/-/not-0.1.0.tgz", + "integrity": "sha512-5PDmaAsVfnWUgTUbJ3ERwn7u79Z0dYxN9ErxCpVJJqe2RK0PJ3z+iFUxuqjwtlDDegXvtWoxD/3Fzxox7tFGWA==", + "dev": true + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "requires": { + "boolbase": "^1.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true, + "peer": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "peer": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.fromentries": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", + "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.hasown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", + "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "dev": true, + "peer": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "peer": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-all": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-all/-/p-all-5.0.0.tgz", + "integrity": "sha512-pofqu/1FhCVa+78xNAptCGc9V45exFz2pvBRyIvgXkNM0Rh18Py7j8pQuSjA+zpabI46v9hRjNWmL9EAFcEbpw==", + "dev": true, + "requires": { + "p-map": "^6.0.0" + } + }, + "p-any": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-any/-/p-any-4.0.0.tgz", + "integrity": "sha512-S/B50s+pAVe0wmEZHmBs/9yJXeZ5KhHzOsgKzt0hRdgkoR3DxW9ts46fcsWi/r3VnzsnkKS7q4uimze+zjdryw==", + "dev": true, + "requires": { + "p-cancelable": "^3.0.0", + "p-some": "^6.0.0" + }, + "dependencies": { + "p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true + } + } + }, + "p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "dev": true + }, + "p-limit": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.1.0.tgz", + "integrity": "sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==", + "dev": true, + "requires": { + "yocto-queue": "^1.1.1" + } + }, + "p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true + }, + "p-some": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-some/-/p-some-6.0.0.tgz", + "integrity": "sha512-CJbQCKdfSX3fIh8/QKgS+9rjm7OBNUTmwWswAFQAhc8j1NR1dsEDETUEuVUtQHZpV+J03LqWBEwvu0g1Yn+TYg==", + "dev": true, + "requires": { + "aggregate-error": "^4.0.0", + "p-cancelable": "^3.0.0" + }, + "dependencies": { + "p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true + } + } + }, + "p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-entities": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", + "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + } + }, + "parse-json": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.0.tgz", + "integrity": "sha512-ihtdrgbqdONYD156Ap6qTcaGcGdkdAxodO1wLqQ/j7HP1u2sFYppINiq4jyC8F+Nm+4fVufylCV00QmkTHkSUg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.21.4", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" + }, + "dependencies": { + "json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true + }, + "type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true + } + } + }, + "parse-latin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz", + "integrity": "sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==", + "dev": true, + "requires": { + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-modify-children": "^4.0.0", + "unist-util-visit-children": "^3.0.0", + "vfile": "^6.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "nlcst-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz", + "integrity": "sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA==", + "dev": true, + "requires": { + "@types/nlcst": "^2.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "requires": { + "entities": "^4.4.0" + } + }, + "passive-voice": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/passive-voice/-/passive-voice-0.1.0.tgz", + "integrity": "sha1-Fv+RrkC6DpLEPmcXY/3IQqcCcLE=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "peer": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "peer": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "peer": true + }, + "path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "requires": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true + } + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true + }, + "proc-log": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "peer": true + }, + "prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "property-information": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", + "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==", + "dev": true + }, + "propose": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/propose/-/propose-0.0.5.tgz", + "integrity": "sha1-SKBl2ex9TIZn9AULFcSi2F28pWs=", + "dev": true, + "requires": { + "levenshtein-edit-distance": "^1.0.0" + } + }, + "public-ip": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/public-ip/-/public-ip-7.0.1.tgz", + "integrity": "sha512-DdNcqcIbI0wEeCBcqX+bmZpUCvrDMJHXE553zgyG1MZ8S1a/iCCxmK9iTjjql+SpHSv4cZkmRv5/zGYW93AlCw==", + "dev": true, + "requires": { + "dns-socket": "^4.2.2", + "got": "^11.8.5", + "is-ip": "^5.0.1" + } + }, + "pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "peer": true + }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true + }, + "quotation": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/quotation/-/quotation-2.0.3.tgz", + "integrity": "sha512-yEc24TEgCFLXx7D4JHJJkK4JFVtatO8fziwUxY4nB/Jbea9o9CVS3gt22mA0W7rPYAGW2fWzYDSOtD94PwOyqA==", + "dev": true + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "peer": true + }, + "read-package-json-fast": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", + "dev": true, + "requires": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true, + "peer": true + }, + "regexp.prototype.flags": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", + "integrity": "sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "peer": true + }, + "remark": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/remark/-/remark-15.0.1.tgz", + "integrity": "sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-cli": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-12.0.1.tgz", + "integrity": "sha512-2NAEOACoTgo+e+YAaCTODqbrWyhMVmlUyjxNCkTrDRHHQvH6+NbrnqVvQaLH/Q8Ket3v90A43dgAJmXv8y5Tkw==", + "dev": true, + "requires": { + "import-meta-resolve": "^4.0.0", + "markdown-extensions": "^2.0.0", + "remark": "^15.0.0", + "unified-args": "^11.0.0" + }, + "dependencies": { + "import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true + } + } + }, + "remark-frontmatter": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-5.0.0.tgz", + "integrity": "sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-frontmatter": "^2.0.0", + "micromark-extension-frontmatter": "^2.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-heading-gap": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/remark-heading-gap/-/remark-heading-gap-6.0.0.tgz", + "integrity": "sha512-xsJJZ0BC9J6XFY0c7segxuSKrJ95EDHEh06+b5FOgbhyJ9Z7yWKxWEJpsa2Bp4gkeMAEkoODH4mjWIV0JD2Urg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-10.0.1.tgz", + "integrity": "sha512-1+PYGFziOg4pH7DDf1uMd4AR3YuO2EMnds/SdIWMPGT7CAfDRSnAmpxPsJD0Ds3IKpn97h3d5KPGf1WFOg6hXQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "remark-message-control": "^8.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-blockquote-indentation": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-4.0.1.tgz", + "integrity": "sha512-7BhOsImFgTD7IIliu2tt+yJbx5gbMbXCOspc3VdYf/87iLJdWKqJoMy2V6DZG7kBjBlBsIZi38fDDngJttXt4w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-checkbox-character-style": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-5.0.1.tgz", + "integrity": "sha512-6qilm7XQXOcTvjFEqqNY57Ki7md9rkSdpMIfIzVXdEnI4Npl2BnUff6ANrGRM7qTgJTrloaf8H0eQ91urcU6Og==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-checkbox-content-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-5.0.1.tgz", + "integrity": "sha512-R1gV4vGkgJQZQFIGve1paj4mVDUWlgX0KAHhjNpSyzuwuSIDoxWpEuSJSxcnczESgcjM4yVrZqEGMYi/fqZK0w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-code": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-code/-/remark-lint-code-2.0.0.tgz", + "integrity": "sha1-A+DC6Qru2+h1qHlf6s9XmIt9lXw=", + "dev": true, + "requires": { + "unified-lint-rule": "^1.0.0", + "unist-util-visit": "^1.0.0" + }, + "dependencies": { + "unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dev": true, + "requires": { + "wrapped": "^1.0.1" + } + }, + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } + } + } + }, + "remark-lint-code-block-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-4.0.1.tgz", + "integrity": "sha512-d4mHsEpv1yqXWl2dd+28tGRX0Lzk5qw7cfxAQVkOXPUONhsMFwXJEBeeqZokeG4lOKtkKdIJR7ezScDfWR0X4w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-definition-case": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-case/-/remark-lint-definition-case-4.0.1.tgz", + "integrity": "sha512-BItJMeXyEBKW/beM7gFLMt3flnyNoRDd8yNFq+7pIeFjO7KWGRxBWUaNgk/tFEPyQcGeCqrNS3nS0ic7qi7I2w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-definition-spacing": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-4.0.1.tgz", + "integrity": "sha512-ZjShKaBUGeHrZyIZWwOZOxX3guj/P7gRR5wbDADQctL4oK+ZLQfOvJFmAsF1nD4gNr0Ficjd0AuiWxQcc1qTMA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-emphasis-marker": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-4.0.0.tgz", + "integrity": "sha512-xIRiB4PFWUOyIslN/UOPL6Lh+J0VD4R11+jo+W4hpGMNsg58l+2SgtdbinlXzDeoBxmaaka9n/sYpJ7cJWEIPQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-fenced-code-flag": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-4.2.0.tgz", + "integrity": "sha512-QWGTrnYbcopOFZR98djDREmKApLonJ7hmXE7pEcOGee9JY/EUIVS7Lq54Hy9CtU3cVIvQQmiMTxCwUhfddDJFA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "quotation": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-fenced-code-marker": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-4.0.1.tgz", + "integrity": "sha512-uI91OcVPKjNxV+vpjDW9T64hkE0a/CRn3JhwdMxUAJYpVsKnA7PFPSFJOx/abNsVZHNSe7ZFGgGdaH/lqgSizA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-file-extension": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-3.0.1.tgz", + "integrity": "sha512-1Ca5Dgu9J/j1fb7nvzNXh2xy4ija03igiP5i4le64LfrlloGax4VWcG/M7uL+CpRTFVqEJMWw0iKDEZxYSgImg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "quotation": "^2.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-final-definition": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-4.0.2.tgz", + "integrity": "sha512-fz3UAcFQef77Zb8rz4za2R6y7pdyJot22iGtFoNIKdtbcNa8IKKEVoY3NIfrsLfhrjwzcha1Sp3fFA9NF6lc4w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-final-newline": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-3.0.1.tgz", + "integrity": "sha512-q5diKHD6BMbzqWqgvYPOB8AJgLrMzEMBAprNXjcpKoZ/uCRqly+gxjco+qVUMtMWSd+P+KXZZEqoa7Y6QiOudw==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-hard-break-spaces": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-4.1.1.tgz", + "integrity": "sha512-AKDPDt39fvmr3yk38OKZEWJxxCOOUBE+96AsBfs+ExS5LW6oLa9041X5ahFDQHvHGzdoremEIaaElursaPEkNg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-heading-increment": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-increment/-/remark-lint-heading-increment-4.0.1.tgz", + "integrity": "sha512-uat7RTQn0hGlMv62p7yjLlg3tO3RljFbH6C+0M+5BNEF+s3NrA8jJgqW0UwLLNdCd3EABCKaWloHumT57ND7PQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-heading-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-4.0.1.tgz", + "integrity": "sha512-+rUpJ/N2CGC5xPgZ18XgsCsUBtadgEhdTi0BJPrsFmHPzL22BUHajeg9im8Y7zphUcbi1qFiKuxZd2nzDgZSXQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-heading-style": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-heading-style": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-3.0.0.tgz", + "integrity": "sha512-tsUfM9Kj9msjlemA/38Z3pvraQay880E3zP2NgIthMoGcpU9bcPX9oSM6QC/+eFXGGB4ba+VCB1dKAPHB7Veug==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-heading-whitespace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-heading-whitespace/-/remark-lint-heading-whitespace-1.0.0.tgz", + "integrity": "sha512-DykoBIXNbkihg64D+mztSOv3l82RTH4tIZW/HUB4QM4NpIEB+pVIPQpCYD0K4pTgvKiwoqsj4NY8qJ1EhNHAmQ==", + "dev": true, + "requires": { + "mdast-util-to-string": "^1.0.4", + "unified-lint-rule": "^1.0.2", + "unist-util-visit": "^1.3.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "dev": true + }, + "unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dev": true, + "requires": { + "wrapped": "^1.0.1" + } + }, + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } + } + } + }, + "remark-lint-link-title-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-link-title-style/-/remark-lint-link-title-style-4.0.1.tgz", + "integrity": "sha512-MtmnYrhjhRXR0zeiyYf/7GBlUF5KAPypJb345KjyDluOhI4Wj4VAXvVQuov/MFc3y8p/1yVwv3QDYv6yue8/wQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-list-item-bullet-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-5.0.1.tgz", + "integrity": "sha512-LKuTxkw5aYChzZoF3BkfaBheSCHs0T8n8dPHLQEuOLo6iC5wy98iyryz0KZ61GD8stlZgQO2KdWSdnP6vr40Iw==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-list-item-content-indent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-content-indent/-/remark-lint-list-item-content-indent-4.0.1.tgz", + "integrity": "sha512-KSopxxp64O6dLuTQ2sWaTqgjKWr1+AoB1QCTektMJ3mfHfn0QyZzC2CZbBU22KGzBhiYXv9cIxlJlxUtq2NqHg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-list-item-indent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-4.0.1.tgz", + "integrity": "sha512-gJd1Q+jOAeTgmGRsdMpnRh01DUrAm0O5PCQxE8ttv1QZOV015p/qJH+B4N6QSmcUuPokHLAh9USuq05C73qpiA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-list-item-spacing": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-spacing/-/remark-lint-list-item-spacing-5.0.0.tgz", + "integrity": "sha512-d6p+1tcwNE+Pp6Tu2DwiKlyC1zYY3f1igL6AlcBIH0RmROVEfZR4IDFH/LcVyTkzqh1lPMFAJXWK4bpScpcO3g==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-maximum-heading-length": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-heading-length/-/remark-lint-maximum-heading-length-4.1.1.tgz", + "integrity": "sha512-99yonukJ+e0uhx0zGH4uq6H9mhO7FA1ufmuToODH1N+X3ja61Grvlvvlq9UbP9+gbfbWgN97QGKPaTlE29FpaQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-maximum-line-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-4.0.1.tgz", + "integrity": "sha512-hQlh8UrRfhkO4FU7z7t1Bu5ethj1y2iBncO5AOWF38RAmlHaZdB2lQxNA8IvUZITGJYpT1aThdFTEf+58lv08Q==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-blockquote-without-marker": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-6.0.1.tgz", + "integrity": "sha512-b4IOkNcG7C16HYAdKUeAhO7qPt45m+v7SeYbVrqvbSFtlD3EUBL8fgHRgLK1mdujFXDP1VguOEMx+Txv8JOT4w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-directive": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-consecutive-blank-lines": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-5.0.1.tgz", + "integrity": "sha512-yLtYCrEBtGDao4ozmZruRzjMYAcBVFK69PoYjPfNwFO8pQ/LPt8KCq6oyg1ronNyRbDYEGqVdLIHcT/zL3LjPA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-directive": "^3.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-dead-urls": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-2.0.1.tgz", + "integrity": "sha512-8+uY2GWENktvnTnmDHsAW/DxuPiAmZiKoW5HGuCrGmlqEVh4jPZJ2IGbQgfpyrMKIwp32NYo7Jt+aKb52QJ6sQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "dead-or-alive": "^1.0.0", + "devlop": "^1.0.0", + "is-online": "^11.0.0", + "p-all": "^5.0.0", + "p-limit": "^6.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-duplicate-definitions": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-4.0.1.tgz", + "integrity": "sha512-Ek+A/xDkv5Nn+BXCFmf+uOrFSajCHj6CjhsHjtROgVUeEPj726yYekDBoDRA0Y3+z+U30AsJoHgf/9Jj1IFSug==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-duplicate-headings": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-headings/-/remark-lint-no-duplicate-headings-4.0.1.tgz", + "integrity": "sha512-6lggqnpIe5FepikjYF2me3ovKV4oD/rAz8WmwVbLR2cLkce1iH+PB7jyxk/A2gQQqrDcIlRMA5Ct2Yj56cEwhQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-emphasis-as-heading": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-emphasis-as-heading/-/remark-lint-no-emphasis-as-heading-4.0.1.tgz", + "integrity": "sha512-zzI/C330qdKO9FB3h6IUtOG36FSrS5nfJ7qxp0atXGYtHyg+Ag7dPC/0FzchOVsxofQm0QTstVoIARt/9TiN5g==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-empty-sections": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-empty-sections/-/remark-lint-no-empty-sections-4.0.0.tgz", + "integrity": "sha512-Tx1nCu7Dq3dsJ500402sSvM0uVK/6khSuEjx8K8u9aHN+Y4vjL6h88xVzdzCmZq2J2yqyFnvMjG1y7lQv+DRvg==", + "dev": true, + "requires": { + "mdast-util-to-string": "^1.0.2", + "unified-lint-rule": "^1.0.0", + "unist-util-visit": "^1.0.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "dev": true + }, + "unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dev": true, + "requires": { + "wrapped": "^1.0.1" + } + }, + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } + } + } + }, + "remark-lint-no-empty-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-empty-url/-/remark-lint-no-empty-url-4.0.1.tgz", + "integrity": "sha512-FSQIO+Q63kNNSUfbvvWPz6ES4q1gJIc4aMjohch9bfKwcv6wWZc6UkjlMMi823I124p6onrY/F8KKECv06H5YQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-file-name-articles": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-3.0.1.tgz", + "integrity": "sha512-h31ZDDJV2T6g9WLBrXg1CJ1m8M170O/tlDPAEPGCa/rxwKvMcfum4yicaot0ZKbUZ1uEPjVSUPDeo3sU0zciCQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-file-name-consecutive-dashes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-3.0.1.tgz", + "integrity": "sha512-qGJRZ81sowEjv1dBodbHZ29pDZbrFpxiQQ6gBvkkHkkoYPekdnr8iUxmV38HcqH8+JNW1O4ELr+m71AA9/34Mw==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-file-name-irregular-characters": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-irregular-characters/-/remark-lint-no-file-name-irregular-characters-3.0.1.tgz", + "integrity": "sha512-kNm16eDnPqbN05W0RLIedHi40YzHf1esPHbNKv12AljKWptdCTS72uGjAbqUSZ48dRoKtJzL0HJ0OAqXIWUyxA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-file-name-mixed-case": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-mixed-case/-/remark-lint-no-file-name-mixed-case-3.0.1.tgz", + "integrity": "sha512-cXVY0gM6DIHHK+mUhQVZ/WLh4cNfzEDpM54LNJBnflR9n9r6eNLR3JlWFRviTL4xRrQ5FXisBSlBa87BquiFVA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-file-name-outer-dashes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-3.0.1.tgz", + "integrity": "sha512-QIMrBPZKZ6BwQRPM65HhEHcJv6+wZnZ4z2ikvx2ht40cSmIN7ZTL7wKKJlnpF+4Ioi9XUj+cRHWqEhwJ9LCQIw==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-heading-content-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-5.0.1.tgz", + "integrity": "sha512-YIWktnZo7M9aw7PGnHdshvetSH3Y0qW+Fm143R66zsk5lLzn1XA5NEd/MtDzP8tSxxV+gcv+bDd5St1QUI4oSQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-heading-indent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-5.0.1.tgz", + "integrity": "sha512-R/KkR9Qfh0AM3asadSnQQXMHu6BNZxPbxLI9h9JBPIZM+EtzycDlhaAHbOlQUdaHA5UEANhYENZBLrueH50Cdg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-heading-like-paragraph": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-like-paragraph/-/remark-lint-no-heading-like-paragraph-4.0.1.tgz", + "integrity": "sha512-1sscTjv/F/mK5cNThz6fu57xcLgLdB0rl9vJ3BEwh7U4V5cIKp1tdFQhaguweSBnKCjCVaiU7HsEdle01Ai07Q==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-heading-punctuation": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-punctuation/-/remark-lint-no-heading-punctuation-4.0.0.tgz", + "integrity": "sha512-7V23C3Q4yX9zEOLZdbv6o8wVxxeWB/F+h9by55zPyk2AwbqF2t2xevnAmN3XFmKZABDTqLwjQxtK6bCVv/S1PQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-mdx": "^3.0.0", + "mdast-util-to-string": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-literal-urls": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-4.0.1.tgz", + "integrity": "sha512-RhTANFkFFXE6bM+WxWcPo2TTPEfkWG3lJZU50ycW7tJJmxUzDNzRed/z80EVJIdGwFa0NntVooLUJp3xrogalQ==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-multiple-toplevel-headings": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-4.0.1.tgz", + "integrity": "sha512-8sepobIOu3PlDOuMH7jtri+LH4tFNVQU+aqKSkrlNRdp831fYz9S+jA2crTVqWqxVbTwiF96uJWePv8/9qmHnA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-mdx": "^3.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-reference-like-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-reference-like-url/-/remark-lint-no-reference-like-url-4.0.1.tgz", + "integrity": "sha512-GXS73779bPnJSqvCfOK2XzGzCWL5ggyk53KE049oOYTS55vmc26PjeW+ykbGfXIazRazZ1DLGaAqNoU9jCnZ4w==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } + } + }, + "remark-lint-no-repeat-punctuation": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/remark-lint-no-repeat-punctuation/-/remark-lint-no-repeat-punctuation-0.1.4.tgz", + "integrity": "sha512-JJduCs4FimdBcR1AB576SqIYOjt+7t8OjTnnlZMvjnw7lzkuL0+nNNHyNXVPaK6jxaLjEUhrH2/smU6vZFUT7g==", + "dev": true, + "requires": { + "unified-lint-rule": "^1.0.3", + "unist-util-map": "^1.0.4", + "unist-util-to-list-of-char": "^0.1.3" + }, + "dependencies": { + "unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dev": true, + "requires": { + "wrapped": "^1.0.1" + } + } + } + }, + "remark-lint-no-shell-dollars": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-4.0.1.tgz", + "integrity": "sha512-UPE1DNCIkLtnS3YFD065Gkq5lQqfndBDpX8Ct/Zjn7M0/hzCyf9B6tpwCU0I20m9jzhS/CSY6mxYnAiEg+KkFA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "collapse-white-space": "^2.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-cli": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-10.0.1.tgz", - "integrity": "sha512-+eln31zLE69JwBMoa8nd2sPC0DFZyiWgBrshL8aKb3L2XXTRMuEKWE/IAtNPYEtcktceAQw+OpmqVy8pAmGOwQ==", + "remark-lint-no-shortcut-reference-image": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-4.0.1.tgz", + "integrity": "sha512-hQhJ3Dr8ZWRdj7qm6+9vcPpqtGchhENA2UHOmcTraLf6dN1cFATCgY/HbTbRIN6NkG/EEClTgRC1QCokWR2Mmw==", "dev": true, "requires": { - "remark": "^14.0.0", - "unified-args": "^9.0.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-frontmatter": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-frontmatter/-/remark-frontmatter-4.0.1.tgz", - "integrity": "sha512-38fJrB0KnmD3E33a5jZC/5+gGAC2WKNiPw1/fdXJvijBlhA7RCsvJklrYJakS0HedninvaCYW8lQGf9C918GfA==", + "remark-lint-no-shortcut-reference-link": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-4.0.0.tgz", + "integrity": "sha512-6jka2Zz3I6G2MvDcKrwADYhTOxHMFMK854u1cfBEIH5/XnCCXROtoqiiDtbZw+NJqbmwsBKvGL4t2gnmEJUmgg==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-frontmatter": "^1.0.0", - "micromark-extension-frontmatter": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-heading-gap": { + "remark-lint-no-table-indentation": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-heading-gap/-/remark-heading-gap-5.0.1.tgz", - "integrity": "sha512-Jt2Jh9K5tS7+gpMwddv7hQFpFiYYwB1LkcpvElx7DuNHIfx7LglMKVM/j0DojEVbSCX9U8wV4IotMYzdjk1++A==", + "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-5.0.1.tgz", + "integrity": "sha512-LHw9MGsuilM+3HkbRFZmdSE4T+sziaQzULH5ImYkLH2MLF8GKnAm2mgtveLZcW01wqFV2oEbpF1Y/s/QloXT7w==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.1.1.tgz", - "integrity": "sha512-zhe6twuqgkx/9KgZyNyaO0cceA4jQuJcyzMOBC+JZiAzMN6mFUmcssWZyY30ko8ut9vQDMX/pyQnolGn+Fg/Tw==", + "remark-lint-no-tabs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-4.0.1.tgz", + "integrity": "sha512-+lhGUgY3jhTwWn1x+tTIJNy5Fbs2NcYXCobRY7xeszY0VKPCBF2GyELafOVnr+iTmosXLuhZPp5YwNezQKH9IQ==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "remark-message-control": "^7.0.0", - "unified": "^10.1.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-blockquote-indentation": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.1.1.tgz", - "integrity": "sha512-u9cjedM6zcK8vRicis5n/xeOSDIC3FGBCKc3K9pqw+nNrOjY85FwxDQKZZ/kx7rmkdRZEhgyHak+wzPBllcxBQ==", + "remark-lint-no-undefined-references": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-5.0.0.tgz", + "integrity": "sha512-O0q8bHpRHK1T85oqO+uep4BkvQnZZp3y+wahDeeLLq9dCJfF56sq6Tt5OOTt1BAOZlpobS3OPQHUiJWYP6hX1w==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-location": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-checkbox-character-style": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.1.1.tgz", - "integrity": "sha512-KPSW3wfHfB8m9hzrtHiBHCTUIsOPX5nZR7VM+2pMjwqnhI6Mp94DKprkNo1ekNZALNeoZIDWZUSYxSiiwFfmVQ==", + "remark-lint-no-unused-definitions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-4.0.2.tgz", + "integrity": "sha512-KRzPmvfq6b3LSEcAQZobAn+5eDfPTle0dPyDEywgPSc3E7MIdRZQenL9UL8iIqHQWK4FvdUD0GX8FXGqu5EuCw==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-checkbox-content-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.1.1.tgz", - "integrity": "sha512-apkM6sqCwAHwNV0v6KuEbq50fH3mTAV4wKTwI1nWgEj33/nf4+RvLLPgznoc2olZyeAIHR69EKPQiernjCXPOw==", + "remark-lint-ordered-list-marker-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-4.0.1.tgz", + "integrity": "sha512-vZTAbstcBPbGwJacwldGzdGmKwy5/4r29SZ9nQkME4alEl5B1ReSBlYa8t7QnTSW7+tqvA9Sg71RPadgAKWa4w==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-code": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-code/-/remark-lint-code-2.0.0.tgz", - "integrity": "sha1-A+DC6Qru2+h1qHlf6s9XmIt9lXw=", + "remark-lint-ordered-list-marker-value": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-4.0.1.tgz", + "integrity": "sha512-HQb1MrArvApREC1/I6bkiFlZVDjngsuII29n8E8StnAaHOMN3hVYy6wJ9Uk+O3+X9O8v7fDsZPqFUHSfJhERXQ==", "dev": true, "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-visit": "^1.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "micromark-util-character": "^2.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "requires": { - "wrapped": "^1.0.1" + "@types/unist": "*" } }, - "unist-util-is": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "requires": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" } }, - "unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", "dev": true, "requires": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "remark-lint-code-block-style": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.1.0.tgz", - "integrity": "sha512-Hv4YQ8ueLGpjItla4CkcOkcfGj+nlquqylDgCm1/xKnW+Ke2a4qVTMVJrP9Krp4FWmXgktJLDHjhRH+pzhDXLg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-definition-case": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-definition-case/-/remark-lint-definition-case-3.1.1.tgz", - "integrity": "sha512-dirX0BSfbm1Ixx4Hv4xRQliEP1rw8dDitw2Om3XcO2QqF8bWrzF06/xeMlDNAaT77Cxqb9S7bODo/q+CYUxyWQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-definition-spacing": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.1.1.tgz", - "integrity": "sha512-PR+cYvc0FMtFWjkaXePysW88r7Y7eIwbpUGPFDIWE48fiRiz8U3VIk05P3loQCpCkbmUeInAAYD8tIFPTg4Jlg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-emphasis-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-3.1.1.tgz", - "integrity": "sha512-VduuT+KAr0vA78xBLJdIcenCQja4mAd81aNACfdz7BUPLphIQa84D5uzl+nZatSaCXLebCNp5jP/bzVUsBmRKw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-fenced-code-flag": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.1.1.tgz", - "integrity": "sha512-FFVZmYsBccKIIEgOtgdZEpQdARtAat1LTLBydnIpyNIvcntzWwtrtlj9mtjL8ZoSRre8HtwmEnBFyOfmM/NWaA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-fenced-code-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.1.1.tgz", - "integrity": "sha512-x/t8sJWPvE46knKz6zW03j9VX5477srHUmRFbnXhZ3K8e37cYVUIvfbPhcPCAosSsOki9+dvGfZsWQiKuUNNfQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-file-extension": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.1.1.tgz", - "integrity": "sha512-r6OMe27YZzr2NFjPMbBxgm8RZxigRwzeFSjapPlqcxk0Q0w/6sosJsceBNlGGlk00pltvv7NPqSexbXUjirrQQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-final-definition": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.1.1.tgz", - "integrity": "sha512-94hRV+EBIuLVFooiimsZwh5ZPEcTqjy5wr7LgqxoUUWy+srTanndaLoki7bxQJeIcWUnomZncsJAyL0Lo7toxw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-final-newline": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.1.1.tgz", - "integrity": "sha512-cgKYaI7ujUse/kV4KajLv2j1kmi1CxpAu+w7wIU0/Faihhb3sZAf4a5ACf2Wu8NoTSIr1Q//3hDysG507PIoDg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-hard-break-spaces": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.1.1.tgz", - "integrity": "sha512-UfwFvESpX32qwyHJeluuUuRPWmxJDTkmjnWv2r49G9fC4Jrzm4crdJMs3sWsrGiQ3mSex6bgp/8rqDgtBng2IA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-heading-increment": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-heading-increment/-/remark-lint-heading-increment-3.1.1.tgz", - "integrity": "sha512-DtiMwZNAE/iAZWuZGjTXxYjNDQ375r59C99aVeVp1nKaovIufKuHWAm9U/9FAGBJNgBx6Ovfdej4YwIxd0yAPw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-heading-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.1.1.tgz", - "integrity": "sha512-Qm7ZAF+s46ns0Wo5TlHGIn/PPMMynytn8SSLEdMIo6Uo/+8PAcmQ3zU1pj57KYxfyDoN5iQPgPIwPYMLYQ2TSQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-heading-style": "^2.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-heading-whitespace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-heading-whitespace/-/remark-lint-heading-whitespace-1.0.0.tgz", - "integrity": "sha512-DykoBIXNbkihg64D+mztSOv3l82RTH4tIZW/HUB4QM4NpIEB+pVIPQpCYD0K4pTgvKiwoqsj4NY8qJ1EhNHAmQ==", + "remark-lint-rule-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-4.0.1.tgz", + "integrity": "sha512-gl1Ft13oTS3dJUCsWZzxD/5dAwI1HON67KU7uNfODD5gXJ8Y11deOWbun190ma7XbYdD7P0l8VT2HeRtEQzrWg==", "dev": true, "requires": { - "mdast-util-to-string": "^1.0.4", - "unified-lint-rule": "^1.0.2", - "unist-util-visit": "^1.3.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "dependencies": { - "mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "requires": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" } }, - "unist-util-is": { + "unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "dev": true + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } }, - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "requires": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0" } }, - "unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "requires": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "remark-lint-link-title-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-link-title-style/-/remark-lint-link-title-style-3.1.1.tgz", - "integrity": "sha512-JWWiuUFy/N2iwQ3eWIxFy6olX8D7xCFw8LoM0vZI2CHTZJrmDMaWwnl8jziP+HHHheFX3wkVqsoaYod536ArRw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" - } - }, - "remark-lint-list-item-bullet-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.1.1.tgz", - "integrity": "sha512-NFvXVj1Nm12+Ma48NOjZCGb/D0IhmUcxyrTCpPp+UNJhEWrmFxM8nSyIiZgXadgXErnuv+xm2Atw7TAcZ9a1Cg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-list-item-content-indent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-content-indent/-/remark-lint-list-item-content-indent-3.1.1.tgz", - "integrity": "sha512-gcZhAXLd1onkutTEqQTybyANjdxvlOlu0y/AU4H3f6L99UGC85ymRhEeu5vGSkvsKKPR1FrMTEH6G2nNgtavgg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-list-item-indent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.1.1.tgz", - "integrity": "sha512-OSTG64e52v8XBmmeT0lefpiAfCMYHJxMMUrMnhTjLVyWAbEO0vqqR5bLvfLwzK+P4nY2D/8XKku0hw35dM86Rw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-list-item-spacing": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-spacing/-/remark-lint-list-item-spacing-4.1.1.tgz", - "integrity": "sha512-MqXmahPgYrvfA7SPqmcAC6fI40jIgXG33EeE/MhFvMLWh04k+fqGf2O2aH1KT664MlwM4oETbTI4xj3/KCIHZA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-maximum-heading-length": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-heading-length/-/remark-lint-maximum-heading-length-3.1.1.tgz", - "integrity": "sha512-hTOvRDnULpu0S+k51lovT28TLBgtw8XR0qq+mECSsoyuT4C38UBjQRic5OPo68AZMH0ad/93uj6yvfFtH0K8Lg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-maximum-line-length": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.1.2.tgz", - "integrity": "sha512-KwddpVmNifTHNXwTQQgVufuUvv0hhu9kJVvmpNdEvfEc7tc3wBkaavyi3kKsUB8WwMhGtZuXVWy6OdPC1axzhw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-auto-link-without-protocol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.1.1.tgz", - "integrity": "sha512-lCjBuoSUWjN1kO0J7vqQgn7HUF/WeOHOqc3oiq9LMRXIovKWqPCBi77o8Npv8KfV+JXeRl+hrupfbhJXlLturA==", + "remark-lint-strong-marker": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-4.0.1.tgz", + "integrity": "sha512-KaGtj/OWEP4eoafevnlp3NsEVwC7yGEjBJ6uFMzfjNoXyjATdfZ2euB/AfKVt/A/FdZeeMeVoAUFH4DL+hScLQ==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-no-blockquote-without-marker": { + "remark-lint-table-cell-padding": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.1.1.tgz", - "integrity": "sha512-7jL7eKS25kKRhQ7SKKB5eRfNleDMWKWAmZ5Y/votJdDoM+6qsopLLumPWaSzP0onyV3dyHRhPfBtqelt3hvcyA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" - } - }, - "remark-lint-no-consecutive-blank-lines": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.1.2.tgz", - "integrity": "sha512-wRsR3kFgHaZ4mO3KASU43oXGLGezNZ64yNs1ChPUacKh0Bm7cwGnxN9GHGAbOXspwrYrN2eCDxzCbdPEZi2qKw==", + "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-5.1.1.tgz", + "integrity": "sha512-6fgVA1iINBoAJaZMOnSsxrF9Qj9+hmCqrsrqZqgJJETjT1ODGH64iAN1/6vHR7dIwmy73d6ysB2WrGyKhVlK3A==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-dead-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-1.1.0.tgz", - "integrity": "sha512-it3EZmMQ+hwGhUf60NkXN0mMIFuFkS0cxdbgEbhZ/Fj1PlUBpe3gDBtWJ/sqNwSNvQlNSzpvMQkNHSoAhlsVjA==", - "dev": true, - "requires": { - "check-links": "^1.1.8", - "is-online": "^8.2.1", - "unified-lint-rule": "^1.0.4", - "unist-util-visit": "^2.0.1" + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dev": true, "requires": { - "wrapped": "^1.0.1" + "@types/unist": "*" } }, - "unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" } }, - "unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "remark-lint-no-duplicate-definitions": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.1.1.tgz", - "integrity": "sha512-9p+nBz8VvV+t4g/ALNLVN8naV+ffAzC4ADyg9QivzmKwLjyF93Avt4HYNlb2GZ+aoXRQSVG1wjjWFeDC9c7Tdg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-duplicate-headings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-headings/-/remark-lint-no-duplicate-headings-3.1.1.tgz", - "integrity": "sha512-gSO/BngGkxF35Fsctzt3YMwGEZ8F7f71zx7h0Y97DylyL6WXVuWP4saCmQTlbB4FpD0UXEnRROJ6fBFDvJlzOA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-emphasis-as-heading": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-emphasis-as-heading/-/remark-lint-no-emphasis-as-heading-3.1.1.tgz", - "integrity": "sha512-F45yuLsYVP4r6OjVtePKk7Aymnf3rBLHXYjnSJggEaYn0j+72xOBLrqmj6ii5YGfDsBwG2pDNTBx4vm3xM7P0Q==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-empty-sections": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-empty-sections/-/remark-lint-no-empty-sections-4.0.0.tgz", - "integrity": "sha512-Tx1nCu7Dq3dsJ500402sSvM0uVK/6khSuEjx8K8u9aHN+Y4vjL6h88xVzdzCmZq2J2yqyFnvMjG1y7lQv+DRvg==", + "remark-lint-table-pipe-alignment": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipe-alignment/-/remark-lint-table-pipe-alignment-4.1.1.tgz", + "integrity": "sha512-9VxivIJaDonrd/Jgkim1oYQ5MIqhWmyJggr2AqtiizwqxT4epRsWmLOz+/sk7PtTGoT/MtwndhlbM3lxuVXFow==", "dev": true, "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-visit": "^1.0.0" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-phrasing": "^4.0.0", + "pluralize": "^8.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" }, "dependencies": { - "mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", "dev": true }, - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dev": true, "requires": { - "wrapped": "^1.0.1" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" } }, - "unist-util-is": { + "unified-lint-rule": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", - "dev": true + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } }, - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, "requires": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0" } }, - "unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "requires": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "remark-lint-no-empty-url": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-empty-url/-/remark-lint-no-empty-url-3.1.1.tgz", - "integrity": "sha512-zxIkDMggf6R/NCDkYAsaVHaFhklkp6WvV/wdeJAzT3BverGFnM8QIHUAv8YIQvCGqYWov275SVN1eu81DoU95g==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-file-name-articles": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.1.1.tgz", - "integrity": "sha512-7fiHKQUGvP4WOsieZ1dxm8WQWWjXjPj0Uix6pk2dSTJqxvaosjKH1AV0J/eVvliat0BGH8Cz4SUbuz5vG6YbdQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-no-file-name-consecutive-dashes": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.1.1.tgz", - "integrity": "sha512-tM4IpURGuresyeIBsXT5jsY3lZakgO6IO59ixcFt015bFjTOW54MrBvdJxA60QHhf5DAyHzD8wGeULPSs7ZQfg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-no-file-name-irregular-characters": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-irregular-characters/-/remark-lint-no-file-name-irregular-characters-2.1.1.tgz", - "integrity": "sha512-rVeCv1XRdLtp/rxLaiFKElaIHuIlokypV/c2aCG3VVYcQ4+ZmJxq018kEsolR2+Dv9m3vKp8Fy1482US4g4WKA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-no-file-name-mixed-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-mixed-case/-/remark-lint-no-file-name-mixed-case-2.1.1.tgz", - "integrity": "sha512-mJU3hYzyXNo8NkoSafPcsgr+Gema+vDCzNWlLw05UdFXJK/cVy+6DVsbrEFjrz8L+WF7uQmUHBtTvd91SqoItg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-no-file-name-outer-dashes": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.1.1.tgz", - "integrity": "sha512-2kRcVNzZb0zS3jE+Iaa6MEpplhqXSdsHBILS+BxJ4cDGAAIdeipY8hKaDLdZi+34wvrfnDxNgvNLcHpgqO+OZA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - } - }, - "remark-lint-no-heading-content-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.1.1.tgz", - "integrity": "sha512-W4zF7MA72IDC5JB0qzciwsnioL5XlnoE0r1F7sDS0I5CJfQtHYOLlxb3UAIlgRCkBokPWCp0E4o1fsY/gQUKVg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-heading-style": "^2.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-heading-indent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.1.1.tgz", - "integrity": "sha512-3vIfT7gPdpE9D7muIQ6YzSF1q27H9SbsDD7ClJRkEWxMiAzBg0obOZFOIBYukUkmGWdOR5P1EDn5n9TEzS1Fyg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-heading-like-paragraph": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-like-paragraph/-/remark-lint-no-heading-like-paragraph-3.1.1.tgz", - "integrity": "sha512-eDQkw1ir0j2VVmZd60Hy3CUAj85U7zKf59bGEBdXr2OQYJQhvme7XqKwY8QfMlBqn9lYg1/DxsGWt0+5ESIogw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-heading-punctuation": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-punctuation/-/remark-lint-no-heading-punctuation-3.1.1.tgz", - "integrity": "sha512-ZexHx4rmsjKVF1/Fvdig0yOgpWl0wFa43+sqg880HT3PW9KmEczjSRkwlMaTlVgDzC0paNn2FXfQMuEQW4YDLg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-inline-padding": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.1.1.tgz", - "integrity": "sha512-++IMm6ohOPKNOrybqjP9eiclEtVX/Rd2HpF2UD9icrC1X5nvrI6tlfN55tePaFvWAB7pe6MW4LzNEMnWse61Lw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-literal-urls": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.1.1.tgz", - "integrity": "sha512-tZZ4gtZMA//ZAf7GJTE8S9yjzqXUfUTlR/lvU7ffc7NeSurqCBwAtHqeXVCHiD39JnlHVSW2MLYhvHp53lBGvA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-multiple-toplevel-headings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.1.1.tgz", - "integrity": "sha512-bM//SIBvIkoGUpA8hR5QibJ+7C2R50PTIRrc4te93YNRG+ie8bJzjwuO9jIMedoDfJB6/+7EqO9FYBivjBZ3MA==", + "remark-lint-table-pipes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-5.0.1.tgz", + "integrity": "sha512-oOkRC0WRRDwvodfffGafoBFBTGwy9udQgKtxN53apmZpOmaUAxTi833ite0jMo078+LehNftO5bxrElZ9EQUlQ==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-stringify-position": "^3.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-no-reference-like-url": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-reference-like-url/-/remark-lint-no-reference-like-url-3.1.1.tgz", - "integrity": "sha512-ELO2uez1NO9wEb2nNRY4uVBfw4TYYUHWOnLajExGY92+i3Ylt3EmMwRONT2maJX5qKj4cu8uPi7HAkMIxq8jFg==", + "remark-lint-unordered-list-marker-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-4.0.1.tgz", + "integrity": "sha512-HMrVQC0Qbr8ktSy+1lJGRGU10qecL3T14L6s/THEQXR5Tk0wcsLLG0auNvB4r2+H+ClhVO/Vnm1TEosh1OCsfw==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "unified-lint-rule": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit-parents": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unified-lint-rule": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-3.0.0.tgz", + "integrity": "sha512-Sz96ILLsTy3djsG3H44zFb2b77MFf9CQVYnV3PWkxgRX8/n31fFrr+JnzUaJ6cbOHTtZnL1A71+YodsTjzwAew==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "trough": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-no-repeat-punctuation": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/remark-lint-no-repeat-punctuation/-/remark-lint-no-repeat-punctuation-0.1.4.tgz", - "integrity": "sha512-JJduCs4FimdBcR1AB576SqIYOjt+7t8OjTnnlZMvjnw7lzkuL0+nNNHyNXVPaK6jxaLjEUhrH2/smU6vZFUT7g==", + "remark-lint-write-good": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remark-lint-write-good/-/remark-lint-write-good-1.2.0.tgz", + "integrity": "sha512-HYiwM16RRBm979yDb/IVwPe1eFhzA1HATe1WucRiYWS10jcPRgJe9FihH7W5uzQFDqX5aRbTtu/yPdq+hPnYkw==", "dev": true, "requires": { - "unified-lint-rule": "^1.0.3", - "unist-util-map": "^1.0.4", - "unist-util-to-list-of-char": "^0.1.3" + "nlcst-to-string": "^2.0.0", + "unified-lint-rule": "^1.0.1", + "unist-util-visit": "^1.1.1", + "write-good": "^1.0.2" }, "dependencies": { "unified-lint-rule": { @@ -10161,436 +24879,695 @@ "requires": { "wrapped": "^1.0.1" } + }, + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } } } }, - "remark-lint-no-shell-dollars": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.1.1.tgz", - "integrity": "sha512-Q3Ad1TaOPxbYog5+Of/quPG3Fy+dMKiHjT8KsU7NDiHG6YJOnAJ3f3w+y13CIlNIaKc/MrisgcthhrZ7NsgXfA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-shortcut-reference-image": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.1.1.tgz", - "integrity": "sha512-m8tH+loDagd1JUns/T4eyulVXgVvE+ZSs7owRUOmP+dgsKJuO5sl1AdN9eyKDVMEvxHF3Pm5WqE62QIRNM48mA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-shortcut-reference-link": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.1.1.tgz", - "integrity": "sha512-oDJ92/jXQ842HgrBGgZdP7FA+N2jBMCBU2+jRElkS+OWVut0UaDILtNavNy/e85B3SLPj3RoXKF96M4vfJ7B2A==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-no-table-indentation": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.1.1.tgz", - "integrity": "sha512-eklvBxUSrkVbJxeokepOvFZ3n2V6zaJERIiOowR+y/Bz4dRHDMij1Ojg55AMO9yUMvxWPV3JPOeThliAcPmrMg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" - } - }, - "remark-lint-no-tabs": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.1.1.tgz", - "integrity": "sha512-+MjXoHSSqRFUUz6XHgB1z7F5zIETxhkY+lC5LsOYb1r2ZdujZQWzBzNW5ya4HH5JiDVBPhp8MrqM9cP1v7tB5g==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "vfile-location": "^4.0.0" - } - }, - "remark-lint-no-undefined-references": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.1.1.tgz", - "integrity": "sha512-J20rKfTGflLiTI3T5JlLZSmINk6aDGmZi1y70lpU69LDfAyHAKgDK6sSW9XDeFmCPPdm8Ybxe5Gf2a70k+GcVQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" - } - }, - "remark-lint-no-unused-definitions": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.1.1.tgz", - "integrity": "sha512-/GtyBukhAxi5MEX/g/m+FzDEflSbTe2/cpe2H+tJZyDmiLhjGXRdwWnPRDp+mB9g1iIZgVRCk7T4v90RbQX/mw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-ordered-list-marker-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.1.1.tgz", - "integrity": "sha512-IWcWaJoaSb4yoSOuvDbj9B2uXp9kSj58DqtrMKo8MoRShmbj1onVfulTxoTLeLtI11NvW+mj3jPSpqjMjls+5Q==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-ordered-list-marker-value": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-3.1.1.tgz", - "integrity": "sha512-+bQZbo+v/A8CuLrO71gobJuKR4/sfnPgWyEggSa+zq+LXPK1HiMDjap0Wr07uYgcUXsXIPh+HD/5J5by6JL+vg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-rule-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.1.1.tgz", - "integrity": "sha512-+oZe0ph4DWHGwPkQ/FpqiGp4WULTXB1edftnnNbizYT+Wr+/ux7GNTx78oXH/PHwlnOtVIExMc4W/vDXrUj/DQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - } - }, - "remark-lint-strong-marker": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.1.1.tgz", - "integrity": "sha512-tX9Os2C48Hh8P8CouY4dcnAhGnR3trL+NCDqIvJvFDR9Rvm9yfNQaY2N4ZHWVY0iUicq9DpqEiJTgUsT8AGv/w==", + "remark-message-control": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-8.0.0.tgz", + "integrity": "sha512-brpzOO+jdyE/mLqvqqvbogmhGxKygjpCUCG/PwSCU43+JZQ+RM+sSzkCWBcYvgF3KIAVNIoPsvXjBkzO7EdsYQ==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-comment-marker": "^3.0.0", + "unified-message-control": "^5.0.0", + "vfile": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-table-cell-padding": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.1.2.tgz", - "integrity": "sha512-cx5BXjHtpACa7Z51Vuqzy9BI4Z8Hnxz7vklhhrubkoB7mbctP/mR+Nh4B8eE5VtgFYJNHFwIltl96PuoctFCeQ==", + "remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-table-pipe-alignment": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipe-alignment/-/remark-lint-table-pipe-alignment-3.1.1.tgz", - "integrity": "sha512-WOHv2yL4ZwXHM06MIyQNnGFYKz9m2k/GFIA/6hpArF8Ph/3v8CF0J/Hb3Yyfg39e5nODw3D2G3okCO+xgyGQGA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "remark-preset-lint-consistent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-consistent/-/remark-preset-lint-consistent-6.0.1.tgz", + "integrity": "sha512-SOLdA36UOU1hiGFm6HAqN9+DORGJPVWxU/EvPVkknTr9V4ULhlzHEJ8OVRMVX3jqoy4lrwb4IqiboVz0YLA7+Q==", + "dev": true, + "requires": { + "remark-lint": "^10.0.0", + "remark-lint-blockquote-indentation": "^4.0.0", + "remark-lint-checkbox-character-style": "^5.0.0", + "remark-lint-code-block-style": "^4.0.0", + "remark-lint-emphasis-marker": "^4.0.0", + "remark-lint-fenced-code-marker": "^4.0.0", + "remark-lint-heading-style": "^4.0.0", + "remark-lint-link-title-style": "^4.0.0", + "remark-lint-list-item-content-indent": "^4.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "remark-lint-ordered-list-marker-value": "^4.0.0", + "remark-lint-rule-style": "^4.0.0", + "remark-lint-strong-marker": "^4.0.0", + "remark-lint-table-cell-padding": "^5.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-table-pipes": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.1.1.tgz", - "integrity": "sha512-mJnB2FpjJTE4s9kE1JX8gcCjCFvtGPjzXUiQy0sbPHn2YM9EWG7kvFWYoqWK4w569CEQJyxZraEPltmhDjQTjg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "remark-preset-lint-markdown-style-guide": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-markdown-style-guide/-/remark-preset-lint-markdown-style-guide-6.0.1.tgz", + "integrity": "sha512-hVCRMC8PZlI9hnXkZdrvg4n4j1aD//xHWj26Q7iFAbDB3JKtW1Ne72P7QNVyppmdrR6Gj84zhG3qphOLo8/i8A==", + "dev": true, + "requires": { + "remark-lint": "^10.0.0", + "remark-lint-blockquote-indentation": "^4.0.0", + "remark-lint-code-block-style": "^4.0.0", + "remark-lint-definition-case": "^4.0.0", + "remark-lint-definition-spacing": "^4.0.0", + "remark-lint-emphasis-marker": "^4.0.0", + "remark-lint-fenced-code-flag": "^4.0.0", + "remark-lint-fenced-code-marker": "^4.0.0", + "remark-lint-file-extension": "^3.0.0", + "remark-lint-final-definition": "^4.0.0", + "remark-lint-hard-break-spaces": "^4.0.0", + "remark-lint-heading-increment": "^4.0.0", + "remark-lint-heading-style": "^4.0.0", + "remark-lint-link-title-style": "^4.0.0", + "remark-lint-list-item-content-indent": "^4.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-lint-list-item-spacing": "^5.0.0", + "remark-lint-maximum-heading-length": "^4.0.0", + "remark-lint-maximum-line-length": "^4.0.0", + "remark-lint-no-blockquote-without-marker": "^6.0.0", + "remark-lint-no-consecutive-blank-lines": "^5.0.0", + "remark-lint-no-duplicate-headings": "^4.0.0", + "remark-lint-no-emphasis-as-heading": "^4.0.0", + "remark-lint-no-file-name-articles": "^3.0.0", + "remark-lint-no-file-name-consecutive-dashes": "^3.0.0", + "remark-lint-no-file-name-irregular-characters": "^3.0.0", + "remark-lint-no-file-name-mixed-case": "^3.0.0", + "remark-lint-no-file-name-outer-dashes": "^3.0.0", + "remark-lint-no-heading-punctuation": "^4.0.0", + "remark-lint-no-literal-urls": "^4.0.0", + "remark-lint-no-multiple-toplevel-headings": "^4.0.0", + "remark-lint-no-shell-dollars": "^4.0.0", + "remark-lint-no-shortcut-reference-image": "^4.0.0", + "remark-lint-no-shortcut-reference-link": "^4.0.0", + "remark-lint-no-table-indentation": "^5.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "remark-lint-ordered-list-marker-value": "^4.0.0", + "remark-lint-rule-style": "^4.0.0", + "remark-lint-strong-marker": "^4.0.0", + "remark-lint-table-cell-padding": "^5.0.0", + "remark-lint-table-pipe-alignment": "^4.0.0", + "remark-lint-table-pipes": "^5.0.0", + "remark-lint-unordered-list-marker-style": "^4.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-unordered-list-marker-style": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.1.1.tgz", - "integrity": "sha512-JwH8oIDi9f5Z8cTQLimhJ/fkbPwI3OpNSifjYyObNNuc4PG4/NUoe5ZuD10uPmPYHZW+713RZ8S5ucVCkI8dDA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "remark-preset-lint-recommended": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-7.0.1.tgz", + "integrity": "sha512-j1CY5u48PtZl872BQ40uWSQMT3R4gXKp0FUgevMu5gW7hFMtvaCiDq+BfhzeR8XKKiW9nIMZGfIMZHostz5X4g==", + "dev": true, + "requires": { + "remark-lint": "^10.0.0", + "remark-lint-final-newline": "^3.0.0", + "remark-lint-hard-break-spaces": "^4.0.0", + "remark-lint-list-item-bullet-indent": "^5.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-lint-no-blockquote-without-marker": "^6.0.0", + "remark-lint-no-duplicate-definitions": "^4.0.0", + "remark-lint-no-heading-content-indent": "^5.0.0", + "remark-lint-no-literal-urls": "^4.0.0", + "remark-lint-no-shortcut-reference-image": "^4.0.0", + "remark-lint-no-shortcut-reference-link": "^4.0.0", + "remark-lint-no-undefined-references": "^5.0.0", + "remark-lint-no-unused-definitions": "^4.0.0", + "remark-lint-ordered-list-marker-style": "^4.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, - "remark-lint-write-good": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remark-lint-write-good/-/remark-lint-write-good-1.2.0.tgz", - "integrity": "sha512-HYiwM16RRBm979yDb/IVwPe1eFhzA1HATe1WucRiYWS10jcPRgJe9FihH7W5uzQFDqX5aRbTtu/yPdq+hPnYkw==", - "dev": true, - "requires": { - "nlcst-to-string": "^2.0.0", - "unified-lint-rule": "^1.0.1", - "unist-util-visit": "^1.1.1", - "write-good": "^1.0.2" + "remark-retext": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-retext/-/remark-retext-6.0.1.tgz", + "integrity": "sha512-GZk8Fa/h88+OhmUlJuqEFX4Pi7OvgI3pq1bHyr/NJibTQxANH8/aZGoOflh4zDAwVDdvgoEk5XOJsWQ8UfjFnA==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0", + "@types/nlcst": "^2.0.0", + "mdast-util-to-nlcst": "^7.0.0", + "parse-latin": "^7.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", "dev": true, "requires": { - "wrapped": "^1.0.1" + "@types/unist": "*" } }, - "unist-util-is": { + "@types/unist": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", - "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", "dev": true }, - "unist-util-visit": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", - "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", "dev": true, "requires": { - "unist-util-visit-parents": "^2.0.0" + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" } }, - "unist-util-visit-parents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", - "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "requires": { - "unist-util-is": "^3.0.0" + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "remark-message-control": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.1.1.tgz", - "integrity": "sha512-xKRWl1NTBOKed0oEtCd8BUfH5m4s8WXxFFSoo7uUwx6GW/qdCy4zov5LfPyw7emantDmhfWn5PdIZgcbVcWMDQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-comment-marker": "^2.0.0", - "unified": "^10.0.0", - "unified-message-control": "^4.0.0", - "vfile": "^5.0.0" - } - }, - "remark-parse": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz", - "integrity": "sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" - } - }, - "remark-preset-lint-consistent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/remark-preset-lint-consistent/-/remark-preset-lint-consistent-5.1.1.tgz", - "integrity": "sha512-DZQfomiVi/1x7NRByWrOiIC+olEGa1PpyykKrowvYp5qr/Seq60FqU7OjBJxtcOLzgnQcu9Y2JXdHxFi4AAPXQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-blockquote-indentation": "^3.0.0", - "remark-lint-checkbox-character-style": "^4.0.0", - "remark-lint-code-block-style": "^3.0.0", - "remark-lint-emphasis-marker": "^3.0.0", - "remark-lint-fenced-code-marker": "^3.0.0", - "remark-lint-heading-style": "^3.0.0", - "remark-lint-link-title-style": "^3.0.0", - "remark-lint-list-item-content-indent": "^3.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "remark-lint-rule-style": "^3.0.0", - "remark-lint-strong-marker": "^3.0.0", - "remark-lint-table-cell-padding": "^4.0.0", - "unified": "^10.0.0" - } - }, - "remark-preset-lint-markdown-style-guide": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/remark-preset-lint-markdown-style-guide/-/remark-preset-lint-markdown-style-guide-5.1.2.tgz", - "integrity": "sha512-MIAhnz0wDOq/MqLucSaAPquKGFE2I5SxqRjgWT+ZGK7TmqTxrro53e11/Pc19xPX4evmzI5CZdvaRnIoxP3ysQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-blockquote-indentation": "^3.0.0", - "remark-lint-code-block-style": "^3.0.0", - "remark-lint-definition-case": "^3.0.0", - "remark-lint-definition-spacing": "^3.0.0", - "remark-lint-emphasis-marker": "^3.0.0", - "remark-lint-fenced-code-flag": "^3.0.0", - "remark-lint-fenced-code-marker": "^3.0.0", - "remark-lint-file-extension": "^2.0.0", - "remark-lint-final-definition": "^3.0.0", - "remark-lint-hard-break-spaces": "^3.0.0", - "remark-lint-heading-increment": "^3.0.0", - "remark-lint-heading-style": "^3.0.0", - "remark-lint-link-title-style": "^3.0.0", - "remark-lint-list-item-content-indent": "^3.0.0", - "remark-lint-list-item-indent": "^3.0.0", - "remark-lint-list-item-spacing": "^4.0.0", - "remark-lint-maximum-heading-length": "^3.0.0", - "remark-lint-maximum-line-length": "^3.0.0", - "remark-lint-no-blockquote-without-marker": "^5.0.0", - "remark-lint-no-consecutive-blank-lines": "^4.0.0", - "remark-lint-no-duplicate-headings": "^3.0.0", - "remark-lint-no-emphasis-as-heading": "^3.0.0", - "remark-lint-no-file-name-articles": "^2.0.0", - "remark-lint-no-file-name-consecutive-dashes": "^2.0.0", - "remark-lint-no-file-name-irregular-characters": "^2.0.0", - "remark-lint-no-file-name-mixed-case": "^2.0.0", - "remark-lint-no-file-name-outer-dashes": "^2.0.0", - "remark-lint-no-heading-punctuation": "^3.0.0", - "remark-lint-no-inline-padding": "^4.0.0", - "remark-lint-no-literal-urls": "^3.0.0", - "remark-lint-no-multiple-toplevel-headings": "^3.0.0", - "remark-lint-no-shell-dollars": "^3.0.0", - "remark-lint-no-shortcut-reference-image": "^3.0.0", - "remark-lint-no-shortcut-reference-link": "^3.0.0", - "remark-lint-no-table-indentation": "^4.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "remark-lint-ordered-list-marker-value": "^3.0.0", - "remark-lint-rule-style": "^3.0.0", - "remark-lint-strong-marker": "^3.0.0", - "remark-lint-table-cell-padding": "^4.0.0", - "remark-lint-table-pipe-alignment": "^3.0.0", - "remark-lint-table-pipes": "^4.0.0", - "remark-lint-unordered-list-marker-style": "^3.0.0", - "unified": "^10.0.0" - } - }, - "remark-preset-lint-recommended": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.1.2.tgz", - "integrity": "sha512-x9kWufNY8PNAhY4fsl+KD3atgQdo4imP3GDAQYbQ6ylWVyX13suPRLkqnupW0ODRynfUg8ZRt8pVX0wMHwgPAg==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "remark-lint": "^9.0.0", - "remark-lint-final-newline": "^2.0.0", - "remark-lint-hard-break-spaces": "^3.0.0", - "remark-lint-list-item-bullet-indent": "^4.0.0", - "remark-lint-list-item-indent": "^3.0.0", - "remark-lint-no-blockquote-without-marker": "^5.0.0", - "remark-lint-no-duplicate-definitions": "^3.0.0", - "remark-lint-no-heading-content-indent": "^4.0.0", - "remark-lint-no-inline-padding": "^4.0.0", - "remark-lint-no-literal-urls": "^3.0.0", - "remark-lint-no-shortcut-reference-image": "^3.0.0", - "remark-lint-no-shortcut-reference-link": "^3.0.0", - "remark-lint-no-undefined-references": "^4.0.0", - "remark-lint-no-unused-definitions": "^3.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "unified": "^10.0.0" - } - }, - "remark-retext": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-retext/-/remark-retext-5.0.1.tgz", - "integrity": "sha512-h3kOjKNy7oJfohqXlKp+W4YDigHD3rw01x91qvQP/cUkK5nJrDl6yEYwTujQCAXSLZrsBxywlK3ntzIX6c29aA==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "mdast-util-to-nlcst": "^5.0.0", - "unified": "^10.0.0" - } - }, "remark-stringify": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-10.0.2.tgz", - "integrity": "sha512-6wV3pvbPvHkbNnWB0wdDvVFHOe1hBRAx1Q/5g/EpH4RppAII6J8Gnwe7VbHuXaoKIF6LAg6ExTel/+kNqSQ7lw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unified": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.3.tgz", + "integrity": "sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, "remark-textr": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/remark-textr/-/remark-textr-5.0.1.tgz", - "integrity": "sha512-Kd5q7I1LsZ04meMZJJwBze/wxiLhAItRTGevDeyx3K/WMd4juO6WbGLro0/99Ui6I+lYx/l90v0Ax4dVPj3/0Q==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/remark-textr/-/remark-textr-6.1.0.tgz", + "integrity": "sha512-3A61/6Dn8x5wS7f9BubnIjwZfttEw9+PWVFtwOvRzKXLmZDV1mgi9MJeaQ9BNzWhojsSRHWLNa2JHKCOOI5DfA==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", "textr": "^0.3.0", - "unified": "^10.0.0", - "unist-util-visit": "^4.0.0" + "unist-util-visit": "^5.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + } } }, "remark-validate-links": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/remark-validate-links/-/remark-validate-links-11.0.2.tgz", - "integrity": "sha512-SfVDWgF/Albdou1TmrCpq4AvJyvMnPflnaLLPUuFFxKO4Jp1o7fK2sinqPt+WW0DXS4JmtXPXm2FOkB8FJ08tQ==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/remark-validate-links/-/remark-validate-links-13.1.0.tgz", + "integrity": "sha512-z+glZ4zoRyrWimQHtoqJEFJdPoIR1R1SDr/JoWjmS6EsYlyhxNuCHtIt165gmV7ltOSFJ+rGsipqRGfBPInd7A==", "dev": true, "requires": { - "@types/mdast": "^3.0.0", - "github-slugger": "^1.0.0", - "hosted-git-info": "^4.0.0", - "mdast-util-to-string": "^3.0.0", + "@types/hosted-git-info": "^3.0.0", + "@types/mdast": "^4.0.0", + "github-slugger": "^2.0.0", + "hosted-git-info": "^7.0.0", + "mdast-util-to-hast": "^13.0.0", + "mdast-util-to-string": "^4.0.0", "propose": "0.0.5", - "to-vfile": "^7.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", - "unified-engine": "^9.0.0", - "unist-util-visit": "^4.0.0", - "vfile": "^5.0.0" + "unified-engine": "^11.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "dependencies": { + "@types/mdast": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.1.tgz", + "integrity": "sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "requires": { + "@types/mdast": "^4.0.0" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, "resolve": { @@ -10605,6 +25582,12 @@ "supports-preserve-symlinks-flag": "^1.0.0" } }, + "resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -10613,12 +25596,12 @@ "peer": true }, "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", "dev": true, "requires": { - "lowercase-keys": "^1.0.0" + "lowercase-keys": "^2.0.0" } }, "rimraf": { @@ -10631,15 +25614,6 @@ "glob": "^7.1.3" } }, - "sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "requires": { - "mri": "^1.1.0" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -10647,20 +25621,16 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "peer": true, "requires": { "shebang-regex": "^3.0.0" } @@ -10669,8 +25639,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "peer": true + "dev": true }, "side-channel": { "version": "1.0.4", @@ -10684,12 +25653,24 @@ "object-inspect": "^1.9.0" } }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, "sliced": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=", "dev": true }, + "space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10700,14 +25681,56 @@ } }, "string-width": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz", - "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", "dev": true, "requires": { "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", + "emoji-regex": "^10.2.1", "strip-ansi": "^7.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz", + "integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==", + "dev": true + } + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, "string.prototype.matchall": { @@ -10749,6 +25772,16 @@ "define-properties": "^1.1.3" } }, + "stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "dev": true, + "requires": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + } + }, "strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", @@ -10758,6 +25791,23 @@ "ansi-regex": "^6.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -10772,11 +25822,23 @@ "dev": true, "peer": true }, + "super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "dev": true, + "requires": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "peer": true, "requires": { "has-flag": "^4.0.0" } @@ -10800,11 +25862,14 @@ "integrity": "sha1-cXNhKGlirI3za3omGft3OhW5t/c=", "dev": true }, - "to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true + "time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "dev": true, + "requires": { + "convert-hrtime": "^5.0.0" + } }, "to-regex-range": { "version": "5.0.1", @@ -10815,22 +25880,18 @@ "is-number": "^7.0.0" } }, - "to-vfile": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.3.tgz", - "integrity": "sha512-QO0A9aE6Z/YkmQadJ0syxpmNXtcQiu0qAtCKYKD5cS3EfgfFTAXfgLX6AOaBrSfWSek5nfsMf3gBZ9KGVFcLuw==", - "dev": true, - "requires": { - "is-buffer": "^2.0.0", - "vfile": "^5.1.0" - } - }, "too-wordy": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/too-wordy/-/too-wordy-0.3.4.tgz", "integrity": "sha512-EU+UA4zHc06TkVQaravNNVdqX763/ENTIOKiKlqSJ6WKCPwLxHjvY3d0uEJYaq92iojyHPwD2iaYbZKjdw3icA==", "dev": true }, + "trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "dev": true + }, "trough": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", @@ -10851,9 +25912,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "peer": true, "requires": { @@ -10872,12 +25933,6 @@ "prelude-ls": "^1.2.1" } }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -10897,138 +25952,233 @@ "which-boxed-primitive": "^1.0.2" } }, - "unified": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.1.tgz", - "integrity": "sha512-v4ky1+6BN9X3pQrOdkFIPWAaeDsHPE1svRDxq7YpTc2plkIqFMwukfqM+l0ewpP9EfwARlt9pPFAeWYhHm8X9w==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - } + "undici": { + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", + "dev": true }, "unified-args": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/unified-args/-/unified-args-9.0.2.tgz", - "integrity": "sha512-qSqryjoqfJSII4E4Z2Jx7MhXX2MuUIn6DsrlmL8UnWFdGtrWvEtvm7Rx5fKT5TPUz7q/Fb4oxwIHLCttvAuRLQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/unified-args/-/unified-args-11.0.0.tgz", + "integrity": "sha512-4q3OQ2EbNIaxVX1pMoB/QdFxw9BSOWBGUwn5LK3UJict+6i0ud18A1DZ177+2r5hC2nYFOw1jbCp27ydl44Zhg==", "dev": true, "requires": { "@types/text-table": "^0.2.0", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", + "chalk": "^5.0.0", "chokidar": "^3.0.0", - "fault": "^2.0.0", + "comma-separated-tokens": "^2.0.0", "json5": "^2.0.0", "minimist": "^1.0.0", + "strip-ansi": "^7.0.0", "text-table": "^0.2.0", - "unified-engine": "^9.0.0" + "unified-engine": "^11.0.0" + }, + "dependencies": { + "chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true + } } }, "unified-engine": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-9.0.5.tgz", - "integrity": "sha512-frQ6lUNlkTwVC0JELJqSSITpE7MLrLJqAWmDrUFj5Do6A4/3n6eX5Jyg8fhe4Dbwwh38spqUJd39FtRFG34QWg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-11.1.0.tgz", + "integrity": "sha512-RS3K5PgNjDRQN9eNIefLUDxpfyWIItmKcjBhD1VnYYT/h7xpheZoZBtb5gtwFyKWZlhKCGRVQknIm1M8qHZfIg==", "dev": true, "requires": { - "@types/concat-stream": "^1.0.0", + "@types/concat-stream": "^2.0.0", "@types/debug": "^4.0.0", "@types/is-empty": "^1.0.0", - "@types/js-yaml": "^4.0.0", - "@types/node": "^17.0.0", - "@types/unist": "^2.0.0", + "@types/node": "^20.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", "concat-stream": "^2.0.0", "debug": "^4.0.0", - "fault": "^2.0.0", - "glob": "^7.0.0", - "ignore": "^5.0.0", - "is-buffer": "^2.0.0", - "is-empty": "^1.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "load-plugin": "^4.0.0", - "parse-json": "^6.0.0", - "to-vfile": "^7.0.0", - "trough": "^2.0.0", - "unist-util-inspect": "^7.0.0", - "vfile-message": "^3.0.0", - "vfile-reporter": "^7.0.0", - "vfile-statistics": "^2.0.0" - } - }, - "unified-lint-rule": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.1.1.tgz", - "integrity": "sha512-vsLHyLZFstqtGse2gvrGwasOmH8M2y+r2kQMoDSWzSqUkQx2MjHjvZuGSv5FUaiv4RQO1bHRajy7lSGp7XWq5A==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", + "glob": "^10.0.0", + "ignore": "^5.0.0", + "is-empty": "^1.0.0", + "is-plain-obj": "^4.0.0", + "load-plugin": "^5.0.0", + "parse-json": "^7.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" + "unist-util-inspect": "^8.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0", + "vfile-reporter": "^8.0.0", + "vfile-statistics": "^3.0.0", + "yaml": "^2.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + } + }, + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, "unified-message-control": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", - "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-5.0.0.tgz", + "integrity": "sha512-B2cSAkpuMVVmPP90KCfKdBhm1e9KYJ+zK3x5BCa0N65zpq1Ybkc9C77+M5qwR8FWO7RF3LM5QRRPZtgjW6DUCw==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit": "^3.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0", - "vfile-message": "^3.0.0" + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "vfile-message": "^4.0.0" }, "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, "unist-util-visit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", - "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" } }, - "unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" } } } }, - "unist-util-generated": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.0.tgz", - "integrity": "sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw==", - "dev": true - }, "unist-util-inspect": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-7.0.0.tgz", - "integrity": "sha512-2Utgv78I7PUu461Y9cdo+IUiiKSKpDV5CE/XD6vTj849a3xlpDAScvSJ6cQmtFBGgAmCn2wR7jLuXhpg1XLlJw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-8.0.0.tgz", + "integrity": "sha512-/3Wn/wU6/H6UEo4FoYUeo8KUePN8ERiZpQYFWYoihOsr1DoDuv80PeB0hobVZyYSvALa2e556bG1A1/AbwU4yg==", "dev": true, "requires": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + } } }, "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "dev": true + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + } + } }, "unist-util-map": { "version": "1.0.5", @@ -11039,19 +26189,51 @@ "object-assign": "^4.0.1" } }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", - "dev": true + "unist-util-modify-children": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz", + "integrity": "sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "array-iterate": "^2.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + } + } }, - "unist-util-stringify-position": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", - "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "unist-util-remove-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", + "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", "dev": true, "requires": { - "@types/unist": "^2.0.0" + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + } + } } }, "unist-util-to-list-of-char": { @@ -11096,25 +26278,39 @@ } } }, - "unist-util-visit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.0.tgz", - "integrity": "sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ==", + "unist-util-visit-children": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz", + "integrity": "sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "@types/unist": "^3.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + } } }, "unist-util-visit-parents": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz", - "integrity": "sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + } } }, "uri-js": { @@ -11127,33 +26323,12 @@ "punycode": "^2.1.0" } }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uvu": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.3.tgz", - "integrity": "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==", - "dev": true, - "requires": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - } - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -11161,90 +26336,233 @@ "dev": true, "peer": true }, - "vfile": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.0.tgz", - "integrity": "sha512-Tj44nY/48OQvarrE4FAjUfrv7GZOYzPbl5OD65HxVKwLJKMPU7zmfV8cCgCnzKWnSfYG2f3pxu+ALqs7j22xQQ==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - } - }, "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" - } - }, - "vfile-message": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.0.tgz", - "integrity": "sha512-4QJbBk+DkPEhBXq3f260xSaWtjE4gPKOfulzfMFF8ZNwaPZieWsg3iVlcmF04+eebzpcpeXOOFMfrYzJHVYg+g==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", "dev": true, "requires": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, "vfile-reporter": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-7.0.3.tgz", - "integrity": "sha512-q+ruTWxFHbow359TDqoNJn5THdwRDeV+XUOtzdT/OESgaGw05CjL68ImlbzRzqS5xL62Y1IaIWb8x+RbaNjayA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-8.1.0.tgz", + "integrity": "sha512-NfHyHdkCcy0BsXiLA3nId29TY7W7hgpc8nd8Soe3imATx5N4/+mkLYdMR+Y6Zvu6BXMMi0FZsD4FLCm1dN85Pg==", "dev": true, "requires": { "@types/supports-color": "^8.0.0", - "string-width": "^5.0.0", + "string-width": "^6.0.0", "supports-color": "^9.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-sort": "^3.0.0", - "vfile-statistics": "^2.0.0" + "unist-util-stringify-position": "^4.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0", + "vfile-sort": "^4.0.0", + "vfile-statistics": "^3.0.0" }, "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, "supports-color": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.1.tgz", - "integrity": "sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } } } }, "vfile-sort": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-3.0.0.tgz", - "integrity": "sha512-fJNctnuMi3l4ikTVcKpxTbzHeCgvDhnI44amA3NVDvA6rTC6oKCFpCVyT5n2fFMr3ebfr+WVQZedOCd73rzSxg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-4.0.0.tgz", + "integrity": "sha512-lffPI1JrbHDTToJwcq0rl6rBmkjQmMuXkAxsZPRS9DXbaJQvc642eCg6EGxcX2i1L+esbuhq+2l9tBll5v8AeQ==", "dev": true, "requires": { - "vfile-message": "^3.0.0" + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, "vfile-statistics": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-2.0.0.tgz", - "integrity": "sha512-foOWtcnJhKN9M2+20AOTlWi2dxNfAoeNIoxD5GXcO182UJyId4QrXa41fWrgcfV3FWTjdEDy3I4cpLVcQscIMA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-3.0.0.tgz", + "integrity": "sha512-/qlwqwWBWFOmpXujL/20P+Iuydil0rZZNglR+VNm6J0gpLHwuVM5s7g2TfVoswbXjZ4HuIhLMySEyIw5i7/D8w==", "dev": true, "requires": { - "vfile-message": "^3.0.0" + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "dependencies": { + "@types/unist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", + "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0" + } + }, + "vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + } + }, + "vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dev": true, + "requires": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + } + } } }, + "walk-up-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", + "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", + "dev": true + }, "weasel-words": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/weasel-words/-/weasel-words-0.1.1.tgz", "integrity": "sha1-cTeUZYXHP+RIggE4U70ADF1oek4=", "dev": true }, + "web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "dev": true + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "peer": true, "requires": { "isexe": "^2.0.0" } @@ -11264,12 +26582,87 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "peer": true }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "wrapped": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", @@ -11301,10 +26694,16 @@ "weasel-words": "^0.1.1" } }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "yaml": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", + "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", + "dev": true + }, + "yocto-queue": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true }, "zwitch": { diff --git a/package.json b/package.json index e441d81ab4..26905302dc 100644 --- a/package.json +++ b/package.json @@ -28,73 +28,74 @@ }, "homepage": "https://gitversion.net/", "devDependencies": { - "remark": "^14.0.2", - "remark-cli": "^10.0.1", - "remark-frontmatter": "^4.0.1", - "remark-heading-gap": "^5.0.1", - "remark-lint": "^9.1.1", - "remark-lint-blockquote-indentation": "^3.1.1", - "remark-lint-checkbox-character-style": "^4.1.1", - "remark-lint-checkbox-content-indent": "^4.1.1", + "remark": "^15.0.1", + "remark-cli": "^12.0.1", + "remark-frontmatter": "^5.0.0", + "remark-heading-gap": "^6.0.0", + "remark-lint": "^10.0.1", + "remark-lint-blockquote-indentation": "^4.0.1", + "remark-lint-checkbox-character-style": "^5.0.1", + "remark-lint-checkbox-content-indent": "^5.0.1", "remark-lint-code": "^2.0.0", - "remark-lint-code-block-style": "^3.1.0", - "remark-lint-definition-case": "^3.1.1", - "remark-lint-definition-spacing": "^3.1.1", - "remark-lint-fenced-code-flag": "^3.1.1", - "remark-lint-fenced-code-marker": "^3.1.1", - "remark-lint-file-extension": "^2.1.1", - "remark-lint-final-definition": "^3.1.1", - "remark-lint-final-newline": "^2.1.1", - "remark-lint-hard-break-spaces": "^3.1.1", - "remark-lint-heading-increment": "^3.1.1", - "remark-lint-heading-style": "^3.1.1", + "remark-lint-code-block-style": "^4.0.1", + "remark-lint-definition-case": "^4.0.1", + "remark-lint-definition-spacing": "^4.0.1", + "remark-lint-fenced-code-flag": "^4.2.0", + "remark-lint-fenced-code-marker": "^4.0.1", + "remark-lint-file-extension": "^3.0.1", + "remark-lint-final-definition": "^4.0.2", + "remark-lint-final-newline": "^3.0.1", + "remark-lint-hard-break-spaces": "^4.1.1", + "remark-lint-heading-increment": "^4.0.1", + "remark-lint-heading-style": "^4.0.1", "remark-lint-heading-whitespace": "^1.0.0", - "remark-lint-link-title-style": "^3.1.1", - "remark-lint-list-item-bullet-indent": "^4.1.1", - "remark-lint-list-item-content-indent": "^3.1.1", - "remark-lint-list-item-indent": "^3.1.1", - "remark-lint-maximum-heading-length": "^3.1.1", - "remark-lint-no-auto-link-without-protocol": "^3.1.1", - "remark-lint-no-blockquote-without-marker": "^5.1.1", - "remark-lint-no-consecutive-blank-lines": "^4.1.2", - "remark-lint-no-dead-urls": "^1.1.0", - "remark-lint-no-duplicate-definitions": "^3.1.1", - "remark-lint-no-duplicate-headings": "^3.1.1", - "remark-lint-no-emphasis-as-heading": "^3.1.1", + "remark-lint-link-title-style": "^4.0.1", + "remark-lint-list-item-bullet-indent": "^5.0.1", + "remark-lint-list-item-content-indent": "^4.0.1", + "remark-lint-list-item-indent": "^4.0.1", + "remark-lint-maximum-heading-length": "^4.1.1", + "remark-lint-no-blockquote-without-marker": "^6.0.1", + "remark-lint-no-consecutive-blank-lines": "^5.0.1", + "remark-lint-no-dead-urls": "^2.0.1", + "remark-lint-no-duplicate-definitions": "^4.0.1", + "remark-lint-no-duplicate-headings": "^4.0.1", + "remark-lint-no-emphasis-as-heading": "^4.0.1", "remark-lint-no-empty-sections": "^4.0.0", - "remark-lint-no-empty-url": "^3.1.1", - "remark-lint-no-file-name-articles": "^2.1.1", - "remark-lint-no-file-name-consecutive-dashes": "^2.1.1", - "remark-lint-no-file-name-irregular-characters": "^2.1.1", - "remark-lint-no-file-name-mixed-case": "^2.1.1", - "remark-lint-no-file-name-outer-dashes": "^2.1.1", - "remark-lint-no-heading-content-indent": "^4.1.1", - "remark-lint-no-heading-indent": "^4.1.1", - "remark-lint-no-heading-like-paragraph": "^3.1.1", - "remark-lint-no-inline-padding": "^4.1.1", - "remark-lint-no-literal-urls": "^3.1.1", - "remark-lint-no-multiple-toplevel-headings": "^3.1.1", - "remark-lint-no-reference-like-url": "^3.1.1", + "remark-lint-no-empty-url": "^4.0.1", + "remark-lint-no-file-name-articles": "^3.0.1", + "remark-lint-no-file-name-consecutive-dashes": "^3.0.1", + "remark-lint-no-file-name-irregular-characters": "^3.0.1", + "remark-lint-no-file-name-mixed-case": "^3.0.1", + "remark-lint-no-file-name-outer-dashes": "^3.0.1", + "remark-lint-no-heading-content-indent": "^5.0.1", + "remark-lint-no-heading-indent": "^5.0.1", + "remark-lint-no-heading-like-paragraph": "^4.0.1", + "remark-lint-no-literal-urls": "^4.0.1", + "remark-lint-no-multiple-toplevel-headings": "^4.0.1", + "remark-lint-no-reference-like-url": "^4.0.1", "remark-lint-no-repeat-punctuation": "^0.1.4", - "remark-lint-no-shell-dollars": "^3.1.1", - "remark-lint-no-shortcut-reference-image": "^3.1.1", - "remark-lint-no-table-indentation": "^4.1.1", - "remark-lint-no-tabs": "^3.1.1", - "remark-lint-no-unused-definitions": "^3.1.1", - "remark-lint-ordered-list-marker-style": "^3.1.1", - "remark-lint-ordered-list-marker-value": "^3.1.1", - "remark-lint-rule-style": "^3.1.1", - "remark-lint-strong-marker": "^3.1.1", - "remark-lint-table-cell-padding": "^4.1.2", - "remark-lint-table-pipe-alignment": "^3.1.1", - "remark-lint-table-pipes": "^4.1.1", - "remark-lint-unordered-list-marker-style": "^3.1.1", + "remark-lint-no-shell-dollars": "^4.0.1", + "remark-lint-no-shortcut-reference-image": "^4.0.1", + "remark-lint-no-table-indentation": "^5.0.1", + "remark-lint-no-tabs": "^4.0.1", + "remark-lint-no-unused-definitions": "^4.0.2", + "remark-lint-ordered-list-marker-style": "^4.0.1", + "remark-lint-ordered-list-marker-value": "^4.0.1", + "remark-lint-rule-style": "^4.0.1", + "remark-lint-strong-marker": "^4.0.1", + "remark-lint-table-cell-padding": "^5.1.1", + "remark-lint-table-pipe-alignment": "^4.1.1", + "remark-lint-table-pipes": "^5.0.1", + "remark-lint-unordered-list-marker-style": "^4.0.1", "remark-lint-write-good": "^1.2.0", - "remark-preset-lint-consistent": "^5.1.1", - "remark-preset-lint-markdown-style-guide": "^5.1.2", - "remark-preset-lint-recommended": "^6.1.2", - "remark-retext": "^5.0.1", - "remark-textr": "^5.0.1", - "remark-validate-links": "^11.0.2" + "remark-preset-lint-consistent": "^6.0.1", + "remark-preset-lint-markdown-style-guide": "^6.0.1", + "remark-preset-lint-recommended": "^7.0.1", + "remark-retext": "^6.0.1", + "remark-textr": "^6.1.0", + "remark-validate-links": "^13.1.0" + }, + "overrides": { + "got": "^11.8.5" } } diff --git a/qodana.sarif.json b/qodana.sarif.json new file mode 100644 index 0000000000..1f50cbde5f --- /dev/null +++ b/qodana.sarif.json @@ -0,0 +1,160237 @@ +{ + "$schema": "https://raw.githubusercontent.com/schemastore/schemastore/master/src/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "QDNET", + "fullName": "Qodana for .NET", + "version": "243.24609", + "rules": [], + "taxa": [ + { + "id": "C#", + "name": "C#" + }, + { + "id": "C#/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++", + "name": "C/C++" + }, + { + "id": "C_C++/Clang Diagnostics", + "name": "Clang Diagnostics", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XAML", + "name": "XAML" + }, + { + "id": "XAML/Code Notification", + "name": "Code Notification", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Unreal Engine", + "name": "Unreal Engine", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Language Usage Opportunities", + "name": "Language Usage Opportunities", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Clang-Tidy Checks", + "name": "Clang-Tidy Checks", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Sass_SCSS", + "name": "Sass/SCSS" + }, + { + "id": "HTML", + "name": "HTML" + }, + { + "id": "C#/Common Practices and Code Improvements", + "name": "Common Practices and Code Improvements", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostCSS", + "name": "PostCSS" + }, + { + "id": "JavaScript and TypeScript", + "name": "JavaScript and TypeScript" + }, + { + "id": "JavaScript and TypeScript/Bitwise operation issues", + "name": "Bitwise operation issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Common Practices and Code Improvements", + "name": "Common Practices and Code Improvements", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/General", + "name": "General", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Unity", + "name": "Unity", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HTTP Client", + "name": "HTTP Client" + }, + { + "id": "EditorConfig", + "name": "EditorConfig" + }, + { + "id": "C#/Syntax Style", + "name": "Syntax Style", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Validity issues", + "name": "Validity issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Formatting", + "name": "Formatting", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SQL", + "name": "SQL" + }, + { + "id": "C#/NUnit", + "name": "NUnit", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Compiler Warnings", + "name": "Compiler Warnings", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Formatting", + "name": "Formatting", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSS", + "name": "CSS" + }, + { + "id": "CSS/Invalid elements", + "name": "Invalid elements", + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "name": "Potentially undesirable code constructs", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Clang Static Analyzer Checks", + "name": "Clang Static Analyzer Checks", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kubernetes", + "name": "Kubernetes" + }, + { + "id": "C_C++/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Roslyn Analyzers", + "name": "Roslyn Analyzers", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Redundancies in Symbol Declarations", + "name": "Redundancies in Symbol Declarations", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Entity Framework", + "name": "Entity Framework", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Properties files", + "name": "Properties files" + }, + { + "id": "VB.NET", + "name": "VB.NET" + }, + { + "id": "VB.NET/Common Practices and Code Improvements", + "name": "Common Practices and Code Improvements", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Blazor", + "name": "Blazor" + }, + { + "id": "Blazor/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "Blazor", + "index": 41, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XSLT", + "name": "XSLT" + }, + { + "id": "Dockerfile", + "name": "Dockerfile" + }, + { + "id": "XAML/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "General", + "name": "General" + }, + { + "id": "ASP.NET route templates", + "name": "ASP.NET route templates" + }, + { + "id": "ASP.NET route templates/Code Notification", + "name": "Code Notification", + "relationships": [ + { + "target": { + "id": "ASP.NET route templates", + "index": 47, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "name": "ES2015 migration aids", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Godot", + "name": "Godot", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/DOM issues", + "name": "DOM issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Code Coverage", + "name": "Code Coverage" + }, + { + "id": "HTML/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/TypeScript", + "name": "TypeScript", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XML", + "name": "XML" + }, + { + "id": "C#/Unity Burst Compiler Warnings", + "name": "Unity Burst Compiler Warnings", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExp", + "name": "RegExp" + }, + { + "id": "Angular", + "name": "Angular" + }, + { + "id": "XAML/Compiler Warnings", + "name": "Compiler Warnings", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "name": "Potentially confusing code constructs", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VB.NET/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Aspx", + "name": "Aspx" + }, + { + "id": "Aspx/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "Aspx", + "index": 63, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Control flow issues", + "name": "Control flow issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OpenAPI specifications", + "name": "OpenAPI specifications" + }, + { + "id": "ResX", + "name": "ResX" + }, + { + "id": "ResX/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "ResX", + "index": 67, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Code quality tools", + "name": "Code quality tools", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GitHub actions", + "name": "GitHub actions" + }, + { + "id": "Pug_Jade", + "name": "Pug/Jade" + }, + { + "id": "F#", + "name": "F#" + }, + { + "id": "F#/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "F#", + "index": 72, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HTML/Common Practices and Code Improvements", + "name": "Common Practices and Code Improvements", + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Compiler Warnings", + "name": "Compiler Warnings", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Function metrics", + "name": "Function metrics", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XAML/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSONPath", + "name": "JSONPath" + }, + { + "id": "JavaScript and TypeScript/Code style issues", + "name": "Code style issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Constraints Violations", + "name": "Constraints Violations", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Web.Config", + "name": "Web.Config" + }, + { + "id": "Web.Config/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "Web.Config", + "index": 81, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HTML/Accessibility", + "name": "Accessibility", + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSON and JSON5", + "name": "JSON and JSON5" + }, + { + "id": "XPath", + "name": "XPath" + }, + { + "id": "JavaScript and TypeScript/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Security", + "name": "Security", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Vue", + "name": "Vue" + }, + { + "id": "MongoJS", + "name": "MongoJS" + }, + { + "id": "Markdown", + "name": "Markdown" + }, + { + "id": "C_C++/Syntax Style", + "name": "Syntax Style", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Razor", + "name": "Razor" + }, + { + "id": "Razor/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "Razor", + "index": 92, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Web.Config/Code Notification", + "name": "Code Notification", + "relationships": [ + { + "target": { + "id": "Web.Config", + "index": 81, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAML", + "name": "YAML" + }, + { + "id": "VB.NET/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Try statement issues", + "name": "Try statement issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Web.Config/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "Web.Config", + "index": 81, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ResX/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "ResX", + "index": 67, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpHandler or WebService", + "name": "HttpHandler or WebService" + }, + { + "id": "HttpHandler or WebService/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "HttpHandler or WebService", + "index": 100, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SQL server", + "name": "SQL server" + }, + { + "id": "JavaScript and TypeScript/Async code and promises", + "name": "Async code and promises", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Naming conventions", + "name": "Naming conventions", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Dependency analysis", + "name": "Dependency analysis" + }, + { + "id": "Inappropriate gRPC request scheme", + "name": "Inappropriate gRPC request scheme" + }, + { + "id": "Razor/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "Razor", + "index": 92, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Assignment issues", + "name": "Assignment issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Switch statement issues", + "name": "Switch statement issues", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VB.NET/Compiler Warnings", + "name": "Compiler Warnings", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Shell script", + "name": "Shell script" + }, + { + "id": "JavaScript and TypeScript/Data flow", + "name": "Data flow", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/UnrealHeaderTool", + "name": "UnrealHeaderTool", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSS/Code style issues", + "name": "Code style issues", + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "T4", + "name": "T4" + }, + { + "id": "T4/T4", + "name": "T4", + "relationships": [ + { + "target": { + "id": "T4", + "index": 115, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Unused symbols", + "name": "Unused symbols", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Flow type checker", + "name": "Flow type checker", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Aspx/Redundancies in Code", + "name": "Redundancies in Code", + "relationships": [ + { + "target": { + "id": "Aspx", + "index": 63, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Imports and dependencies", + "name": "Imports and dependencies", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Less", + "name": "Less" + }, + { + "id": "Proofreading", + "name": "Proofreading" + }, + { + "id": "Oracle", + "name": "Oracle" + }, + { + "id": "Internationalization", + "name": "Internationalization" + }, + { + "id": "T4/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "T4", + "index": 115, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unreal Engine", + "name": "Unreal Engine" + }, + { + "id": "C_C++/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Unity Performance Inspections", + "name": "Unity Performance Inspections", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSS/Code quality tools", + "name": "Code quality tools", + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XAML/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Security", + "name": "Security" + }, + { + "id": "Aspx/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "Aspx", + "index": 63, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Assembler", + "name": "Assembler" + }, + { + "id": "Assembler/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "Assembler", + "index": 133, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Docker-compose", + "name": "Docker-compose" + }, + { + "id": "RELAX NG", + "name": "RELAX NG" + }, + { + "id": "Web.Config/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "Web.Config", + "index": 81, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/Constraints Violations", + "name": "Constraints Violations", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VB.NET/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Unit testing", + "name": "Unit testing", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Unreal Build System", + "name": "Unreal Build System", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MySQL", + "name": "MySQL" + }, + { + "id": "Angular 2 HTML", + "name": "Angular 2 HTML" + }, + { + "id": "Angular 2 HTML/Potential Code Quality Issues", + "name": "Potential Code Quality Issues", + "relationships": [ + { + "target": { + "id": "Angular 2 HTML", + "index": 143, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C_C++/.NET Core", + "name": ".NET Core", + "relationships": [ + { + "target": { + "id": "C_C++", + "index": 2, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSS/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Ini files", + "name": "Ini files" + }, + { + "id": "Version control", + "name": "Version control" + }, + { + "id": "ShaderLab", + "name": "ShaderLab" + }, + { + "id": "ShaderLab/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "ShaderLab", + "index": 149, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Aspx/Common Practices and Code Improvements", + "name": "Common Practices and Code Improvements", + "relationships": [ + { + "target": { + "id": "Aspx", + "index": 63, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostgreSQL", + "name": "PostgreSQL" + }, + { + "id": "Dev Container", + "name": "Dev Container" + }, + { + "id": "File Watchers", + "name": "File Watchers" + }, + { + "id": "Rider", + "name": "Rider" + }, + { + "id": "Rider/General", + "name": "General", + "relationships": [ + { + "target": { + "id": "Rider", + "index": 155, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XAML/Constraints Violations", + "name": "Constraints Violations", + "relationships": [ + { + "target": { + "id": "XAML", + "index": 4, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/React", + "name": "React", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HTML/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Code Notification", + "name": "Code Notification", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpBase", + "name": "RegExpBase" + }, + { + "id": "RegExpBase/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "RegExpBase", + "index": 161, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAML/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Protocol Buffers", + "name": "Protocol Buffers" + }, + { + "id": "MSBuild", + "name": "MSBuild" + }, + { + "id": "VB.NET/Code Notification", + "name": "Code Notification", + "relationships": [ + { + "target": { + "id": "VB.NET", + "index": 39, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpHandler or WebService/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "HttpHandler or WebService", + "index": 100, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XML/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpBase/Language Usage Opportunities", + "name": "Language Usage Opportunities", + "relationships": [ + { + "target": { + "id": "RegExpBase", + "index": 161, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Handlebars_Mustache", + "name": "Handlebars/Mustache" + }, + { + "id": "F#/Non configurable", + "name": "Non configurable", + "relationships": [ + { + "target": { + "id": "F#", + "index": 72, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaScript and TypeScript/Node.js", + "name": "Node.js", + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript", + "index": 14, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "C#/Xunit", + "name": "Xunit", + "relationships": [ + { + "target": { + "id": "C#", + "index": 0, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Qodana", + "name": "Qodana" + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + "extensions": [ + { + "name": "rider.intellij.plugin.appender", + "version": "243.24609", + "rules": [ + { + "id": "SwitchStatementHandlesSomeKnownEnumValuesWithDefault", + "shortDescription": { + "text": "Some values of the enum are not processed inside 'switch' statement and are handled via default section" + }, + "fullDescription": { + "text": "Some values of the enum are not processed inside 'switch' statement and fall into default section. This might indicate unintentional handling of all enum values added after the switch was introduced, consider handling missing enum values explicitly Learn more...", + "markdown": "Some values of the enum are not processed inside 'switch' statement and fall into default section. This might indicate unintentional handling of all enum values added after the switch was introduced, consider handling missing enum values explicitly [Learn more...](https://www.jetbrains.com/help/rider/SwitchStatementHandlesSomeKnownEnumValuesWithDefault.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "SwitchStatementHandlesSomeKnownEnumValuesWithDefault", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp98Cpp11Cpp14CompatPedantic", + "shortDescription": { + "text": "c++98-c++11-c++14-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++98-c++11-c++14-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wc++98-c++11-c++14-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-98-c-11-c-14-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp98Cpp11Cpp14CompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.InvalidDynamicResourceType", + "shortDescription": { + "text": "XAML dynamic resource of invalid type" + }, + "fullDescription": { + "text": "XAML dynamic resource of invalid type", + "markdown": "XAML dynamic resource of invalid type" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Xaml.InvalidDynamicResourceType", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Code Notification", + "index": 5, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUEBlueprintImplementableEventNotImplemented", + "shortDescription": { + "text": "BlueprintImplementableEvent function is not implemented in any blueprint" + }, + "fullDescription": { + "text": "BlueprintImplementableEvent function is not implemented in any blueprint", + "markdown": "BlueprintImplementableEvent function is not implemented in any blueprint" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUEBlueprintImplementableEventNotImplemented", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToCompoundAssignment", + "shortDescription": { + "text": "Use compound assignment" + }, + "fullDescription": { + "text": "Replace assignment with compound assignment", + "markdown": "Replace assignment with compound assignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToCompoundAssignment", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseConfigureAwaitFalseForAsyncDisposable", + "shortDescription": { + "text": "Missing '.ConfigureAwait(false)' for async disposable in library code" + }, + "fullDescription": { + "text": "It is recommended to use 'ConfigureAwait(false)' in your library code to prevent context capture in task continuations. This inspection is controlled by the 'ConfigureAwait analysis mode' project level property, which is set to 'Disabled' by default. Set 'ConfigureAwait analysis mode' project level property to 'Library' to analyze 'await using' statements for missing 'ConfigureAwait(false)' calls.", + "markdown": "It is recommended to use 'ConfigureAwait(false)' in your library code to prevent context capture in task continuations. This inspection is controlled by the 'ConfigureAwait analysis mode' project level property, which is set to 'Disabled' by default. Set 'ConfigureAwait analysis mode' project level property to 'Library' to analyze 'await using' statements for missing 'ConfigureAwait(false)' calls." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseConfigureAwaitFalseForAsyncDisposable", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesProTypeReinterpretCast", + "shortDescription": { + "text": "cppcoreguidelines-pro-type-reinterpret-cast clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-pro-type-reinterpret-cast clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-pro-type-reinterpret-cast clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-reinterpret-cast.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesProTypeReinterpretCast", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticEnumConversion", + "shortDescription": { + "text": "enum-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wenum-conversion clang diagnostic · Learn more", + "markdown": "-Wenum-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wenum-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticEnumConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCompareDistinctPointerTypes", + "shortDescription": { + "text": "compare-distinct-pointer-types clang diagnostic" + }, + "fullDescription": { + "text": "-Wcompare-distinct-pointer-types clang diagnostic · Learn more", + "markdown": "-Wcompare-distinct-pointer-types clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wcompare-distinct-pointer-types)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCompareDistinctPointerTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppAssignedValueIsNeverUsed", + "shortDescription": { + "text": "Assigned value is never used" + }, + "fullDescription": { + "text": "Assigned value is never used", + "markdown": "Assigned value is never used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppAssignedValueIsNeverUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppCVQualifierCanNotBeAppliedToReference", + "shortDescription": { + "text": "Adding cv-qualifiers to references has no effect" + }, + "fullDescription": { + "text": "Adding cv-qualifiers to references has no effect", + "markdown": "Adding cv-qualifiers to references has no effect" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppCVQualifierCanNotBeAppliedToReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBoundToDelegateMethodIsNotMarkedAsUFunction", + "shortDescription": { + "text": "Method bound to delegate is not marked with UFUNCTION macro" + }, + "fullDescription": { + "text": "Method bound to delegate must be marked with UFUNCTION macro", + "markdown": "Method bound to delegate must be marked with UFUNCTION macro" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppBoundToDelegateMethodIsNotMarkedAsUFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneEmptyCatch", + "shortDescription": { + "text": "bugprone-empty-catch clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-empty-catch clang-tidy check · Learn more", + "markdown": "bugprone-empty-catch clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/empty-catch.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneEmptyCatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPreOpenmp51Compat", + "shortDescription": { + "text": "pre-openmp-51-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wpre-openmp-51-compat clang diagnostic · Learn more", + "markdown": "-Wpre-openmp-51-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpre-openmp-51-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPreOpenmp51Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompatiblePointerTypes", + "shortDescription": { + "text": "incompatible-pointer-types clang diagnostic" + }, + "fullDescription": { + "text": "-Wincompatible-pointer-types clang diagnostic · Learn more", + "markdown": "-Wincompatible-pointer-types clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-pointer-types)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompatiblePointerTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticInitializerOverrides", + "shortDescription": { + "text": "initializer-overrides clang diagnostic" + }, + "fullDescription": { + "text": "-Winitializer-overrides clang diagnostic · Learn more", + "markdown": "-Winitializer-overrides clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winitializer-overrides)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticInitializerOverrides", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStdlibcxxNotFound", + "shortDescription": { + "text": "stdlibcxx-not-found clang diagnostic" + }, + "fullDescription": { + "text": "-Wstdlibcxx-not-found clang diagnostic · Learn more", + "markdown": "-Wstdlibcxx-not-found clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstdlibcxx-not-found)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStdlibcxxNotFound", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTautologicalUnsignedEnumZeroCompare", + "shortDescription": { + "text": "tautological-unsigned-enum-zero-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wtautological-unsigned-enum-zero-compare clang diagnostic · Learn more", + "markdown": "-Wtautological-unsigned-enum-zero-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtautological-unsigned-enum-zero-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTautologicalUnsignedEnumZeroCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClassNeedsConstructorBecauseOfUninitializedMember", + "shortDescription": { + "text": "Class should have a user-defined constructor because of an uninitialized data member" + }, + "fullDescription": { + "text": "Class should have a user-defined constructor because of an uninitialized data member", + "markdown": "Class should have a user-defined constructor because of an uninitialized data member" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClassNeedsConstructorBecauseOfUninitializedMember", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTargetClonesMixedSpecifiers", + "shortDescription": { + "text": "target-clones-mixed-specifiers clang diagnostic" + }, + "fullDescription": { + "text": "-Wtarget-clones-mixed-specifiers clang diagnostic · Learn more", + "markdown": "-Wtarget-clones-mixed-specifiers clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtarget-clones-mixed-specifiers)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTargetClonesMixedSpecifiers", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftExists", + "shortDescription": { + "text": "microsoft-exists clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-exists clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-exists clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-exists)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftExists", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAndroidCloexecAccept", + "shortDescription": { + "text": "android-cloexec-accept clang-tidy check" + }, + "fullDescription": { + "text": "android-cloexec-accept clang-tidy check · Learn more", + "markdown": "android-cloexec-accept clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/android/cloexec-accept.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAndroidCloexecAccept", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CoVariantArrayConversion", + "shortDescription": { + "text": "Co-variant array conversion" + }, + "fullDescription": { + "text": "Co-variant conversion of array could cause run-time exceptions Learn more...", + "markdown": "Co-variant conversion of array could cause run-time exceptions [Learn more...](https://www.jetbrains.com/help/rider/CoVariantArrayConversion.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CoVariantArrayConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MemberCanBeMadeStatic.Global", + "shortDescription": { + "text": "Member can be made static (shared) (non-private accessibility)" + }, + "fullDescription": { + "text": "A non-virtual instance member does not use 'this' object (neither implicitly nor explicitly) and can be made static (shared) Learn more...", + "markdown": "A non-virtual instance member does not use 'this' object (neither implicitly nor explicitly) and can be made static (shared) [Learn more...](https://www.jetbrains.com/help/rider/MemberCanBeMadeStatic.Global.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MemberCanBeMadeStatic.Global", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUseElementsView", + "shortDescription": { + "text": "std::views::keys/values can be used" + }, + "fullDescription": { + "text": "For example, when iterating on key-value pairs, std::views::keys allows ignoring the values.", + "markdown": "For example, when iterating on key-value pairs, std::views::keys allows ignoring the values." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppUseElementsView", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.Entities.SingletonMustBeRequested", + "shortDescription": { + "text": "To use the result of a 'GetSingleton' call in the function, 'OnCreate' must include a 'RequireForUpdate' call" + }, + "fullDescription": { + "text": "To use the result of a 'GetSingleton<{0}>' call in the function, 'OnCreate' must include a 'RequireForUpdate' call", + "markdown": "To use the result of a 'GetSingleton\\<{0}\\>' call in the function, 'OnCreate' must include a 'RequireForUpdate' call" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.Entities.SingletonMustBeRequested", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionNeverUpdated.Global", + "shortDescription": { + "text": "Collection is never updated (non-private accessibility)" + }, + "fullDescription": { + "text": "New elements are never added to the collection Learn more...", + "markdown": "New elements are never added to the collection [Learn more...](https://www.jetbrains.com/help/rider/CollectionNeverUpdated.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionNeverUpdated.Global", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp98Cpp11CompatPedantic", + "shortDescription": { + "text": "c++98-c++11-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++98-c++11-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wc++98-c++11-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-98-c-11-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp98Cpp11CompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIgnoredPragmaIntrinsic", + "shortDescription": { + "text": "ignored-pragma-intrinsic clang diagnostic" + }, + "fullDescription": { + "text": "-Wignored-pragma-intrinsic clang diagnostic · Learn more", + "markdown": "-Wignored-pragma-intrinsic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wignored-pragma-intrinsic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIgnoredPragmaIntrinsic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeModifiersOrder", + "shortDescription": { + "text": "Adjust modifiers declaration order" + }, + "fullDescription": { + "text": "The order of declaration modifiers does not match code style settings Learn more...", + "markdown": "The order of declaration modifiers does not match code style settings [Learn more...](https://www.jetbrains.com/help/rider/ArrangeModifiersOrder.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeModifiersOrder", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.UnknownLayer", + "shortDescription": { + "text": "The layer is not defined in the 'Tags & Layers'" + }, + "fullDescription": { + "text": "The layer is not defined in the 'Tags & Layers'. The call is likely to fail at runtime.", + "markdown": "The layer is not defined in the 'Tags \\& Layers'. The call is likely to fail at runtime." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.UnknownLayer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantDelegateCreation", + "shortDescription": { + "text": "Explicit delegate creation expression is redundant" + }, + "fullDescription": { + "text": "Explicit delegate creation expression is redundant Learn more...", + "markdown": "Explicit delegate creation expression is redundant [Learn more...](https://www.jetbrains.com/help/rider/RedundantDelegateCreation.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantDelegateCreation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadSemicolonSpaces", + "shortDescription": { + "text": "Incorrect spacing (around semicolon)" + }, + "fullDescription": { + "text": "Around semicolon Learn more...", + "markdown": "Around semicolon [Learn more...](https://www.jetbrains.com/help/rider/BadSemicolonSpaces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadSemicolonSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticVarargs", + "shortDescription": { + "text": "varargs clang diagnostic" + }, + "fullDescription": { + "text": "-Wvarargs clang diagnostic · Learn more", + "markdown": "-Wvarargs clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wvarargs)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticVarargs", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.IncorrectScriptableObjectInstantiation", + "shortDescription": { + "text": "'ScriptableObject' instances must be instantiated with 'ScriptableObject.CreateInstance()' instead of 'new'" + }, + "fullDescription": { + "text": "Using 'new' to instantiate a class derived from 'ScriptableObject' means that Unity will not call any event functions. Create a new instance using 'GameObject.AddComponent()'. Learn more...", + "markdown": "Using 'new' to instantiate a class derived from 'ScriptableObject' means that Unity will not call any event functions. Create a new instance using 'GameObject.AddComponent()'. [Learn more...](https://github.com/JetBrains/resharper-unity/wiki/ScriptableObjects-must-be-instantiated-with-ScriptableObject.CreateInstance-instead-of-new)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.IncorrectScriptableObjectInstantiation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFormatTruncation", + "shortDescription": { + "text": "format-truncation clang diagnostic" + }, + "fullDescription": { + "text": "-Wformat-truncation clang diagnostic · Learn more", + "markdown": "-Wformat-truncation clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wformat-truncation)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFormatTruncation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppFunctionDoesntReturnValue", + "shortDescription": { + "text": "No return statement in a function or a lambda returning non-void" + }, + "fullDescription": { + "text": "No return statement in a function or a lambda with non-void return type", + "markdown": "No return statement in a function or a lambda with non-void return type" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppFunctionDoesntReturnValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPointerArith", + "shortDescription": { + "text": "pointer-arith clang diagnostic" + }, + "fullDescription": { + "text": "-Wpointer-arith clang diagnostic · Learn more", + "markdown": "-Wpointer-arith clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpointer-arith)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPointerArith", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMaxUnsignedZero", + "shortDescription": { + "text": "max-unsigned-zero clang diagnostic" + }, + "fullDescription": { + "text": "-Wmax-unsigned-zero clang diagnostic · Learn more", + "markdown": "-Wmax-unsigned-zero clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmax-unsigned-zero)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMaxUnsignedZero", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeReplaceRandomShuffle", + "shortDescription": { + "text": "modernize-replace-random-shuffle clang-tidy check" + }, + "fullDescription": { + "text": "modernize-replace-random-shuffle clang-tidy check · Learn more", + "markdown": "modernize-replace-random-shuffle clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/replace-random-shuffle.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeReplaceRandomShuffle", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticSpirvCompat", + "shortDescription": { + "text": "spirv-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wspirv-compat clang diagnostic · Learn more", + "markdown": "-Wspirv-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wspirv-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticSpirvCompat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CompareNonConstrainedGenericWithNull", + "shortDescription": { + "text": "Possible comparison of value type with 'null'" + }, + "fullDescription": { + "text": "Generic type has no value or class constraint, the condition could be always 'false' Learn more...", + "markdown": "Generic type has no value or class constraint, the condition could be always 'false' [Learn more...](https://www.jetbrains.com/help/rider/CompareNonConstrainedGenericWithNull.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "CompareNonConstrainedGenericWithNull", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.ImplicitUnspecifiedNullValues", + "shortDescription": { + "text": "NUnit. Implicitly unspecified null values." + }, + "fullDescription": { + "text": "NUnit. No enough values are provided in the Values attribute so NUnit implicitly adds 'null' values to fill test data. Learn more...", + "markdown": "NUnit. No enough values are provided in the Values attribute so NUnit implicitly adds 'null' values to fill test data. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.ImplicitUnspecifiedNullValues.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.ImplicitUnspecifiedNullValues", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppFunctionResultShouldBeUsed", + "shortDescription": { + "text": "Function result should be used" + }, + "fullDescription": { + "text": "Function returns a value of a type that should be handled at the call site", + "markdown": "Function returns a value of a type that should be handled at the call site" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppFunctionResultShouldBeUsed", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDanglingAssignmentGsl", + "shortDescription": { + "text": "dangling-assignment-gsl clang diagnostic" + }, + "fullDescription": { + "text": "-Wdangling-assignment-gsl clang diagnostic · Learn more", + "markdown": "-Wdangling-assignment-gsl clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdangling-assignment-gsl)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDanglingAssignmentGsl", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDoxygenUndocumentedParameter", + "shortDescription": { + "text": "Missing function parameter description in a documentation comment" + }, + "fullDescription": { + "text": "Missing function parameter description in a documentation comment", + "markdown": "Missing function parameter description in a documentation comment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppDoxygenUndocumentedParameter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS4014", + "shortDescription": { + "text": "Async method invocation without await expression" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/hh873131.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS4014", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadSwitchBracesIndent", + "shortDescription": { + "text": "Incorrect indent (around switch statement)" + }, + "fullDescription": { + "text": "Around switch statement", + "markdown": "Around switch statement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadSwitchBracesIndent", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticImplicitConstIntFloatConversion", + "shortDescription": { + "text": "implicit-const-int-float-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wimplicit-const-int-float-conversion clang diagnostic · Learn more", + "markdown": "-Wimplicit-const-int-float-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wimplicit-const-int-float-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticImplicitConstIntFloatConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleExplicitConstructor", + "shortDescription": { + "text": "google-explicit-constructor clang-tidy check" + }, + "fullDescription": { + "text": "google-explicit-constructor clang-tidy check · Learn more", + "markdown": "google-explicit-constructor clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/explicit-constructor.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleExplicitConstructor", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShadowUncapturedLocal", + "shortDescription": { + "text": "shadow-uncaptured-local clang diagnostic" + }, + "fullDescription": { + "text": "-Wshadow-uncaptured-local clang diagnostic · Learn more", + "markdown": "-Wshadow-uncaptured-local clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshadow-uncaptured-local)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShadowUncapturedLocal", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCplusplusSmartPtrModeling", + "shortDescription": { + "text": "cplusplus.SmartPtrModeling clang static analyzer check" + }, + "fullDescription": { + "text": "cplusplus.SmartPtrModeling clang static analyzer check · Learn more", + "markdown": "cplusplus.SmartPtrModeling clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCplusplusSmartPtrModeling", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuComplexInteger", + "shortDescription": { + "text": "gnu-complex-integer clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-complex-integer clang diagnostic · Learn more", + "markdown": "-Wgnu-complex-integer clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-complex-integer)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuComplexInteger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithOfType.Single.1", + "shortDescription": { + "text": "Replace with OfType().Single()" + }, + "fullDescription": { + "text": "$seq$.Select($x$ => $x$ as $T$).Single($y$ => $y$ != null)", + "markdown": "$seq$.Select($x$ =\\> $x$ as $T$).Single($y$ =\\> $y$ != null)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithOfType.Single.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithOfType.Single.2", + "shortDescription": { + "text": "Replace with OfType().Single() (replace with OfType().Single(..))" + }, + "fullDescription": { + "text": "$seq$.Select($x$ => $x$ as $T$).Single($y$ => $y$ != null && $expr$)", + "markdown": "$seq$.Select($x$ =\\> $x$ as $T$).Single($y$ =\\> $y$ != null \\&\\& $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithOfType.Single.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAbseilTimeSubtraction", + "shortDescription": { + "text": "abseil-time-subtraction clang-tidy check" + }, + "fullDescription": { + "text": "abseil-time-subtraction clang-tidy check · Learn more", + "markdown": "abseil-time-subtraction clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/abseil/time-subtraction.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAbseilTimeSubtraction", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeallocInCategory", + "shortDescription": { + "text": "dealloc-in-category clang diagnostic" + }, + "fullDescription": { + "text": "-Wdealloc-in-category clang diagnostic · Learn more", + "markdown": "-Wdealloc-in-category clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdealloc-in-category)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeallocInCategory", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp20Compat", + "shortDescription": { + "text": "c++20-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++20-compat clang diagnostic · Learn more", + "markdown": "-Wc++20-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-20-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp20Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeleteIncomplete", + "shortDescription": { + "text": "delete-incomplete clang diagnostic" + }, + "fullDescription": { + "text": "-Wdelete-incomplete clang diagnostic · Learn more", + "markdown": "-Wdelete-incomplete clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdelete-incomplete)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeleteIncomplete", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticThreadSafetyAnalysis", + "shortDescription": { + "text": "thread-safety-analysis clang diagnostic" + }, + "fullDescription": { + "text": "-Wthread-safety-analysis clang diagnostic · Learn more", + "markdown": "-Wthread-safety-analysis clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wthread-safety-analysis)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticThreadSafetyAnalysis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscNoRecursion", + "shortDescription": { + "text": "misc-no-recursion clang-tidy check" + }, + "fullDescription": { + "text": "misc-no-recursion clang-tidy check · Learn more", + "markdown": "misc-no-recursion clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/no-recursion.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyMiscNoRecursion", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EventUnsubscriptionViaAnonymousDelegate", + "shortDescription": { + "text": "Event unsubscription via anonymous delegate" + }, + "fullDescription": { + "text": "Event unsubscription via anonymous delegate is meaningless", + "markdown": "Event unsubscription via anonymous delegate is meaningless" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EventUnsubscriptionViaAnonymousDelegate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantConstSpecifier", + "shortDescription": { + "text": "Redundant 'const' specifier" + }, + "fullDescription": { + "text": "The 'const' specifier on a variable definition is redundant", + "markdown": "The 'const' specifier on a variable definition is redundant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRedundantConstSpecifier", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Redundancies in Code", + "index": 34, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3147", + "shortDescription": { + "text": "RoslynAnalyzers Mark Verb Handlers With Validate Antiforgery Token" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA3147", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseNullableAnnotationInsteadOfAttribute", + "shortDescription": { + "text": "Use nullable annotation instead of an attribute" + }, + "fullDescription": { + "text": "An attribute is used to declare the nullability of a type. Nullable reference types' annotations might be used instead.", + "markdown": "An attribute is used to declare the nullability of a type. Nullable reference types' annotations might be used instead." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseNullableAnnotationInsteadOfAttribute", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1091FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty region" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1091FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp14CompatPedantic", + "shortDescription": { + "text": "c++14-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++14-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wc++14-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-14-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp14CompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppMissingIncludeGuard", + "shortDescription": { + "text": "Missing include guard" + }, + "fullDescription": { + "text": "Include guard is not found at the beginning of a header file Learn more...", + "markdown": "Include guard is not found at the beginning of a header file [Learn more...](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-guards)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppMissingIncludeGuard", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedTupleComponentInReturnValue", + "shortDescription": { + "text": "Component of the tuple is never used" + }, + "fullDescription": { + "text": "Component of the tuple is never used", + "markdown": "Component of the tuple is never used" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedTupleComponentInReturnValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMacroRedefined", + "shortDescription": { + "text": "macro-redefined clang diagnostic" + }, + "fullDescription": { + "text": "-Wmacro-redefined clang diagnostic · Learn more", + "markdown": "-Wmacro-redefined clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmacro-redefined)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMacroRedefined", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticRetainedLanguageLinkage", + "shortDescription": { + "text": "retained-language-linkage clang diagnostic" + }, + "fullDescription": { + "text": "-Wretained-language-linkage clang diagnostic · Learn more", + "markdown": "-Wretained-language-linkage clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wretained-language-linkage)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticRetainedLanguageLinkage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EntityFramework.UnsupportedServerSideFunctionCall", + "shortDescription": { + "text": "Function is not convertible to SQL and must not be called in the database context" + }, + "fullDescription": { + "text": "Reports methods that are not convertible to SQL and will produce runtime exceptions when called in database contexts Learn more...", + "markdown": "Reports methods that are not convertible to SQL and will produce runtime exceptions when called in database contexts [Learn more...](https://www.jetbrains.com/help/rider/EntityFramework.UnsupportedServerSideFunctionCall.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EntityFramework.UnsupportedServerSideFunctionCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Entity Framework", + "index": 37, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticKeywordMacro", + "shortDescription": { + "text": "keyword-macro clang diagnostic" + }, + "fullDescription": { + "text": "-Wkeyword-macro clang diagnostic · Learn more", + "markdown": "-Wkeyword-macro clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wkeyword-macro)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticKeywordMacro", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityUseAnyofallof", + "shortDescription": { + "text": "readability-use-anyofallof clang-tidy check" + }, + "fullDescription": { + "text": "readability-use-anyofallof clang-tidy check · Learn more", + "markdown": "readability-use-anyofallof clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/use-anyofallof.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityUseAnyofallof", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticReadonlyIboutletProperty", + "shortDescription": { + "text": "readonly-iboutlet-property clang diagnostic" + }, + "fullDescription": { + "text": "-Wreadonly-iboutlet-property clang diagnostic · Learn more", + "markdown": "-Wreadonly-iboutlet-property clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wreadonly-iboutlet-property)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticReadonlyIboutletProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1311", + "shortDescription": { + "text": "RoslynAnalyzers Specify a culture or use an invariant version" + }, + "fullDescription": { + "text": "Specify culture to help avoid accidental implicit dependency on current culture. Using an invariant version yields consistent results regardless of the culture of an application.", + "markdown": "Specify culture to help avoid accidental implicit dependency on current culture. Using an invariant version yields consistent results regardless of the culture of an application." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1311", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1310", + "shortDescription": { + "text": "RoslynAnalyzers Specify StringComparison for correctness" + }, + "fullDescription": { + "text": "A string comparison operation uses a method overload that does not set a StringComparison parameter, hence its behavior could vary based on the current user's locale settings. It is strongly recommended to use the overload with StringComparison parameter for correctness and clarity of intent. If the result will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'.", + "markdown": "A string comparison operation uses a method overload that does not set a StringComparison parameter, hence its behavior could vary based on the current user's locale settings. It is strongly recommended to use the overload with StringComparison parameter for correctness and clarity of intent. If the result will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1310", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGccCompat", + "shortDescription": { + "text": "gcc-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wgcc-compat clang diagnostic · Learn more", + "markdown": "-Wgcc-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgcc-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGccCompat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDeprecatedRegisterStorageClassSpecifier", + "shortDescription": { + "text": "Deprecated 'register' storage class specifier" + }, + "fullDescription": { + "text": "The 'register' storage class specifier is deprecated in C++11 and removed in C++17", + "markdown": "The 'register' storage class specifier is deprecated in C++11 and removed in C++17" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDeprecatedRegisterStorageClassSpecifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMemsizeComparison", + "shortDescription": { + "text": "memsize-comparison clang diagnostic" + }, + "fullDescription": { + "text": "-Wmemsize-comparison clang diagnostic · Learn more", + "markdown": "-Wmemsize-comparison clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmemsize-comparison)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMemsizeComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseNegatedPatternInIsExpression", + "shortDescription": { + "text": "Convert negated 'is' expression into 'is' expression with negated pattern" + }, + "fullDescription": { + "text": "Replace unary negation operator '!' before 'is' expression with C# 9.0 negated pattern", + "markdown": "Replace unary negation operator '!' before 'is' expression with C# 9.0 negated pattern" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseNegatedPatternInIsExpression", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppAvoidCArrays", + "shortDescription": { + "text": "hicpp-avoid-c-arrays clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-avoid-c-arrays clang-tidy check · Learn more", + "markdown": "hicpp-avoid-c-arrays clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/avoid-c-arrays.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppAvoidCArrays", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithSingleCallToLast", + "shortDescription": { + "text": "Replace with single call to Last(..)" + }, + "fullDescription": { + "text": "$seq$.Where(Function ($x$) $expr$).Last()", + "markdown": "$seq$.Where(Function ($x$) $expr$).Last()" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithSingleCallToLast", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesNoexceptMoveOperations", + "shortDescription": { + "text": "cppcoreguidelines-noexcept-move-operations clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-noexcept-move-operations clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-noexcept-move-operations clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/noexcept-move-operations.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesNoexceptMoveOperations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Blazor.EditorRequired", + "shortDescription": { + "text": "Missed value for required attribute" + }, + "fullDescription": { + "text": "Missed value for required attribute", + "markdown": "Missed value for required attribute" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Blazor.EditorRequired", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Blazor/Potential Code Quality Issues", + "index": 42, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeWithSuspiciousEqualityIsUsedInRecord.Local", + "shortDescription": { + "text": "Type with suspicious equality is used in a record (private accessibility)" + }, + "fullDescription": { + "text": "Type with suspicious equality is used as a member of a record type. This inspection only triggers when the record type is actually used for equality comparisons in the solution. Learn more...", + "markdown": "Type with suspicious equality is used as a member of a record type. This inspection only triggers when the record type is actually used for equality comparisons in the solution. [Learn more...](https://www.jetbrains.com/help/rider/TypeWithSuspiciousEqualityIsUsedInRecord.Local.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "TypeWithSuspiciousEqualityIsUsedInRecord.Local", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticBackslashNewlineEscape", + "shortDescription": { + "text": "backslash-newline-escape clang diagnostic" + }, + "fullDescription": { + "text": "-Wbackslash-newline-escape clang diagnostic · Learn more", + "markdown": "-Wbackslash-newline-escape clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wbackslash-newline-escape)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticBackslashNewlineEscape", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1309", + "shortDescription": { + "text": "RoslynAnalyzers Use ordinal string comparison" + }, + "fullDescription": { + "text": "A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable.", + "markdown": "A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1309", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1308", + "shortDescription": { + "text": "RoslynAnalyzers Normalize strings to uppercase" + }, + "fullDescription": { + "text": "Strings should be normalized to uppercase. A small group of characters cannot make a round trip when they are converted to lowercase. To make a round trip means to convert the characters from one locale to another locale that represents character data differently, and then to accurately retrieve the original characters from the converted characters.", + "markdown": "Strings should be normalized to uppercase. A small group of characters cannot make a round trip when they are converted to lowercase. To make a round trip means to convert the characters from one locale to another locale that represents character data differently, and then to accurately retrieve the original characters from the converted characters." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA1308", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1307", + "shortDescription": { + "text": "RoslynAnalyzers Specify StringComparison for clarity" + }, + "fullDescription": { + "text": "A string comparison operation uses a method overload that does not set a StringComparison parameter. It is recommended to use the overload with StringComparison parameter for clarity of intent. If the result will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'.", + "markdown": "A string comparison operation uses a method overload that does not set a StringComparison parameter. It is recommended to use the overload with StringComparison parameter for clarity of intent. If the result will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA1307", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSizeofExpression", + "shortDescription": { + "text": "bugprone-sizeof-expression clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-sizeof-expression clang-tidy check · Learn more", + "markdown": "bugprone-sizeof-expression clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/sizeof-expression.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSizeofExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1305", + "shortDescription": { + "text": "RoslynAnalyzers Specify IFormatProvider" + }, + "fullDescription": { + "text": "A method or constructor calls one or more members that have overloads that accept a System.IFormatProvider parameter, and the method or constructor does not call the overload that takes the IFormatProvider parameter. When a System.Globalization.CultureInfo or IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be based on the input from/output displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider'. Otherwise, if the result will be stored and accessed by software, such as when it is loaded from disk/database and when it is persisted to disk/database, specify 'CultureInfo.InvariantCulture'.", + "markdown": "A method or constructor calls one or more members that have overloads that accept a System.IFormatProvider parameter, and the method or constructor does not call the overload that takes the IFormatProvider parameter. When a System.Globalization.CultureInfo or IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be based on the input from/output displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider'. Otherwise, if the result will be stored and accessed by software, such as when it is loaded from disk/database and when it is persisted to disk/database, specify 'CultureInfo.InvariantCulture'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1305", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1304", + "shortDescription": { + "text": "RoslynAnalyzers Specify CultureInfo" + }, + "fullDescription": { + "text": "A method or constructor calls a member that has an overload that accepts a System.Globalization.CultureInfo parameter, and the method or constructor does not call the overload that takes the CultureInfo parameter. When a CultureInfo or System.IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.", + "markdown": "A method or constructor calls a member that has an overload that accepts a System.Globalization.CultureInfo parameter, and the method or constructor does not call the overload that takes the CultureInfo parameter. When a CultureInfo or System.IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1304", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1303", + "shortDescription": { + "text": "RoslynAnalyzers Do not pass literals as localized parameters" + }, + "fullDescription": { + "text": "A method passes a string literal as a parameter to a constructor or method in the .NET Framework class library and that string should be localizable. To fix a violation of this rule, replace the string literal with a string retrieved through an instance of the ResourceManager class.", + "markdown": "A method passes a string literal as a parameter to a constructor or method in the .NET Framework class library and that string should be localizable. To fix a violation of this rule, replace the string literal with a string retrieved through an instance of the ResourceManager class." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA1303", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.TestCaseSourceShouldImplementIEnumerable", + "shortDescription": { + "text": "NUnit. Test case source must be non-abstract and implement IEnumerable." + }, + "fullDescription": { + "text": "NUnit. Test case source must refer to non-abstract class implementing IEnumerable. Learn more...", + "markdown": "NUnit. Test case source must refer to non-abstract class implementing IEnumerable. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.TestCaseSourceShouldImplementIEnumerable.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.TestCaseSourceShouldImplementIEnumerable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionNeverUpdated.Local", + "shortDescription": { + "text": "Collection is never updated (private accessibility)" + }, + "fullDescription": { + "text": "New elements are never added to the collection Learn more...", + "markdown": "New elements are never added to the collection [Learn more...](https://www.jetbrains.com/help/rider/CollectionNeverUpdated.Local.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionNeverUpdated.Local", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticOpenmp51Extensions", + "shortDescription": { + "text": "openmp-51-extensions clang diagnostic" + }, + "fullDescription": { + "text": "-Wopenmp-51-extensions clang diagnostic · Learn more", + "markdown": "-Wopenmp-51-extensions clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wopenmp-51-extensions)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticOpenmp51Extensions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadColonSpaces", + "shortDescription": { + "text": "Incorrect spacing (around colon)" + }, + "fullDescription": { + "text": "Around colon", + "markdown": "Around colon" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadColonSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MergeNestedPropertyPatterns", + "shortDescription": { + "text": "Merge nested property patterns" + }, + "fullDescription": { + "text": "Simplify nested member access in a pattern by using the C# 10 extended property patterns syntax Learn more...", + "markdown": "Simplify nested member access in a pattern by using the C# 10 extended property patterns syntax [Learn more...](https://www.jetbrains.com/help/rider/MergeNestedPropertyPatterns.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MergeNestedPropertyPatterns", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1217FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Convert interpolated string to concatenation" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1217FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStrictPrototypes", + "shortDescription": { + "text": "strict-prototypes clang diagnostic" + }, + "fullDescription": { + "text": "-Wstrict-prototypes clang diagnostic · Learn more", + "markdown": "-Wstrict-prototypes clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstrict-prototypes)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStrictPrototypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.XKeyAttributeDisallowed", + "shortDescription": { + "text": "x:Key is allowed for resources and dictionary elements only" + }, + "fullDescription": { + "text": "x:Key is allowed for resources and dictionary elements only", + "markdown": "x:Key is allowed for resources and dictionary elements only" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "Xaml.XKeyAttributeDisallowed", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Potential Code Quality Issues", + "index": 45, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternIsRedundant", + "shortDescription": { + "text": "The pattern is redundant, it does not produce any runtime checks" + }, + "fullDescription": { + "text": "The pattern is redundant because it does not produce any actual checks at runtime. This usually indicates an error in the pattern matching condition. Learn more...", + "markdown": "The pattern is redundant because it does not produce any actual checks at runtime. This usually indicates an error in the pattern matching condition. [Learn more...](https://www.jetbrains.com/help/rider/PatternIsRedundant.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PatternIsRedundant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesMissingStdForward", + "shortDescription": { + "text": "cppcoreguidelines-missing-std-forward clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-missing-std-forward clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-missing-std-forward clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/missing-std-forward.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesMissingStdForward", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JoinNullCheckWithUsage", + "shortDescription": { + "text": "Join null check with assignment" + }, + "fullDescription": { + "text": "Replaces if statement with code using ?? operator and throw expression Learn more...", + "markdown": "Replaces if statement with code using ?? operator and throw expression [Learn more...](https://www.jetbrains.com/help/rider/JoinNullCheckWithUsage.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JoinNullCheckWithUsage", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticSingleBitBitfieldConstantConversion", + "shortDescription": { + "text": "single-bit-bitfield-constant-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wsingle-bit-bitfield-constant-conversion clang diagnostic · Learn more", + "markdown": "-Wsingle-bit-bitfield-constant-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wsingle-bit-bitfield-constant-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticSingleBitBitfieldConstantConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticReceiverExpr", + "shortDescription": { + "text": "receiver-expr clang diagnostic" + }, + "fullDescription": { + "text": "-Wreceiver-expr clang diagnostic · Learn more", + "markdown": "-Wreceiver-expr clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wreceiver-expr)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticReceiverExpr", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseDesignatedInitializers", + "shortDescription": { + "text": "modernize-use-designated-initializers clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-designated-initializers clang-tidy check · Learn more", + "markdown": "modernize-use-designated-initializers clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-designated-initializers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseDesignatedInitializers", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1574,CS1584,CS1581,CS1580", + "shortDescription": { + "text": "Cannot resolve reference in XML comment" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://www.jetbrains.com/help/rider/CSharpWarnings_CS1574_CS1584_CS1581_CS1580.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1574,CS1584,CS1581,CS1580", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.LoadSceneUnexistingScene", + "shortDescription": { + "text": "Scene does not exist" + }, + "fullDescription": { + "text": "There is no scene with the same name in the project.", + "markdown": "There is no scene with the same name in the project." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.LoadSceneUnexistingScene", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS8425", + "shortDescription": { + "text": "Async-iterator has one or more parameters of type 'CancellationToken' but none of them is annotated with the 'EnumeratorCancellation' attribute." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS8425", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS8424", + "shortDescription": { + "text": "The 'EnumeratorCancellation' attribute is only effective on a parameter of type 'CancellationToken' in an async-iterator method returning 'IAsyncEnumerable<>'." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS8424", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnsafeBufferUsage", + "shortDescription": { + "text": "unsafe-buffer-usage clang diagnostic" + }, + "fullDescription": { + "text": "-Wunsafe-buffer-usage clang diagnostic · Learn more", + "markdown": "-Wunsafe-buffer-usage clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunsafe-buffer-usage)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnsafeBufferUsage", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDeletingVoidPointer", + "shortDescription": { + "text": "Deleting a void pointer" + }, + "fullDescription": { + "text": "Deleting a void pointer is undefined behavior", + "markdown": "Deleting a void pointer is undefined behavior" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDeletingVoidPointer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStrictSelectorMatch", + "shortDescription": { + "text": "strict-selector-match clang diagnostic" + }, + "fullDescription": { + "text": "-Wstrict-selector-match clang diagnostic · Learn more", + "markdown": "-Wstrict-selector-match clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstrict-selector-match)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStrictSelectorMatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCplusplusArrayDelete", + "shortDescription": { + "text": "cplusplus.ArrayDelete clang static analyzer check" + }, + "fullDescription": { + "text": "cplusplus.ArrayDelete clang static analyzer check · Learn more", + "markdown": "cplusplus.ArrayDelete clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCplusplusArrayDelete", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNullableToNonnullConversion", + "shortDescription": { + "text": "nullable-to-nonnull-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wnullable-to-nonnull-conversion clang diagnostic · Learn more", + "markdown": "-Wnullable-to-nonnull-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnullable-to-nonnull-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNullableToNonnullConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RouteTemplates.ParameterConstraintCanBeSpecified", + "shortDescription": { + "text": "Route parameter constraint can be added due to type of method argument" + }, + "fullDescription": { + "text": "Route parameter constraint can be added due to type of method argument", + "markdown": "Route parameter constraint can be added due to type of method argument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RouteTemplates.ParameterConstraintCanBeSpecified", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ASP.NET route templates/Code Notification", + "index": 48, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftCommentPaste", + "shortDescription": { + "text": "microsoft-comment-paste clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-comment-paste clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-comment-paste clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-comment-paste)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftCommentPaste", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppThrowExpressionCanBeReplacedWithRethrow", + "shortDescription": { + "text": "Throw expression can be replaced with a rethrow expression" + }, + "fullDescription": { + "text": "Throw expression can be replaced with a rethrow expression", + "markdown": "Throw expression can be replaced with a rethrow expression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppThrowExpressionCanBeReplacedWithRethrow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Godot.MissingParameterlessConstructor", + "shortDescription": { + "text": "Parameterless constructor required" + }, + "fullDescription": { + "text": "Consider adding a parameterless constructor for the GodotEngine to initialize a script/game object", + "markdown": "Consider adding a parameterless constructor for the GodotEngine to initialize a script/game object" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Godot.MissingParameterlessConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Godot", + "index": 50, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.XamlMismatchedDeviceFamilyViewClrNameHighlighting", + "shortDescription": { + "text": "DeviceFamily-specific view type name does not match generic type name" + }, + "fullDescription": { + "text": "DeviceFamily-specific view type name does not match generic type name", + "markdown": "DeviceFamily-specific view type name does not match generic type name" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.XamlMismatchedDeviceFamilyViewClrNameHighlighting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Potential Code Quality Issues", + "index": 45, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp98Cpp11Cpp14Compat", + "shortDescription": { + "text": "c++98-c++11-c++14-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++98-c++11-c++14-compat clang diagnostic · Learn more", + "markdown": "-Wc++98-c++11-c++14-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-98-c-11-c-14-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp98Cpp11Cpp14Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1031FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Remove unnecessary braces in switch section" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1031FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneChainedComparison", + "shortDescription": { + "text": "bugprone-chained-comparison clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-chained-comparison clang-tidy check · Learn more", + "markdown": "bugprone-chained-comparison clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/chained-comparison.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneChainedComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSwitchMissingDefaultCase", + "shortDescription": { + "text": "bugprone-switch-missing-default-case clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-switch-missing-default-case clang-tidy check · Learn more", + "markdown": "bugprone-switch-missing-default-case clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSwitchMissingDefaultCase", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPreCpp14CompatPedantic", + "shortDescription": { + "text": "pre-c++14-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wpre-c++14-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wpre-c++14-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpre-c-14-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPreCpp14CompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AsmDefWarnings", + "shortDescription": { + "text": "AsmDef Warnings" + }, + "fullDescription": { + "text": "AsmDef Warnings", + "markdown": "AsmDef Warnings" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AsmDefWarnings", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Non configurable", + "index": 52, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedCopyWithUserProvidedCopy", + "shortDescription": { + "text": "deprecated-copy-with-user-provided-copy clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-copy-with-user-provided-copy clang diagnostic · Learn more", + "markdown": "-Wdeprecated-copy-with-user-provided-copy clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-copy-with-user-provided-copy)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedCopyWithUserProvidedCopy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRangeBasedForIncompatibleReference", + "shortDescription": { + "text": "Possibly unintended incompatible reference type in range declaration" + }, + "fullDescription": { + "text": "Using an incompatible reference type in the range declaration is likely to cause unwanted object copying", + "markdown": "Using an incompatible reference type in the range declaration is likely to cause unwanted object copying" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppRangeBasedForIncompatibleReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAtomicAccess", + "shortDescription": { + "text": "atomic-access clang diagnostic" + }, + "fullDescription": { + "text": "-Watomic-access clang diagnostic · Learn more", + "markdown": "-Watomic-access clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#watomic-access)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAtomicAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTautologicalTypeLimitCompare", + "shortDescription": { + "text": "tautological-type-limit-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wtautological-type-limit-compare clang diagnostic · Learn more", + "markdown": "-Wtautological-type-limit-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtautological-type-limit-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTautologicalTypeLimitCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertCon36C", + "shortDescription": { + "text": "cert-con36-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-con36-c clang-tidy check · Learn more", + "markdown": "cert-con36-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/con36-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertCon36C", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftUnionMemberReference", + "shortDescription": { + "text": "microsoft-union-member-reference clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-union-member-reference clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-union-member-reference clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-union-member-reference)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftUnionMemberReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToLocalFunction", + "shortDescription": { + "text": "Convert delegate variable into local function" + }, + "fullDescription": { + "text": "Replace delegate variable with local function Learn more...", + "markdown": "Replace delegate variable with local function [Learn more...](https://www.jetbrains.com/help/rider/ConvertToLocalFunction.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToLocalFunction", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNonModularIncludeInModule", + "shortDescription": { + "text": "non-modular-include-in-module clang diagnostic" + }, + "fullDescription": { + "text": "-Wnon-modular-include-in-module clang diagnostic · Learn more", + "markdown": "-Wnon-modular-include-in-module clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnon-modular-include-in-module)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNonModularIncludeInModule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPerformanceNoexceptDestructor", + "shortDescription": { + "text": "performance-noexcept-destructor clang-tidy check" + }, + "fullDescription": { + "text": "performance-noexcept-destructor clang-tidy check · Learn more", + "markdown": "performance-noexcept-destructor clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance/noexcept-destructor.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyPerformanceNoexceptDestructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompatibleMsStruct", + "shortDescription": { + "text": "incompatible-ms-struct clang diagnostic" + }, + "fullDescription": { + "text": "-Wincompatible-ms-struct clang diagnostic · Learn more", + "markdown": "-Wincompatible-ms-struct clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-ms-struct)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompatibleMsStruct", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppNoArrayDecay", + "shortDescription": { + "text": "hicpp-no-array-decay clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-no-array-decay clang-tidy check · Learn more", + "markdown": "hicpp-no-array-decay clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/no-array-decay.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppNoArrayDecay", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxNSOrCFErrorDerefChecker", + "shortDescription": { + "text": "osx.NSOrCFErrorDerefChecker clang static analyzer check" + }, + "fullDescription": { + "text": "osx.NSOrCFErrorDerefChecker clang static analyzer check · Learn more", + "markdown": "osx.NSOrCFErrorDerefChecker clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxNSOrCFErrorDerefChecker", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPointerIntegerCompare", + "shortDescription": { + "text": "pointer-integer-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wpointer-integer-compare clang diagnostic · Learn more", + "markdown": "-Wpointer-integer-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpointer-integer-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPointerIntegerCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppMissingIndent", + "shortDescription": { + "text": "Incorrect indent (missing indent/outdent elsewhere)" + }, + "fullDescription": { + "text": "Missing indent/outdent elsewhere", + "markdown": "Missing indent/outdent elsewhere" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppMissingIndent", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompatibleFunctionPointerTypesStrict", + "shortDescription": { + "text": "incompatible-function-pointer-types-strict clang diagnostic" + }, + "fullDescription": { + "text": "-Wincompatible-function-pointer-types-strict clang diagnostic · Learn more", + "markdown": "-Wincompatible-function-pointer-types-strict clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-function-pointer-types-strict)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompatibleFunctionPointerTypesStrict", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Html.AttributeValueNotResolved", + "shortDescription": { + "text": "Unknown attribute value" + }, + "fullDescription": { + "text": "Unknown attribute value in HTML and related technologies", + "markdown": "Unknown attribute value in HTML and related technologies" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Html.AttributeValueNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Potential Code Quality Issues", + "index": 54, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppPrintfExtraArg", + "shortDescription": { + "text": "Too many arguments in a call to printf" + }, + "fullDescription": { + "text": "Too many arguments in a call to printf. Some of the arguments are not used.", + "markdown": "Too many arguments in a call to printf. Some of the arguments are not used." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppPrintfExtraArg", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityElseAfterReturn", + "shortDescription": { + "text": "readability-else-after-return clang-tidy check" + }, + "fullDescription": { + "text": "readability-else-after-return clang-tidy check · Learn more", + "markdown": "readability-else-after-return clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/else-after-return.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityElseAfterReturn", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPragmaClangAttribute", + "shortDescription": { + "text": "pragma-clang-attribute clang diagnostic" + }, + "fullDescription": { + "text": "-Wpragma-clang-attribute clang diagnostic · Learn more", + "markdown": "-Wpragma-clang-attribute clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpragma-clang-attribute)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPragmaClangAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesProBoundsPointerArithmetic", + "shortDescription": { + "text": "cppcoreguidelines-pro-bounds-pointer-arithmetic clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-pro-bounds-pointer-arithmetic clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-pro-bounds-pointer-arithmetic clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-pointer-arithmetic.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesProBoundsPointerArithmetic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExternInitializer", + "shortDescription": { + "text": "extern-initializer clang diagnostic" + }, + "fullDescription": { + "text": "-Wextern-initializer clang diagnostic · Learn more", + "markdown": "-Wextern-initializer clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wextern-initializer)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExternInitializer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesAvoidMagicNumbers", + "shortDescription": { + "text": "cppcoreguidelines-avoid-magic-numbers clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-avoid-magic-numbers clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-avoid-magic-numbers clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-magic-numbers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesAvoidMagicNumbers", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BaseObjectGetHashCodeCallInGetHashCode", + "shortDescription": { + "text": "Overridden GetHashCode calls base 'Object.GetHashCode()'" + }, + "fullDescription": { + "text": "Overridden GetHashCode calls base 'Object.GetHashCode()' Learn more...", + "markdown": "Overridden GetHashCode calls base 'Object.GetHashCode()' [Learn more...](https://www.jetbrains.com/help/rider/BaseObjectGetHashCodeCallInGetHashCode.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BaseObjectGetHashCodeCallInGetHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedLiteralOperator", + "shortDescription": { + "text": "deprecated-literal-operator clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-literal-operator clang diagnostic · Learn more", + "markdown": "-Wdeprecated-literal-operator clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-literal-operator)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedLiteralOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityUppercaseLiteralSuffix", + "shortDescription": { + "text": "readability-uppercase-literal-suffix clang-tidy check" + }, + "fullDescription": { + "text": "readability-uppercase-literal-suffix clang-tidy check · Learn more", + "markdown": "readability-uppercase-literal-suffix clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/uppercase-literal-suffix.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityUppercaseLiteralSuffix", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDirectIvarAccess", + "shortDescription": { + "text": "direct-ivar-access clang diagnostic" + }, + "fullDescription": { + "text": "-Wdirect-ivar-access clang diagnostic · Learn more", + "markdown": "-Wdirect-ivar-access clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdirect-ivar-access)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDirectIvarAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppIdenticalOperandsInBinaryExpression", + "shortDescription": { + "text": "Binary operator acts on identical operands" + }, + "fullDescription": { + "text": "Binary operator acts on identical operands", + "markdown": "Binary operator acts on identical operands" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppIdenticalOperandsInBinaryExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedRegister", + "shortDescription": { + "text": "deprecated-register clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-register clang diagnostic · Learn more", + "markdown": "-Wdeprecated-register clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-register)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedRegister", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMismatchedNewDelete", + "shortDescription": { + "text": "mismatched-new-delete clang diagnostic" + }, + "fullDescription": { + "text": "-Wmismatched-new-delete clang diagnostic · Learn more", + "markdown": "-Wmismatched-new-delete clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmismatched-new-delete)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMismatchedNewDelete", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstAccessingManagedMethod", + "shortDescription": { + "text": "Accessing managed methods is not supported" + }, + "fullDescription": { + "text": "Accessing managed methods is not supported", + "markdown": "Accessing managed methods is not supported" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstAccessingManagedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ShiftExpressionResultEqualsZero", + "shortDescription": { + "text": "Constant shift expression with non-zero operands results in a zero value" + }, + "fullDescription": { + "text": "Constant shift expression with non-zero operands results in a zero value", + "markdown": "Constant shift expression with non-zero operands results in a zero value" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ShiftExpressionResultEqualsZero", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityRedundantStringInit", + "shortDescription": { + "text": "readability-redundant-string-init clang-tidy check" + }, + "fullDescription": { + "text": "readability-redundant-string-init clang-tidy check · Learn more", + "markdown": "readability-redundant-string-init clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/redundant-string-init.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityRedundantStringInit", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnsupportedTargetOpt", + "shortDescription": { + "text": "unsupported-target-opt clang diagnostic" + }, + "fullDescription": { + "text": "-Wunsupported-target-opt clang diagnostic · Learn more", + "markdown": "-Wunsupported-target-opt clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunsupported-target-opt)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnsupportedTargetOpt", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTautologicalConstantInRangeCompare", + "shortDescription": { + "text": "tautological-constant-in-range-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wtautological-constant-in-range-compare clang diagnostic · Learn more", + "markdown": "-Wtautological-constant-in-range-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtautological-constant-in-range-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTautologicalConstantInRangeCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnknownEscapeSequence", + "shortDescription": { + "text": "unknown-escape-sequence clang diagnostic" + }, + "fullDescription": { + "text": "-Wunknown-escape-sequence clang diagnostic · Learn more", + "markdown": "-Wunknown-escape-sequence clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunknown-escape-sequence)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnknownEscapeSequence", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppIgnoredRemoveResult", + "shortDescription": { + "text": "hicpp-ignored-remove-result clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-ignored-remove-result clang-tidy check · Learn more", + "markdown": "hicpp-ignored-remove-result clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyHicppIgnoredRemoveResult", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseArrayEmptyMethod", + "shortDescription": { + "text": "Use 'Array.Empty()'" + }, + "fullDescription": { + "text": "Replace an empty array allocation with a call of the predefined 'Array.Empty()' method", + "markdown": "Replace an empty array allocation with a call of the predefined 'Array.Empty()' method" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseArrayEmptyMethod", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadCommaSpaces", + "shortDescription": { + "text": "Incorrect spacing (around comma)" + }, + "fullDescription": { + "text": "Around comma", + "markdown": "Around comma" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadCommaSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppAbstractClassWithoutSpecifier", + "shortDescription": { + "text": "Class is abstract but not explicitly declared as such" + }, + "fullDescription": { + "text": "The class is abstract but not explicitly declared as such", + "markdown": "The class is abstract but not explicitly declared as such" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppAbstractClassWithoutSpecifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithOfType.Single.2", + "shortDescription": { + "text": "Replace with OfType().Single() (replace with OfType(Of ..)().Single(..))" + }, + "fullDescription": { + "text": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Single(Function ($y$) $y$ IsNot Nothing AndAlso $expr$)", + "markdown": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Single(Function ($y$) $y$ IsNot Nothing AndAlso $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithOfType.Single.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithOfType.Single.1", + "shortDescription": { + "text": "Replace with OfType().Single() (replace with OfType(Of ..)().Single())" + }, + "fullDescription": { + "text": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Single(Function ($y$) $y$ IsNot Nothing)", + "markdown": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Single(Function ($y$) $y$ IsNot Nothing)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithOfType.Single.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFormatSecurity", + "shortDescription": { + "text": "format-security clang diagnostic" + }, + "fullDescription": { + "text": "-Wformat-security clang diagnostic · Learn more", + "markdown": "-Wformat-security clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wformat-security)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFormatSecurity", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBoostFormatBadCode", + "shortDescription": { + "text": "Incorrect format directive in boost::format" + }, + "fullDescription": { + "text": "A format string of boost::format contains an erroneous format directive", + "markdown": "A format string of boost::format contains an erroneous format directive" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppBoostFormatBadCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp23LambdaAttributes", + "shortDescription": { + "text": "c++23-lambda-attributes clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++23-lambda-attributes clang diagnostic · Learn more", + "markdown": "-Wc++23-lambda-attributes clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-23-lambda-attributes)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp23LambdaAttributes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadParensSpaces", + "shortDescription": { + "text": "Incorrect spacing (around parenthesis)" + }, + "fullDescription": { + "text": "Around parenthesis", + "markdown": "Around parenthesis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadParensSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PossibleInterfaceMemberAmbiguity", + "shortDescription": { + "text": "Possible ambiguity while accessing member by interface" + }, + "fullDescription": { + "text": "Possible ambiguity while accessing member by interface", + "markdown": "Possible ambiguity while accessing member by interface" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PossibleInterfaceMemberAmbiguity", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPessimizingMove", + "shortDescription": { + "text": "pessimizing-move clang diagnostic" + }, + "fullDescription": { + "text": "-Wpessimizing-move clang diagnostic · Learn more", + "markdown": "-Wpessimizing-move clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpessimizing-move)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPessimizingMove", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodHasAsyncOverloadWithCancellation", + "shortDescription": { + "text": "Method has async overload with cancellation support" + }, + "fullDescription": { + "text": "Method has async overload with 'CancellationToken'", + "markdown": "Method has async overload with 'CancellationToken'" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MethodHasAsyncOverloadWithCancellation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompatibleFunctionPointerTypes", + "shortDescription": { + "text": "incompatible-function-pointer-types clang diagnostic" + }, + "fullDescription": { + "text": "-Wincompatible-function-pointer-types clang diagnostic · Learn more", + "markdown": "-Wincompatible-function-pointer-types clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-function-pointer-types)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompatibleFunctionPointerTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeleteNonAbstractNonVirtualDtor", + "shortDescription": { + "text": "delete-non-abstract-non-virtual-dtor clang diagnostic" + }, + "fullDescription": { + "text": "-Wdelete-non-abstract-non-virtual-dtor clang diagnostic · Learn more", + "markdown": "-Wdelete-non-abstract-non-virtual-dtor clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdelete-non-abstract-non-virtual-dtor)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeleteNonAbstractNonVirtualDtor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppPrivateSpecialMemberFunctionIsNotImplemented", + "shortDescription": { + "text": "Private special member function is not implemented" + }, + "fullDescription": { + "text": "A private special member function must be defined or deleted", + "markdown": "A private special member function must be defined or deleted" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppPrivateSpecialMemberFunctionIsNotImplemented", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesAvoidGoto", + "shortDescription": { + "text": "cppcoreguidelines-avoid-goto clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-avoid-goto clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-avoid-goto clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-goto.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesAvoidGoto", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUndefPrefix", + "shortDescription": { + "text": "undef-prefix clang diagnostic" + }, + "fullDescription": { + "text": "-Wundef-prefix clang diagnostic · Learn more", + "markdown": "-Wundef-prefix clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wundef-prefix)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUndefPrefix", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityInconsistentDeclarationParameterName", + "shortDescription": { + "text": "readability-inconsistent-declaration-parameter-name clang-tidy check" + }, + "fullDescription": { + "text": "readability-inconsistent-declaration-parameter-name clang-tidy check · Learn more", + "markdown": "readability-inconsistent-declaration-parameter-name clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityInconsistentDeclarationParameterName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObsoleteElementError", + "shortDescription": { + "text": "Use of obsolete type or type member (error)" + }, + "fullDescription": { + "text": "Use of obsolete type or type member in XAML markup (error)", + "markdown": "Use of obsolete type or type member in XAML markup (error)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "ObsoleteElementError", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Compiler Warnings", + "index": 60, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertConstructorToMemberInitializers", + "shortDescription": { + "text": "Convert constructor into member initializers" + }, + "fullDescription": { + "text": "Replace constructor with members initialized inline Learn more...", + "markdown": "Replace constructor with members initialized inline [Learn more...](https://www.jetbrains.com/help/rider/ConvertConstructorToMemberInitializers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertConstructorToMemberInitializers", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.DuplicateShortcut", + "shortDescription": { + "text": "The same shortcut is defined for another menu item" + }, + "fullDescription": { + "text": "The same shortcut is defined for another menu item", + "markdown": "The same shortcut is defined for another menu item" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.DuplicateShortcut", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneUnhandledExceptionAtNew", + "shortDescription": { + "text": "bugprone-unhandled-exception-at-new clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-unhandled-exception-at-new clang-tidy check · Learn more", + "markdown": "bugprone-unhandled-exception-at-new clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/unhandled-exception-at-new.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyBugproneUnhandledExceptionAtNew", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDllexportExplicitInstantiationDecl", + "shortDescription": { + "text": "dllexport-explicit-instantiation-decl clang diagnostic" + }, + "fullDescription": { + "text": "-Wdllexport-explicit-instantiation-decl clang diagnostic · Learn more", + "markdown": "-Wdllexport-explicit-instantiation-decl clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdllexport-explicit-instantiation-decl)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDllexportExplicitInstantiationDecl", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppIntegralToPointerConversion", + "shortDescription": { + "text": "Implicit integer to pointer conversion" + }, + "fullDescription": { + "text": "Implicit integer to pointer conversion", + "markdown": "Implicit integer to pointer conversion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppIntegralToPointerConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0420", + "shortDescription": { + "text": "Reference to a volatile field will not be treated as volatile" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0420", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFourCharConstants", + "shortDescription": { + "text": "four-char-constants clang diagnostic" + }, + "fullDescription": { + "text": "-Wfour-char-constants clang diagnostic · Learn more", + "markdown": "-Wfour-char-constants clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wfour-char-constants)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFourCharConstants", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS8383", + "shortDescription": { + "text": "The tuple element name is ignored because a different name or no name is specified on the other side of the tuple == or != operator." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS8383", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.XamlRelativeSourceDefaultModeWarningHighlighting", + "shortDescription": { + "text": "RelativeSourceMode is not set explicitly" + }, + "fullDescription": { + "text": "Default RelativeSourceMode value is platform-specific, explicit specification is required to process RelativeSource usage unambiguously", + "markdown": "Default RelativeSourceMode value is platform-specific, explicit specification is required to process RelativeSource usage unambiguously" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.XamlRelativeSourceDefaultModeWarningHighlighting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Potential Code Quality Issues", + "index": 45, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.RangeAttributeBoundsAreOutOfRange", + "shortDescription": { + "text": "NUnit. Values in range do not fit the type of the test parameter." + }, + "fullDescription": { + "text": "NUnit. Values specified in [Range] are out range for the type of the test parameter. Learn more...", + "markdown": "NUnit. Values specified in \\[Range\\] are out range for the type of the test parameter. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.RangeAttributeBoundsAreOutOfRange.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.RangeAttributeBoundsAreOutOfRange", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyFuchsiaVirtualInheritance", + "shortDescription": { + "text": "fuchsia-virtual-inheritance clang-tidy check" + }, + "fullDescription": { + "text": "fuchsia-virtual-inheritance clang-tidy check · Learn more", + "markdown": "fuchsia-virtual-inheritance clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/fuchsia/virtual-inheritance.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyFuchsiaVirtualInheritance", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuPointerArith", + "shortDescription": { + "text": "gnu-pointer-arith clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-pointer-arith clang diagnostic · Learn more", + "markdown": "-Wgnu-pointer-arith clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-pointer-arith)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuPointerArith", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertMsc33C", + "shortDescription": { + "text": "cert-msc33-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-msc33-c clang-tidy check · Learn more", + "markdown": "cert-msc33-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/msc33-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertMsc33C", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadIndent", + "shortDescription": { + "text": "Incorrect indent (redundant indent/outdent elsewhere)" + }, + "fullDescription": { + "text": "Redundant indent/outdent elsewhere Learn more...", + "markdown": "Redundant indent/outdent elsewhere [Learn more...](https://www.jetbrains.com/help/rider/BadIndent.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadIndent", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertCon54Cpp", + "shortDescription": { + "text": "cert-con54-cpp clang-tidy check" + }, + "fullDescription": { + "text": "cert-con54-cpp clang-tidy check · Learn more", + "markdown": "cert-con54-cpp clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/con54-cpp.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertCon54Cpp", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotAssignedOutParameter", + "shortDescription": { + "text": "'out' parameter is not assigned upon exit" + }, + "fullDescription": { + "text": "'out' parameter is not assigned upon exit", + "markdown": "'out' parameter is not assigned upon exit" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NotAssignedOutParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Potential Code Quality Issues", + "index": 62, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticInvalidPpToken", + "shortDescription": { + "text": "invalid-pp-token clang diagnostic" + }, + "fullDescription": { + "text": "-Winvalid-pp-token clang diagnostic · Learn more", + "markdown": "-Winvalid-pp-token clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winvalid-pp-token)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticInvalidPpToken", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1723", + "shortDescription": { + "text": "XML comment has cref attribute that refers to a type parameter" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/ms228603.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1723", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.RedundantExpectedResultInTestCaseAttribute", + "shortDescription": { + "text": "NUnit. Redundant expected result for void test method." + }, + "fullDescription": { + "text": "Specifying expected result for void NUnit test methods through the [TestCase] attribute is redundant. Learn more...", + "markdown": "Specifying expected result for void NUnit test methods through the \\[TestCase\\] attribute is redundant. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.RedundantExpectedResultInTestCaseAttribute.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.RedundantExpectedResultInTestCaseAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.UnknownTag", + "shortDescription": { + "text": "The tag is not defined in the 'Tags & Layers'" + }, + "fullDescription": { + "text": "The tag is not defined in the 'Tags & Layers'. Expression will return 'false'.", + "markdown": "The tag is not defined in the 'Tags \\& Layers'. Expression will return 'false'." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.UnknownTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitParamsArrayCreation", + "shortDescription": { + "text": "Redundant explicit collection creation in argument of 'params' parameter" + }, + "fullDescription": { + "text": "Explicit collection creation in an argument passed to the 'params' parameter is redundant Learn more...", + "markdown": "Explicit collection creation in an argument passed to the 'params' parameter is redundant [Learn more...](https://www.jetbrains.com/help/rider/RedundantExplicitParamsArrayCreation.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RedundantExplicitParamsArrayCreation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleObjcFunctionNaming", + "shortDescription": { + "text": "google-objc-function-naming clang-tidy check" + }, + "fullDescription": { + "text": "google-objc-function-naming clang-tidy check · Learn more", + "markdown": "google-objc-function-naming clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/objc-function-naming.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleObjcFunctionNaming", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOptinPerformancePadding", + "shortDescription": { + "text": "optin.performance.Padding clang static analyzer check" + }, + "fullDescription": { + "text": "optin.performance.Padding clang static analyzer check · Learn more", + "markdown": "optin.performance.Padding clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOptinPerformancePadding", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS7023", + "shortDescription": { + "text": "Static type in 'is' or 'as' operator." + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/warning-waves#cs7023---a-static-type-is-used-in-an-is-or-as-expression)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS7023", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Asp.Warning", + "shortDescription": { + "text": "ASP.NET Warning" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Asp.Warning", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS7022", + "shortDescription": { + "text": "The 'Main' method will not be used as an entry point because compilation unit with top-level statements was found." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS7022", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneMultipleNewInOneExpression", + "shortDescription": { + "text": "bugprone-multiple-new-in-one-expression clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-multiple-new-in-one-expression clang-tidy check · Learn more", + "markdown": "bugprone-multiple-new-in-one-expression clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/multiple-new-in-one-expression.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneMultipleNewInOneExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCoreUninitializedArraySubscript", + "shortDescription": { + "text": "core.uninitialized.ArraySubscript clang static analyzer check" + }, + "fullDescription": { + "text": "core.uninitialized.ArraySubscript clang static analyzer check · Learn more", + "markdown": "core.uninitialized.ArraySubscript clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCoreUninitializedArraySubscript", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseIndexFromEndExpression", + "shortDescription": { + "text": "Use index from end expression" + }, + "fullDescription": { + "text": "Replace array indexer argument with index from end expression", + "markdown": "Replace array indexer argument with index from end expression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseIndexFromEndExpression", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RouteTemplates.ParameterTypeAndConstraintsMismatch", + "shortDescription": { + "text": "Type of parameter doesn't satisfy constraints declared in route template" + }, + "fullDescription": { + "text": "Type of parameter doesn't satisfy constraints declared in route template", + "markdown": "Type of parameter doesn't satisfy constraints declared in route template" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RouteTemplates.ParameterTypeAndConstraintsMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ASP.NET route templates/Code Notification", + "index": 48, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertMsc32C", + "shortDescription": { + "text": "cert-msc32-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-msc32-c clang-tidy check · Learn more", + "markdown": "cert-msc32-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/msc32-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertMsc32C", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuBinaryLiteral", + "shortDescription": { + "text": "gnu-binary-literal clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-binary-literal clang diagnostic · Learn more", + "markdown": "-Wgnu-binary-literal clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-binary-literal)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuBinaryLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertTypeCheckToNullCheck", + "shortDescription": { + "text": "Use null check instead of a type check succeeding on any not-null value" + }, + "fullDescription": { + "text": "The expression of 'is' operator matches the provided type on any non-null value. Consider comparing with 'null' instead. Learn more...", + "markdown": "The expression of 'is' operator matches the provided type on any non-null value. Consider comparing with 'null' instead. [Learn more...](https://www.jetbrains.com/help/rider/ConvertTypeCheckToNullCheck.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConvertTypeCheckToNullCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppUseEqualsDefault", + "shortDescription": { + "text": "hicpp-use-equals-default clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-use-equals-default clang-tidy check · Learn more", + "markdown": "hicpp-use-equals-default clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/use-equals-default.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppUseEqualsDefault", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.IgnoredParameterAttribute", + "shortDescription": { + "text": "NUnit. Ignored parameter attribute." + }, + "fullDescription": { + "text": "NUnit. Parameter attribute is ignored by NUnit framework.", + "markdown": "NUnit. Parameter attribute is ignored by NUnit framework." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.IgnoredParameterAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseTransparentFunctors", + "shortDescription": { + "text": "modernize-use-transparent-functors clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-transparent-functors clang-tidy check · Learn more", + "markdown": "modernize-use-transparent-functors clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-transparent-functors.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseTransparentFunctors", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MeaninglessDefaultParameterValue", + "shortDescription": { + "text": "'DefaultParameterValueAttribute' must be used in conjunction with 'OptionalAttribute'" + }, + "fullDescription": { + "text": "'DefaultParameterValueAttribute' must be used in conjunction with 'OptionalAttribute'", + "markdown": "'DefaultParameterValueAttribute' must be used in conjunction with 'OptionalAttribute'" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MeaninglessDefaultParameterValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnneededInternalDeclaration", + "shortDescription": { + "text": "unneeded-internal-declaration clang diagnostic" + }, + "fullDescription": { + "text": "-Wunneeded-internal-declaration clang diagnostic · Learn more", + "markdown": "-Wunneeded-internal-declaration clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunneeded-internal-declaration)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnneededInternalDeclaration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstCreatingManagedType", + "shortDescription": { + "text": "Creating a managed type is not supported" + }, + "fullDescription": { + "text": "Creating a managed type is not supported", + "markdown": "Creating a managed type is not supported" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstCreatingManagedType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDangling", + "shortDescription": { + "text": "dangling clang diagnostic" + }, + "fullDescription": { + "text": "-Wdangling clang diagnostic · Learn more", + "markdown": "-Wdangling clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdangling)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDangling", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticWeakVtables", + "shortDescription": { + "text": "weak-vtables clang diagnostic" + }, + "fullDescription": { + "text": "-Wweak-vtables clang diagnostic · Learn more", + "markdown": "-Wweak-vtables clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wweak-vtables)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticWeakVtables", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMissingNoreturn", + "shortDescription": { + "text": "missing-noreturn clang diagnostic" + }, + "fullDescription": { + "text": "-Wmissing-noreturn clang diagnostic · Learn more", + "markdown": "-Wmissing-noreturn clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-noreturn)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMissingNoreturn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppIfCanBeReplacedByConstexprIf", + "shortDescription": { + "text": "If statement with constant condition can be replaced with 'if constexpr'" + }, + "fullDescription": { + "text": "If statement with constant condition can be replaced with 'if constexpr'", + "markdown": "If statement with constant condition can be replaced with 'if constexpr'" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppIfCanBeReplacedByConstexprIf", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppUseNoexcept", + "shortDescription": { + "text": "hicpp-use-noexcept clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-use-noexcept clang-tidy check · Learn more", + "markdown": "hicpp-use-noexcept clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/use-noexcept.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppUseNoexcept", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0458", + "shortDescription": { + "text": "The result of the expression is always 'null' of nullable type" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0458)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0458", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnusedButSetParameter", + "shortDescription": { + "text": "unused-but-set-parameter clang diagnostic" + }, + "fullDescription": { + "text": "-Wunused-but-set-parameter clang diagnostic · Learn more", + "markdown": "-Wunused-but-set-parameter clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunused-but-set-parameter)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnusedButSetParameter", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDefaultCaseNotHandledInSwitchStatement", + "shortDescription": { + "text": "Default case is not handled in a switch statement" + }, + "fullDescription": { + "text": "Default case is not handled in a switch statement", + "markdown": "Default case is not handled in a switch statement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDefaultCaseNotHandledInSwitchStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShadowFieldInConstructorModified", + "shortDescription": { + "text": "shadow-field-in-constructor-modified clang diagnostic" + }, + "fullDescription": { + "text": "-Wshadow-field-in-constructor-modified clang diagnostic · Learn more", + "markdown": "-Wshadow-field-in-constructor-modified clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshadow-field-in-constructor-modified)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShadowFieldInConstructorModified", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotOverriddenInSpecificCulture", + "shortDescription": { + "text": "Resource is not overridden in specific culture" + }, + "fullDescription": { + "text": "Resource is not overridden in one or more specific cultures Learn more...", + "markdown": "Resource is not overridden in one or more specific cultures [Learn more...](https://www.jetbrains.com/help/rider/NotOverriddenInSpecificCulture.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NotOverriddenInSpecificCulture", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ResX/Potential Code Quality Issues", + "index": 68, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonReadonlyMemberInGetHashCode", + "shortDescription": { + "text": "Non-readonly type member referenced in 'GetHashCode()'" + }, + "fullDescription": { + "text": "Non-readonly field or auto-property referenced in 'GetHashCode()' Learn more...", + "markdown": "Non-readonly field or auto-property referenced in 'GetHashCode()' [Learn more...](https://www.jetbrains.com/help/rider/NonReadonlyMemberInGetHashCode.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NonReadonlyMemberInGetHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscConfusableIdentifiers", + "shortDescription": { + "text": "misc-confusable-identifiers clang-tidy check" + }, + "fullDescription": { + "text": "misc-confusable-identifiers clang-tidy check · Learn more", + "markdown": "misc-confusable-identifiers clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/confusable-identifiers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyMiscConfusableIdentifiers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNonportableSystemIncludePath", + "shortDescription": { + "text": "nonportable-system-include-path clang diagnostic" + }, + "fullDescription": { + "text": "-Wnonportable-system-include-path clang diagnostic · Learn more", + "markdown": "-Wnonportable-system-include-path clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnonportable-system-include-path)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNonportableSystemIncludePath", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertMsc30C", + "shortDescription": { + "text": "cert-msc30-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-msc30-c clang-tidy check · Learn more", + "markdown": "cert-msc30-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/msc30-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertMsc30C", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPragmaOnceOutsideHeader", + "shortDescription": { + "text": "pragma-once-outside-header clang diagnostic" + }, + "fullDescription": { + "text": "-Wpragma-once-outside-header clang diagnostic · Learn more", + "markdown": "-Wpragma-once-outside-header clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpragma-once-outside-header)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPragmaOnceOutsideHeader", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAtomicAlignment", + "shortDescription": { + "text": "atomic-alignment clang diagnostic" + }, + "fullDescription": { + "text": "-Watomic-alignment clang diagnostic · Learn more", + "markdown": "-Watomic-alignment clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#watomic-alignment)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAtomicAlignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedAnonymousMethodSignature", + "shortDescription": { + "text": "Anonymous method signature is not necessary" + }, + "fullDescription": { + "text": "Specifying signature in an anonymous method is not necessary because none of its parameters are used in the body", + "markdown": "Specifying signature in an anonymous method is not necessary because none of its parameters are used in the body" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedAnonymousMethodSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0469", + "shortDescription": { + "text": "'goto case' value is not implicitly convertible to required type" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/ms228370.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0469", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMissingExceptionSpec", + "shortDescription": { + "text": "missing-exception-spec clang diagnostic" + }, + "fullDescription": { + "text": "-Wmissing-exception-spec clang diagnostic · Learn more", + "markdown": "-Wmissing-exception-spec clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-exception-spec)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMissingExceptionSpec", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPoisonSystemDirectories", + "shortDescription": { + "text": "poison-system-directories clang diagnostic" + }, + "fullDescription": { + "text": "-Wpoison-system-directories clang diagnostic · Learn more", + "markdown": "-Wpoison-system-directories clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpoison-system-directories)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPoisonSystemDirectories", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0464", + "shortDescription": { + "text": "Comparing with null of nullable value type always produces 'false'" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0464)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0464", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0465", + "shortDescription": { + "text": "Introducing a 'Finalize' method can interfere with destructor invocation" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/02wtfwbt.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0465", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnusedLambdaCapture", + "shortDescription": { + "text": "unused-lambda-capture clang diagnostic" + }, + "fullDescription": { + "text": "-Wunused-lambda-capture clang diagnostic · Learn more", + "markdown": "-Wunused-lambda-capture clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunused-lambda-capture)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnusedLambdaCapture", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFormat", + "shortDescription": { + "text": "format clang diagnostic" + }, + "fullDescription": { + "text": "-Wformat clang diagnostic · Learn more", + "markdown": "-Wformat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wformat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIgnoredReferenceQualifiers", + "shortDescription": { + "text": "ignored-reference-qualifiers clang diagnostic" + }, + "fullDescription": { + "text": "-Wignored-reference-qualifiers clang diagnostic · Learn more", + "markdown": "-Wignored-reference-qualifiers clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wignored-reference-qualifiers)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIgnoredReferenceQualifiers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPreCpp2cCompatPedantic", + "shortDescription": { + "text": "pre-c++2c-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wpre-c++2c-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wpre-c++2c-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpre-c-2c-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPreCpp2cCompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.EmptyGridLengthDefinition", + "shortDescription": { + "text": "Grid length definition must not be empty" + }, + "fullDescription": { + "text": "Grid length definition must not be empty", + "markdown": "Grid length definition must not be empty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "Xaml.EmptyGridLengthDefinition", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Code Notification", + "index": 5, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBUseMethodAny.1", + "shortDescription": { + "text": "Use method Any()" + }, + "fullDescription": { + "text": "$seq$.Count() > 0", + "markdown": "$seq$.Count() \\> 0" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBUseMethodAny.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS7095", + "shortDescription": { + "text": "Filter expression is a constant, consider removing the filter" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS7095", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBUseMethodAny.2", + "shortDescription": { + "text": "Use method Any()" + }, + "fullDescription": { + "text": "$seq$.Count() >= 1", + "markdown": "$seq$.Count() \\>= 1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBUseMethodAny.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBUseMethodAny.3", + "shortDescription": { + "text": "Use method Any()" + }, + "fullDescription": { + "text": "$seq$.Count() = 0", + "markdown": "$seq$.Count() = 0" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBUseMethodAny.3", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBUseMethodAny.4", + "shortDescription": { + "text": "Use method Any()" + }, + "fullDescription": { + "text": "$seq$.Count() <= 0", + "markdown": "$seq$.Count() \\<= 0" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBUseMethodAny.4", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBUseMethodAny.5", + "shortDescription": { + "text": "Use method Any()" + }, + "fullDescription": { + "text": "$seq$.Count() < 1", + "markdown": "$seq$.Count() \\< 1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBUseMethodAny.5", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUsedButMarkedUnused", + "shortDescription": { + "text": "used-but-marked-unused clang diagnostic" + }, + "fullDescription": { + "text": "-Wused-but-marked-unused clang diagnostic · Learn more", + "markdown": "-Wused-but-marked-unused clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wused-but-marked-unused)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUsedButMarkedUnused", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticOverloadedShiftOpParentheses", + "shortDescription": { + "text": "overloaded-shift-op-parentheses clang diagnostic" + }, + "fullDescription": { + "text": "-Woverloaded-shift-op-parentheses clang diagnostic · Learn more", + "markdown": "-Woverloaded-shift-op-parentheses clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#woverloaded-shift-op-parentheses)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticOverloadedShiftOpParentheses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FSharpInterpolatedString", + "shortDescription": { + "text": "Format string can be replaced with an interpolated string" + }, + "fullDescription": { + "text": "Format string can be replaced with an interpolated string.", + "markdown": "Format string can be replaced with an interpolated string." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FSharpInterpolatedString", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "F#/Redundancies in Code", + "index": 73, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithFieldKeyword", + "shortDescription": { + "text": "Replace with 'field' keyword" + }, + "fullDescription": { + "text": "Replace explicit field declaration with a 'field' keyword usage in corresponding property declaration (anonymous field)", + "markdown": "Replace explicit field declaration with a 'field' keyword usage in corresponding property declaration (anonymous field)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithFieldKeyword", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeTypeModifiers", + "shortDescription": { + "text": "Use explicit or implicit modifier definition for types" + }, + "fullDescription": { + "text": "'internal' modifier can be safely added/removed from types without changing code semantics Learn more...", + "markdown": "'internal' modifier can be safely added/removed from types without changing code semantics [Learn more...](https://www.jetbrains.com/help/rider/ArrangeTypeModifiers.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrangeTypeModifiers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNonModularIncludeInFrameworkModule", + "shortDescription": { + "text": "non-modular-include-in-framework-module clang diagnostic" + }, + "fullDescription": { + "text": "-Wnon-modular-include-in-framework-module clang diagnostic · Learn more", + "markdown": "-Wnon-modular-include-in-framework-module clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnon-modular-include-in-framework-module)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNonModularIncludeInFrameworkModule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalFunctionHidesMethod", + "shortDescription": { + "text": "Local function hides method" + }, + "fullDescription": { + "text": "Local function has the same name as a method and hides it", + "markdown": "Local function has the same name as a method and hides it" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LocalFunctionHidesMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.LoadSceneAmbiguousSceneName", + "shortDescription": { + "text": "Short scene name is not unique" + }, + "fullDescription": { + "text": "There are several scenes with the same name in the Unity build settings. Only scene with smallest index will be used.", + "markdown": "There are several scenes with the same name in the Unity build settings. Only scene with smallest index will be used." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.LoadSceneAmbiguousSceneName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.LoadSceneDisabledSceneName", + "shortDescription": { + "text": "Scene is disabled in the build settings" + }, + "fullDescription": { + "text": "Scene is disabled in the Unity build settings, so it could not be loaded", + "markdown": "Scene is disabled in the Unity build settings, so it could not be loaded" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.LoadSceneDisabledSceneName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstStringFormatInvalidArgument", + "shortDescription": { + "text": "Burst: String.Format(format, ...) invalid argument type" + }, + "fullDescription": { + "text": "Burst: String.Format(format, ...) invalid argument type", + "markdown": "Burst: String.Format(format, ...) invalid argument type" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstStringFormatInvalidArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnTypeCanBeNotNullable", + "shortDescription": { + "text": "Return type of a function can be made non-nullable" + }, + "fullDescription": { + "text": "Function's return type is declared as nullable but it never returns nullable values", + "markdown": "Function's return type is declared as nullable but it never returns nullable values" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnTypeCanBeNotNullable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDefaultedFunctionDeleted", + "shortDescription": { + "text": "defaulted-function-deleted clang diagnostic" + }, + "fullDescription": { + "text": "-Wdefaulted-function-deleted clang diagnostic · Learn more", + "markdown": "-Wdefaulted-function-deleted clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdefaulted-function-deleted)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDefaultedFunctionDeleted", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingBodyTag", + "shortDescription": { + "text": "Important tags or attributes missing (missing )" + }, + "fullDescription": { + "text": "<([)html(]) $attr1$>$cont$", + "markdown": "\\<(\\[)html(\\]) $attr1$\\>$cont$" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MissingBodyTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Common Practices and Code Improvements", + "index": 74, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppOutParameterMustBeWritten", + "shortDescription": { + "text": "The 'out' parameter must be assigned" + }, + "fullDescription": { + "text": "In HLSL 'out' parameters must be assigned before exiting the function", + "markdown": "In HLSL 'out' parameters must be assigned before exiting the function" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppOutParameterMustBeWritten", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Compiler Warnings", + "index": 75, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.BindingWithContextNotResolved", + "shortDescription": { + "text": "Unresolved binding path when DataContext is known" + }, + "fullDescription": { + "text": "Unresolved binding path when DataContext for data binding is specified, but symbol cannot be found", + "markdown": "Unresolved binding path when DataContext for data binding is specified, but symbol cannot be found" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.BindingWithContextNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Code Notification", + "index": 5, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppWarningDirective", + "shortDescription": { + "text": "#warning directive" + }, + "fullDescription": { + "text": "#warning preprocessor directive", + "markdown": "#warning preprocessor directive" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppWarningDirective", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Compiler Warnings", + "index": 75, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticOutOfScopeFunction", + "shortDescription": { + "text": "out-of-scope-function clang diagnostic" + }, + "fullDescription": { + "text": "-Wout-of-scope-function clang diagnostic · Learn more", + "markdown": "-Wout-of-scope-function clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wout-of-scope-function)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticOutOfScopeFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeConstructorOrDestructorBody", + "shortDescription": { + "text": "Use preferred body style (convert into constructor or destructor with preferred body style)" + }, + "fullDescription": { + "text": "Use expression or block body Learn more...", + "markdown": "Use expression or block body [Learn more...](https://www.jetbrains.com/help/rider/ArrangeConstructorOrDestructorBody.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrangeConstructorOrDestructorBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Html.TagShouldNotBeSelfClosed", + "shortDescription": { + "text": "Wrong self-closed tag" + }, + "fullDescription": { + "text": "Wrong self-closed tag in HTML and related technologies", + "markdown": "Wrong self-closed tag in HTML and related technologies" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Html.TagShouldNotBeSelfClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Potential Code Quality Issues", + "index": 54, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticModuleConflict", + "shortDescription": { + "text": "module-conflict clang diagnostic" + }, + "fullDescription": { + "text": "-Wmodule-conflict clang diagnostic · Learn more", + "markdown": "-Wmodule-conflict clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmodule-conflict)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticModuleConflict", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExtendsListEntry", + "shortDescription": { + "text": "Redundant class or interface specification in base types list" + }, + "fullDescription": { + "text": "Type is either mentioned in the base types list of other part or it is an interface and appears as other type's base and contains no explicit implementations Learn more...", + "markdown": "Type is either mentioned in the base types list of other part or it is an interface and appears as other type's base and contains no explicit implementations [Learn more...](https://www.jetbrains.com/help/rider/RedundantExtendsListEntry.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "RedundantExtendsListEntry", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnValueOfPureMethodIsNotUsed", + "shortDescription": { + "text": "Return value of pure method is not used" + }, + "fullDescription": { + "text": "Return value of pure method is not used Learn more...", + "markdown": "Return value of pure method is not used [Learn more...](https://www.jetbrains.com/help/rider/ReturnValueOfPureMethodIsNotUsed.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnValueOfPureMethodIsNotUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFormatOverflowNonKprintf", + "shortDescription": { + "text": "format-overflow-non-kprintf clang diagnostic" + }, + "fullDescription": { + "text": "-Wformat-overflow-non-kprintf clang diagnostic · Learn more", + "markdown": "-Wformat-overflow-non-kprintf clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wformat-overflow-non-kprintf)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFormatOverflowNonKprintf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticConfigMacros", + "shortDescription": { + "text": "config-macros clang diagnostic" + }, + "fullDescription": { + "text": "-Wconfig-macros clang diagnostic · Learn more", + "markdown": "-Wconfig-macros clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wconfig-macros)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticConfigMacros", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDocumentationUnknownCommand", + "shortDescription": { + "text": "documentation-unknown-command clang diagnostic" + }, + "fullDescription": { + "text": "-Wdocumentation-unknown-command clang diagnostic · Learn more", + "markdown": "-Wdocumentation-unknown-command clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdocumentation-unknown-command)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDocumentationUnknownCommand", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyStatement", + "shortDescription": { + "text": "Empty statement is redundant" + }, + "fullDescription": { + "text": "Empty statement is redundant Learn more...", + "markdown": "Empty statement is redundant [Learn more...](https://www.jetbrains.com/help/rider/EmptyStatement.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "EmptyStatement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotAccessedPositionalProperty.Local", + "shortDescription": { + "text": "Non-accessed positional property (private accessibility)" + }, + "fullDescription": { + "text": "Positional property is never accessed for reading Learn more...", + "markdown": "Positional property is never accessed for reading [Learn more...](https://www.jetbrains.com/help/rider/NotAccessedPositionalProperty.Local.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NotAccessedPositionalProperty.Local", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAliasTemplateInDeclarationName", + "shortDescription": { + "text": "alias-template-in-declaration-name clang diagnostic" + }, + "fullDescription": { + "text": "-Walias-template-in-declaration-name clang diagnostic · Learn more", + "markdown": "-Walias-template-in-declaration-name clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#walias-template-in-declaration-name)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAliasTemplateInDeclarationName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.IncorrectMethodSignatureInStringLiteral", + "shortDescription": { + "text": "Method referenced in string literal does not have the expected signature" + }, + "fullDescription": { + "text": "Method referenced in string literal does not have the expected signature.", + "markdown": "Method referenced in string literal does not have the expected signature." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.IncorrectMethodSignatureInStringLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.RedundantFreezeAttribute", + "shortDescription": { + "text": "Redundant 'Freeze' attribute" + }, + "fullDescription": { + "text": "Freeze attribute is not used and can be safely removed", + "markdown": "Freeze attribute is not used and can be safely removed" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.RedundantFreezeAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Redundancies in Code", + "index": 77, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnassignedGetOnlyAutoProperty", + "shortDescription": { + "text": "Get-only auto-property is never assigned" + }, + "fullDescription": { + "text": "Auto-property without setter has no initializer or is never assigned in constructor Learn more...", + "markdown": "Auto-property without setter has no initializer or is never assigned in constructor [Learn more...](https://www.jetbrains.com/help/rider/UnassignedGetOnlyAutoProperty.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnassignedGetOnlyAutoProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1007", + "shortDescription": { + "text": "RoslynAnalyzers Add braces" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1007", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringSpanComparison", + "shortDescription": { + "text": "Possibly wrong string comparison: spans are only equal when pointing to the same memory location" + }, + "fullDescription": { + "text": "Possibly wrong string comparison: spans are only equal when pointing to the same memory location. Spans from freshly created or static strings are unlikely to be equal to other spans, probably you want to compare chars/bytes instead. Learn more...", + "markdown": "Possibly wrong string comparison: spans are only equal when pointing to the same memory location. Spans from freshly created or static strings are unlikely to be equal to other spans, probably you want to compare chars/bytes instead. [Learn more...](https://www.jetbrains.com/help/rider/StringSpanComparison.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringSpanComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1008", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Use explicit type instead of 'var' (when the type is not obvious)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1008", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1009", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Use explicit type instead of 'var' (foreach variable)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1009", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUE4BlueprintCallableFunctionMayBeStatic", + "shortDescription": { + "text": "BlueprintCallable function can be made static" + }, + "fullDescription": { + "text": "BlueprintCallable function can be made static", + "markdown": "BlueprintCallable function can be made static" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppUE4BlueprintCallableFunctionMayBeStatic", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1003", + "shortDescription": { + "text": "RoslynAnalyzers Add braces to if-else (when expression spans over multiple lines)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RCS1003", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1004", + "shortDescription": { + "text": "RoslynAnalyzers Remove braces from if-else" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1004", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1005", + "shortDescription": { + "text": "RoslynAnalyzers Simplify nested using statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1005", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneUnhandledSelfAssignment", + "shortDescription": { + "text": "bugprone-unhandled-self-assignment clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-unhandled-self-assignment clang-tidy check · Learn more", + "markdown": "bugprone-unhandled-self-assignment clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneUnhandledSelfAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1006", + "shortDescription": { + "text": "RoslynAnalyzers Merge 'else' with nested 'if'" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1006", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSuspiciousMemoryComparison", + "shortDescription": { + "text": "bugprone-suspicious-memory-comparison clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-suspicious-memory-comparison clang-tidy check · Learn more", + "markdown": "bugprone-suspicious-memory-comparison clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSuspiciousMemoryComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1001", + "shortDescription": { + "text": "RoslynAnalyzers Add braces (when expression spans over multiple lines)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RCS1001", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1002", + "shortDescription": { + "text": "RoslynAnalyzers Remove braces" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1002", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignNullToNotNullAttribute", + "shortDescription": { + "text": "Possible 'null' assignment to non-nullable entity" + }, + "fullDescription": { + "text": "An expression that can have 'null' value is assigned to an entity marked with 'Value cannot be null' attribute. In particular, this can happen when passing such value to a method whose parameter is marked with 'Value cannot be null' attribute. Learn more...", + "markdown": "An expression that can have 'null' value is assigned to an entity marked with 'Value cannot be null' attribute. In particular, this can happen when passing such value to a method whose parameter is marked with 'Value cannot be null' attribute. [Learn more...](https://www.jetbrains.com/help/rider/AssignNullToNotNullAttribute.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AssignNullToNotNullAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Constraints Violations", + "index": 80, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseStdPrint", + "shortDescription": { + "text": "modernize-use-std-print clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-std-print clang-tidy check · Learn more", + "markdown": "modernize-use-std-print clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-std-print.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseStdPrint", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneIncorrectEnableIf", + "shortDescription": { + "text": "bugprone-incorrect-enable-if clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-incorrect-enable-if clang-tidy check · Learn more", + "markdown": "bugprone-incorrect-enable-if clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/incorrect-enable-if.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneIncorrectEnableIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDeclarationSpecifierWithoutDeclarators", + "shortDescription": { + "text": "Declaration specifier with no declarators" + }, + "fullDescription": { + "text": "A declaration specifier is ignored when there are no declarators", + "markdown": "A declaration specifier is ignored when there are no declarators" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDeclarationSpecifierWithoutDeclarators", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDuplicateMethodArg", + "shortDescription": { + "text": "duplicate-method-arg clang diagnostic" + }, + "fullDescription": { + "text": "-Wduplicate-method-arg clang diagnostic · Learn more", + "markdown": "-Wduplicate-method-arg clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wduplicate-method-arg)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDuplicateMethodArg", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WebConfig.ModuleQualificationResolve", + "shortDescription": { + "text": "Module qualification required" + }, + "fullDescription": { + "text": "Module qualification required for type resolution", + "markdown": "Module qualification required for type resolution" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WebConfig.ModuleQualificationResolve", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Web.Config/Potential Code Quality Issues", + "index": 82, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesNonPrivateMemberVariablesInClasses", + "shortDescription": { + "text": "cppcoreguidelines-non-private-member-variables-in-classes clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-non-private-member-variables-in-classes clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-non-private-member-variables-in-classes clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/non-private-member-variables-in-classes.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesNonPrivateMemberVariablesInClasses", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxCocoaSelfInit", + "shortDescription": { + "text": "osx.cocoa.SelfInit clang static analyzer check" + }, + "fullDescription": { + "text": "osx.cocoa.SelfInit clang static analyzer check · Learn more", + "markdown": "osx.cocoa.SelfInit clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxCocoaSelfInit", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntroduceOptionalParameters.Global", + "shortDescription": { + "text": "Introduce optional parameters (non-private accessibility)" + }, + "fullDescription": { + "text": "Introduce optional parameters to overload method Learn more...", + "markdown": "Introduce optional parameters to overload method [Learn more...](https://www.jetbrains.com/help/rider/IntroduceOptionalParameters.Global.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IntroduceOptionalParameters.Global", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesNoexceptSwap", + "shortDescription": { + "text": "cppcoreguidelines-noexcept-swap clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-noexcept-swap clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-noexcept-swap clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/noexcept-swap.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesNoexceptSwap", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DoubleNegationOperator", + "shortDescription": { + "text": "Double negation operator" + }, + "fullDescription": { + "text": "Double negation is meaningless bool b = !!condition; Learn more...", + "markdown": "Double negation is meaningless\n\n```\nbool b = !!condition;\n```\n\n[Learn more...](https://www.jetbrains.com/help/rider/DoubleNegationOperator.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "DoubleNegationOperator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleBuildNamespaces", + "shortDescription": { + "text": "google-build-namespaces clang-tidy check" + }, + "fullDescription": { + "text": "google-build-namespaces clang-tidy check · Learn more", + "markdown": "google-build-namespaces clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/build-namespaces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleBuildNamespaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneForwardingReferenceOverload", + "shortDescription": { + "text": "bugprone-forwarding-reference-overload clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-forwarding-reference-overload clang-tidy check · Learn more", + "markdown": "bugprone-forwarding-reference-overload clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/forwarding-reference-overload.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneForwardingReferenceOverload", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseNullptr", + "shortDescription": { + "text": "modernize-use-nullptr clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-nullptr clang-tidy check · Learn more", + "markdown": "modernize-use-nullptr clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-nullptr.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseNullptr", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1031", + "shortDescription": { + "text": "RoslynAnalyzers Remove unnecessary braces in switch section" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1031", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSingleCallToSingle", + "shortDescription": { + "text": "Replace with single call to Single(..)" + }, + "fullDescription": { + "text": "$seq$.Where($x$ => $expr$).Single()", + "markdown": "$seq$.Where($x$ =\\> $expr$).Single()" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSingleCallToSingle", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizePassByValue", + "shortDescription": { + "text": "modernize-pass-by-value clang-tidy check" + }, + "fullDescription": { + "text": "modernize-pass-by-value clang-tidy check · Learn more", + "markdown": "modernize-pass-by-value clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/pass-by-value.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizePassByValue", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticRegister", + "shortDescription": { + "text": "register clang diagnostic" + }, + "fullDescription": { + "text": "-Wregister clang diagnostic · Learn more", + "markdown": "-Wregister clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wregister)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticRegister", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS0472", + "shortDescription": { + "text": "The result of the expression is always 'true' or 'false' since a value of value type is never equal to 'null'" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0472)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS0472", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstFunctionSignatureContainsManagedTypes", + "shortDescription": { + "text": "Function signature cannot contain managed types" + }, + "fullDescription": { + "text": "Function signature cannot contain managed types", + "markdown": "Function signature cannot contain managed types" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstFunctionSignatureContainsManagedTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuConditionalOmittedOperand", + "shortDescription": { + "text": "gnu-conditional-omitted-operand clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-conditional-omitted-operand clang diagnostic · Learn more", + "markdown": "-Wgnu-conditional-omitted-operand clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-conditional-omitted-operand)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuConditionalOmittedOperand", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticClassVarargs", + "shortDescription": { + "text": "class-varargs clang diagnostic" + }, + "fullDescription": { + "text": "-Wclass-varargs clang diagnostic · Learn more", + "markdown": "-Wclass-varargs clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wclass-varargs)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticClassVarargs", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1021", + "shortDescription": { + "text": "RoslynAnalyzers Convert lambda expression body to expression body" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1021", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1020", + "shortDescription": { + "text": "RoslynAnalyzers Simplify Nullable to T?" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1020", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCastFunctionType", + "shortDescription": { + "text": "cast-function-type clang diagnostic" + }, + "fullDescription": { + "text": "-Wcast-function-type clang diagnostic · Learn more", + "markdown": "-Wcast-function-type clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wcast-function-type)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCastFunctionType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppWrongIndentSize", + "shortDescription": { + "text": "Incorrect indent (incorrect indent size)" + }, + "fullDescription": { + "text": "Incorrect indent size", + "markdown": "Incorrect indent size" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppWrongIndentSize", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeRedundantParentheses", + "shortDescription": { + "text": "Remove redundant parentheses" + }, + "fullDescription": { + "text": "Parentheses can be safely removed from expressions without changing code semantics Learn more...", + "markdown": "Parentheses can be safely removed from expressions without changing code semantics [Learn more...](https://www.jetbrains.com/help/rider/ArrangeRedundantParentheses.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeRedundantParentheses", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.ResourceFilePathCaseMismatch", + "shortDescription": { + "text": "Path to resource is case-sensitive" + }, + "fullDescription": { + "text": "Path to resource is case-sensitive", + "markdown": "Path to resource is case-sensitive" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.ResourceFilePathCaseMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Code Notification", + "index": 5, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithLastOrDefault.2", + "shortDescription": { + "text": "Replace with LastOrDefault($args$)" + }, + "fullDescription": { + "text": "$expr$ && $seq$.Any($args$) ? $seq$.Last($args$) : null", + "markdown": "$expr$ \\&\\& $seq$.Any($args$) ? $seq$.Last($args$) : null" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithLastOrDefault.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithLastOrDefault.3", + "shortDescription": { + "text": "Replace with LastOrDefault($args$)" + }, + "fullDescription": { + "text": "$seq$.Any($args$) ? $seq$.Last($args$) : default($T$)", + "markdown": "$seq$.Any($args$) ? $seq$.Last($args$) : default($T$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithLastOrDefault.3", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PossibleInvalidCastExceptionInForeachLoop", + "shortDescription": { + "text": "Possible 'System.InvalidCastException' in foreach loop" + }, + "fullDescription": { + "text": "Possible cast expression of incompatible type Learn more...", + "markdown": "Possible cast expression of incompatible type [Learn more...](https://www.jetbrains.com/help/rider/PossibleInvalidCastExceptionInForeachLoop.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PossibleInvalidCastExceptionInForeachLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMissingPrototypes", + "shortDescription": { + "text": "missing-prototypes clang diagnostic" + }, + "fullDescription": { + "text": "-Wmissing-prototypes clang diagnostic · Learn more", + "markdown": "-Wmissing-prototypes clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-prototypes)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMissingPrototypes", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithLastOrDefault.1", + "shortDescription": { + "text": "Replace with LastOrDefault($args$)" + }, + "fullDescription": { + "text": "$seq$.Any($args$) ? $seq$.Last($args$) : null", + "markdown": "$seq$.Any($args$) ? $seq$.Last($args$) : null" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithLastOrDefault.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1018", + "shortDescription": { + "text": "RoslynAnalyzers Add/remove accessibility modifiers" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1018", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PossiblyImpureMethodCallOnReadonlyVariable", + "shortDescription": { + "text": "Possibly impure struct method is called on readonly variable: struct value always copied before invocation" + }, + "fullDescription": { + "text": "Possibly impure struct instance method or 'this ref' extension method is called on readonly field/in parameter/ref readonly return: struct value always copied before invocation Learn more...", + "markdown": "Possibly impure struct instance method or 'this ref' extension method is called on readonly field/in parameter/ref readonly return: struct value always copied before invocation [Learn more...](https://www.jetbrains.com/help/rider/PossiblyImpureMethodCallOnReadonlyVariable.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PossiblyImpureMethodCallOnReadonlyVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1019", + "shortDescription": { + "text": "RoslynAnalyzers Order modifiers" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1019", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAndroidCloexecPipe2", + "shortDescription": { + "text": "android-cloexec-pipe2 clang-tidy check" + }, + "fullDescription": { + "text": "android-cloexec-pipe2 clang-tidy check · Learn more", + "markdown": "android-cloexec-pipe2 clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/android/cloexec-pipe2.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAndroidCloexecPipe2", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithLastOrDefault.4", + "shortDescription": { + "text": "Replace with LastOrDefault($args$)" + }, + "fullDescription": { + "text": "$expr$ && $seq$.Any($args$) ? $seq$.Last($args$) : default($T$)", + "markdown": "$expr$ \\&\\& $seq$.Any($args$) ? $seq$.Last($args$) : default($T$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithLastOrDefault.4", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1014", + "shortDescription": { + "text": "RoslynAnalyzers Use explicitly/implicitly typed array" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1014", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1015", + "shortDescription": { + "text": "RoslynAnalyzers Use nameof operator" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1015", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1016", + "shortDescription": { + "text": "RoslynAnalyzers Use block body or expression body" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1016", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUE4CodingStandardUClassNamingViolationError", + "shortDescription": { + "text": "Inconsistent Unreal Engine UCLASS Naming" + }, + "fullDescription": { + "text": "Class is declared with UCLASS or USTRUCT macro but its name doesn't match the Unreal Engine's coding standard naming style; this will lead to a build error. This inspection includes three rules: classes inherited from AActor must be prefixed by 'A', classes inherited from UObject must be prefixed by 'U', and USTRUCTS must be prefixed by 'F'.", + "markdown": "Class is declared with UCLASS or USTRUCT macro but its name doesn't match the Unreal Engine's coding standard naming style; this will lead to a build error. This inspection includes three rules: classes inherited from AActor must be prefixed by 'A', classes inherited from UObject must be prefixed by 'U', and USTRUCTS must be prefixed by 'F'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CppUE4CodingStandardUClassNamingViolationError", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftTemplate", + "shortDescription": { + "text": "microsoft-template clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-template clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-template clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-template)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftTemplate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstTryNotSupported", + "shortDescription": { + "text": "Try statement is not supported" + }, + "fullDescription": { + "text": "Try statement is not supported", + "markdown": "Try statement is not supported" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstTryNotSupported", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1010", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Use 'var' instead of explicit type (when the type is obvious)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1010", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantEnumCaseLabelForDefaultSection", + "shortDescription": { + "text": "Redundant 'case' label before default section" + }, + "fullDescription": { + "text": "'case' label statement with enum value in front of default section is redundant", + "markdown": "'case' label statement with enum value in front of default section is redundant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantEnumCaseLabelForDefaultSection", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1012", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Use explicit type instead of 'var' (when the type is obvious)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1012", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1013", + "shortDescription": { + "text": "RoslynAnalyzers Use predefined type" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1013", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadParensLineBreaks", + "shortDescription": { + "text": "Incorrect line breaks (around parenthesis)" + }, + "fullDescription": { + "text": "Around parenthesis", + "markdown": "Around parenthesis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadParensLineBreaks", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPerformanceTypePromotionInMathFn", + "shortDescription": { + "text": "performance-type-promotion-in-math-fn clang-tidy check" + }, + "fullDescription": { + "text": "performance-type-promotion-in-math-fn clang-tidy check · Learn more", + "markdown": "performance-type-promotion-in-math-fn clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance/type-promotion-in-math-fn.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyPerformanceTypePromotionInMathFn", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnsequenced", + "shortDescription": { + "text": "unsequenced clang diagnostic" + }, + "fullDescription": { + "text": "-Wunsequenced clang diagnostic · Learn more", + "markdown": "-Wunsequenced clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunsequenced)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnsequenced", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDuplicateDeclSpecifier", + "shortDescription": { + "text": "duplicate-decl-specifier clang diagnostic" + }, + "fullDescription": { + "text": "-Wduplicate-decl-specifier clang diagnostic · Learn more", + "markdown": "-Wduplicate-decl-specifier clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wduplicate-decl-specifier)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDuplicateDeclSpecifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadSymbolSpaces", + "shortDescription": { + "text": "Incorrect spacing (around operator symbols)" + }, + "fullDescription": { + "text": "Around operator symbols", + "markdown": "Around operator symbols" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadSymbolSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesExplicitVirtualFunctions", + "shortDescription": { + "text": "cppcoreguidelines-explicit-virtual-functions clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-explicit-virtual-functions clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-explicit-virtual-functions clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/explicit-virtual-functions.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesExplicitVirtualFunctions", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ROS0003", + "shortDescription": { + "text": "RoslynAnalyzers Analyzer requires config option to be specified" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ROS0003", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ROS0002", + "shortDescription": { + "text": "RoslynAnalyzers Analyzer option is obsolete" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ROS0002", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithOfType.Any.2", + "shortDescription": { + "text": "Replace with OfType().Any() (replace with OfType().Any(..))" + }, + "fullDescription": { + "text": "$seq$.Select($x$ => $x$ as $T$).Any($y$ => $y$ != null && $expr$)", + "markdown": "$seq$.Select($x$ =\\> $x$ as $T$).Any($y$ =\\> $y$ != null \\&\\& $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithOfType.Any.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VulnerableApi", + "shortDescription": { + "text": "Vulnerable API usage" + }, + "fullDescription": { + "text": "Reports usages of Vulnerable APIs in imported dependencies Learn more...", + "markdown": "Reports usages of Vulnerable APIs in imported dependencies [Learn more...](https://www.jetbrains.com/help/rider/VulnerableApi.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "VulnerableApi", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Security", + "index": 87, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithOfType.Any.1", + "shortDescription": { + "text": "Replace with OfType().Any()" + }, + "fullDescription": { + "text": "$seq$.Select($x$ => $x$ as $T$).Any($y$ => $y$ != null)", + "markdown": "$seq$.Select($x$ =\\> $x$ as $T$).Any($y$ =\\> $y$ != null)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithOfType.Any.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PossibleInvalidOperationException", + "shortDescription": { + "text": "Possible 'System.InvalidOperationException'" + }, + "fullDescription": { + "text": "Possible call to method is invalid for the object's current state Learn more...", + "markdown": "Possible call to method is invalid for the object's current state [Learn more...](https://www.jetbrains.com/help/rider/PossibleInvalidOperationException.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PossibleInvalidOperationException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp11NarrowingConstReference", + "shortDescription": { + "text": "c++11-narrowing-const-reference clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++11-narrowing-const-reference clang diagnostic · Learn more", + "markdown": "-Wc++11-narrowing-const-reference clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-11-narrowing-const-reference)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp11NarrowingConstReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIndependentClassAttribute", + "shortDescription": { + "text": "IndependentClass-attribute clang diagnostic" + }, + "fullDescription": { + "text": "-WIndependentClass-attribute clang diagnostic · Learn more", + "markdown": "-WIndependentClass-attribute clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wIndependentClass-attribute)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIndependentClassAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedOfast", + "shortDescription": { + "text": "deprecated-ofast clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-ofast clang diagnostic · Learn more", + "markdown": "-Wdeprecated-ofast clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-ofast)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedOfast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticSignedEnumBitfield", + "shortDescription": { + "text": "signed-enum-bitfield clang diagnostic" + }, + "fullDescription": { + "text": "-Wsigned-enum-bitfield clang diagnostic · Learn more", + "markdown": "-Wsigned-enum-bitfield clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wsigned-enum-bitfield)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticSignedEnumBitfield", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeVarKeywordsInDeconstructingDeclaration", + "shortDescription": { + "text": "Join or separate 'var' in deconstruction declarations" + }, + "fullDescription": { + "text": "Use preferred code style to check joined/separate 'var' usages in deconstruction declarations Learn more...", + "markdown": "Use preferred code style to check joined/separate 'var' usages in deconstruction declarations [Learn more...](https://www.jetbrains.com/help/rider/ArrangeVarKeywordsInDeconstructingDeclaration.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeVarKeywordsInDeconstructingDeclaration", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerApiModelingTrustReturnsNonnull", + "shortDescription": { + "text": "apiModeling.TrustReturnsNonnull clang static analyzer check" + }, + "fullDescription": { + "text": "apiModeling.TrustReturnsNonnull clang static analyzer check · Learn more", + "markdown": "apiModeling.TrustReturnsNonnull clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerApiModelingTrustReturnsNonnull", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.InstantiateWithoutParent", + "shortDescription": { + "text": "Setting 'parent' property immediately after object instantiation is inefficient" + }, + "fullDescription": { + "text": "Instantiating a Unity object and setting the 'parent' property as separate operations is inefficient, as the transform hierarchy is created and immediately replaced. Combine setting the 'parent' property with the call to instantiate the object. Learn more...", + "markdown": "Instantiating a Unity object and setting the 'parent' property as separate operations is inefficient, as the transform hierarchy is created and immediately replaced. Combine setting the 'parent' property with the call to instantiate the object. [Learn more...](https://github.com/JetBrains/resharper-unity/wiki/Avoid-using-Object.Instantiate-without-“Transform-Parent”-parameter-and-using-SetParent-later)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.InstantiateWithoutParent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShiftSignOverflow", + "shortDescription": { + "text": "shift-sign-overflow clang diagnostic" + }, + "fullDescription": { + "text": "-Wshift-sign-overflow clang diagnostic · Learn more", + "markdown": "-Wshift-sign-overflow clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshift-sign-overflow)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShiftSignOverflow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShadowFieldInConstructor", + "shortDescription": { + "text": "shadow-field-in-constructor clang diagnostic" + }, + "fullDescription": { + "text": "-Wshadow-field-in-constructor clang diagnostic · Learn more", + "markdown": "-Wshadow-field-in-constructor clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshadow-field-in-constructor)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShadowFieldInConstructor", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseObjectOrCollectionInitializer", + "shortDescription": { + "text": "Use object or collection initializer when possible" + }, + "fullDescription": { + "text": "Suggest to replace object sequential assignments to newly created object fields by object initializer Learn more...", + "markdown": "Suggest to replace object sequential assignments to newly created object fields by object initializer [Learn more...](https://www.jetbrains.com/help/rider/UseObjectOrCollectionInitializer.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "UseObjectOrCollectionInitializer", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MemberCanBePrivate.Global", + "shortDescription": { + "text": "Member can be made private (non-private accessibility)" + }, + "fullDescription": { + "text": "Member can be made private Learn more...", + "markdown": "Member can be made private [Learn more...](https://www.jetbrains.com/help/rider/MemberCanBePrivate.Global.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MemberCanBePrivate.Global", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDiscardedPostfixOperatorResult", + "shortDescription": { + "text": "Result of a postfix operator is discarded" + }, + "fullDescription": { + "text": "Result of a postfix operator is discarded. It might be more efficient to use a prefix form of the operator.", + "markdown": "Result of a postfix operator is discarded. It might be more efficient to use a prefix form of the operator." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppDiscardedPostfixOperatorResult", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertInt09C", + "shortDescription": { + "text": "cert-int09-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-int09-c clang-tidy check · Learn more", + "markdown": "cert-int09-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/int09-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertInt09C", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseCollectionCountProperty", + "shortDescription": { + "text": "Use collection's count property" + }, + "fullDescription": { + "text": "Usage of 'Enumerable.Count()' method can be replaced with direct collection count property access Learn more...", + "markdown": "Usage of 'Enumerable.Count()' method can be replaced with direct collection count property access [Learn more...](https://www.jetbrains.com/help/rider/UseCollectionCountProperty.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "UseCollectionCountProperty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPragmaPack", + "shortDescription": { + "text": "pragma-pack clang diagnostic" + }, + "fullDescription": { + "text": "-Wpragma-pack clang diagnostic · Learn more", + "markdown": "-Wpragma-pack clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpragma-pack)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPragmaPack", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleReadabilityTodo", + "shortDescription": { + "text": "google-readability-todo clang-tidy check" + }, + "fullDescription": { + "text": "google-readability-todo clang-tidy check · Learn more", + "markdown": "google-readability-todo clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/readability-todo.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleReadabilityTodo", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedType", + "shortDescription": { + "text": "deprecated-type clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-type clang diagnostic · Learn more", + "markdown": "-Wdeprecated-type clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-type)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppEmptyDeclaration", + "shortDescription": { + "text": "Declaration does not declare anything" + }, + "fullDescription": { + "text": "A declaration does not declare anything", + "markdown": "A declaration does not declare anything" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppEmptyDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStrictPrimaryTemplateShadow", + "shortDescription": { + "text": "strict-primary-template-shadow clang diagnostic" + }, + "fullDescription": { + "text": "-Wstrict-primary-template-shadow clang diagnostic · Learn more", + "markdown": "-Wstrict-primary-template-shadow clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstrict-primary-template-shadow)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStrictPrimaryTemplateShadow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppIncompatiblePointerConversion", + "shortDescription": { + "text": "Implicit conversion to incompatible pointer type" + }, + "fullDescription": { + "text": "Implicit conversion to incompatible pointer type", + "markdown": "Implicit conversion to incompatible pointer type" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppIncompatiblePointerConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCoreUninitializedCapturedBlockVariable", + "shortDescription": { + "text": "core.uninitialized.CapturedBlockVariable clang static analyzer check" + }, + "fullDescription": { + "text": "core.uninitialized.CapturedBlockVariable clang static analyzer check · Learn more", + "markdown": "core.uninitialized.CapturedBlockVariable clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCoreUninitializedCapturedBlockVariable", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscIncludeCleaner", + "shortDescription": { + "text": "misc-include-cleaner clang-tidy check" + }, + "fullDescription": { + "text": "misc-include-cleaner clang-tidy check · Learn more", + "markdown": "misc-include-cleaner clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/include-cleaner.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyMiscIncludeCleaner", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityAvoidNestedConditionalOperator", + "shortDescription": { + "text": "readability-avoid-nested-conditional-operator clang-tidy check" + }, + "fullDescription": { + "text": "readability-avoid-nested-conditional-operator clang-tidy check · Learn more", + "markdown": "readability-avoid-nested-conditional-operator clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/avoid-nested-conditional-operator.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityAvoidNestedConditionalOperator", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStringConversion", + "shortDescription": { + "text": "string-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wstring-conversion clang diagnostic · Learn more", + "markdown": "-Wstring-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstring-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStringConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerUnixStream", + "shortDescription": { + "text": "unix.Stream clang static analyzer check" + }, + "fullDescription": { + "text": "unix.Stream clang static analyzer check · Learn more", + "markdown": "unix.Stream clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerUnixStream", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotNullOrRequiredMemberIsNotInitialized", + "shortDescription": { + "text": "Non-nullable or required member is not initialized at constructor exit" + }, + "fullDescription": { + "text": "Non-nullable or required type member is not initialized in any execution path of the constructor Learn more...", + "markdown": "Non-nullable or required type member is not initialized in any execution path of the constructor [Learn more...](https://www.jetbrains.com/help/rider/NotNullOrRequiredMemberIsNotInitialized.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NotNullOrRequiredMemberIsNotInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Constraints Violations", + "index": 80, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseUnsignedRightShiftOperator", + "shortDescription": { + "text": "Use unsigned right shift operator '>>>'" + }, + "fullDescription": { + "text": "Use unsigned right shift operator '>>>' instead of manual casting and shifting Learn more...", + "markdown": "Use unsigned right shift operator '\\>\\>\\>' instead of manual casting and shifting [Learn more...](https://www.jetbrains.com/help/rider/UseUnsignedRightShiftOperator.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseUnsignedRightShiftOperator", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedDeclarations", + "shortDescription": { + "text": "deprecated-declarations clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-declarations clang diagnostic · Learn more", + "markdown": "-Wdeprecated-declarations clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-declarations)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedDeclarations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnreachableCodeLoopIncrement", + "shortDescription": { + "text": "unreachable-code-loop-increment clang diagnostic" + }, + "fullDescription": { + "text": "-Wunreachable-code-loop-increment clang diagnostic · Learn more", + "markdown": "-Wunreachable-code-loop-increment clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunreachable-code-loop-increment)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnreachableCodeLoopIncrement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithOfType.Last.1", + "shortDescription": { + "text": "Replace with OfType().Last() (replace with OfType(Of ..)().Last())" + }, + "fullDescription": { + "text": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Last(Function ($y$) $y$ IsNot Nothing)", + "markdown": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Last(Function ($y$) $y$ IsNot Nothing)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithOfType.Last.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OneWayOperationContractWithReturnType", + "shortDescription": { + "text": "One way operations must not return values" + }, + "fullDescription": { + "text": "Methods marked with OperationContract attribute as OneWay operations must not return values Learn more...", + "markdown": "Methods marked with OperationContract attribute as OneWay operations must not return values [Learn more...](https://www.jetbrains.com/help/rider/OneWayOperationContractWithReturnType.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OneWayOperationContractWithReturnType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithOfType.Last.2", + "shortDescription": { + "text": "Replace with OfType().Last() (replace with OfType(Of ..)().Last(..))" + }, + "fullDescription": { + "text": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Last(Function ($y$) $y$ IsNot Nothing AndAlso $expr$)", + "markdown": "$seq$.Select(Function ($x$) TryCast($x$, $T$)).Last(Function ($y$) $y$ IsNot Nothing AndAlso $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithOfType.Last.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnnotateCanBeNullTypeMember", + "shortDescription": { + "text": "Declaration nullability inferred (type member is inferred to be nullable)" + }, + "fullDescription": { + "text": "Type member is inferred to be nullable: consider annotating it with [CanBeNull] or [ItemCanBeNull] attribute", + "markdown": "Type member is inferred to be nullable: consider annotating it with \\[CanBeNull\\] or \\[ItemCanBeNull\\] attribute" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AnnotateCanBeNullTypeMember", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseThrowIfNullMethod", + "shortDescription": { + "text": "Use 'ArgumentNullException.ThrowIfNull'" + }, + "fullDescription": { + "text": "Replace throwing of 'ArgumentNullException' object with an invocation of the helper method", + "markdown": "Replace throwing of 'ArgumentNullException' object with an invocation of the helper method" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseThrowIfNullMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToAutoPropertyWhenPossible", + "shortDescription": { + "text": "Convert property into auto-property (when possible)" + }, + "fullDescription": { + "text": "Converts property declaration into C# auto-property syntax", + "markdown": "Converts property declaration into C# auto-property syntax" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToAutoPropertyWhenPossible", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1094", + "shortDescription": { + "text": "RoslynAnalyzers Declare using directive on top level" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1094", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyStringInterpolation", + "shortDescription": { + "text": "Use format specifier in interpolated strings" + }, + "fullDescription": { + "text": "'.ToString()' call could be replaced with a format specifier Learn more...", + "markdown": "'.ToString()' call could be replaced with a format specifier [Learn more...](https://www.jetbrains.com/help/rider/SimplifyStringInterpolation.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyStringInterpolation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1096", + "shortDescription": { + "text": "RoslynAnalyzers Use 'HasFlag' method or bitwise operator" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1096", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1097", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant 'ToString' call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1097", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1090", + "shortDescription": { + "text": "RoslynAnalyzers Add/remove 'ConfigureAwait(false)' call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1090", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1091", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty region" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1091", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1093", + "shortDescription": { + "text": "RoslynAnalyzers File contains no code" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1093", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MoveVariableDeclarationInsideLoopCondition", + "shortDescription": { + "text": "Move variable declaration inside loop condition" + }, + "fullDescription": { + "text": "Declare variable inside a loop condition using pattern matching syntax to reduce its scope and avoid doing a C-style assignment as a side effect", + "markdown": "Declare variable inside a loop condition using pattern matching syntax to reduce its scope and avoid doing a C-style assignment as a side effect" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MoveVariableDeclarationInsideLoopCondition", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuIncludeNext", + "shortDescription": { + "text": "gnu-include-next clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-include-next clang diagnostic · Learn more", + "markdown": "-Wgnu-include-next clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-include-next)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuIncludeNext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReferenceEqualsWithValueType", + "shortDescription": { + "text": "'Object.ReferenceEquals' is always false because it is called with value type" + }, + "fullDescription": { + "text": "'Object.ReferenceEquals' is always false because it is called with value type", + "markdown": "'Object.ReferenceEquals' is always false because it is called with value type" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReferenceEqualsWithValueType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyConditionalTernaryExpression", + "shortDescription": { + "text": "Simplify conditional ternary expression" + }, + "fullDescription": { + "text": "Ternary expression contains 'true' or 'false' in result branch, for example \r\n condition ? true : elseBranch\r\n condition ? thenBranch : true\r\n Learn more...", + "markdown": "Ternary expression contains 'true' or 'false' in result branch, for example\n\n```\n\r\n condition ? true : elseBranch\r\n condition ? thenBranch : true\r\n \n```\n\n[Learn more...](https://www.jetbrains.com/help/rider/SimplifyConditionalTernaryExpression.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyConditionalTernaryExpression", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticEmbeddedDirective", + "shortDescription": { + "text": "embedded-directive clang diagnostic" + }, + "fullDescription": { + "text": "-Wembedded-directive clang diagnostic · Learn more", + "markdown": "-Wembedded-directive clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wembedded-directive)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticEmbeddedDirective", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOptinOsxOSObjectCStyleCast", + "shortDescription": { + "text": "optin.osx.OSObjectCStyleCast clang static analyzer check" + }, + "fullDescription": { + "text": "optin.osx.OSObjectCStyleCast clang static analyzer check · Learn more", + "markdown": "optin.osx.OSObjectCStyleCast clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOptinOsxOSObjectCStyleCast", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1089", + "shortDescription": { + "text": "RoslynAnalyzers Use --/++ operator instead of assignment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1089", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadAttributeBracketsSpaces", + "shortDescription": { + "text": "Incorrect spacing (around attributes)" + }, + "fullDescription": { + "text": "Around attributes Learn more...", + "markdown": "Around attributes [Learn more...](https://www.jetbrains.com/help/rider/BadAttributeBracketsSpaces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadAttributeBracketsSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Mvc.AreaNotResolved", + "shortDescription": { + "text": "MVC (unknown area)" + }, + "fullDescription": { + "text": "Unknown ASP.NET MVC Area", + "markdown": "Unknown ASP.NET MVC Area" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Mvc.AreaNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1084", + "shortDescription": { + "text": "RoslynAnalyzers Use coalesce expression instead of conditional expression" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1084", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1085", + "shortDescription": { + "text": "RoslynAnalyzers Use auto-implemented property" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1085", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPerformanceImplicitConversionInLoop", + "shortDescription": { + "text": "performance-implicit-conversion-in-loop clang-tidy check" + }, + "fullDescription": { + "text": "performance-implicit-conversion-in-loop clang-tidy check · Learn more", + "markdown": "performance-implicit-conversion-in-loop clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance/implicit-conversion-in-loop.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyPerformanceImplicitConversionInLoop", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1080", + "shortDescription": { + "text": "RoslynAnalyzers Use 'Count/Length' property instead of 'Any' method" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1080", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Asp.ResolveWarning", + "shortDescription": { + "text": "ASP.NET Resolve Warning" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Asp.ResolveWarning", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1081", + "shortDescription": { + "text": "RoslynAnalyzers Split variable declaration" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1081", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1021FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Convert lambda expression body to expression body" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1021FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilitySimplifyBooleanExpr", + "shortDescription": { + "text": "readability-simplify-boolean-expr clang-tidy check" + }, + "fullDescription": { + "text": "readability-simplify-boolean-expr clang-tidy check · Learn more", + "markdown": "readability-simplify-boolean-expr clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/simplify-boolean-expr.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilitySimplifyBooleanExpr", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMalformedWarningCheck", + "shortDescription": { + "text": "malformed-warning-check clang diagnostic" + }, + "fullDescription": { + "text": "-Wmalformed-warning-check clang diagnostic · Learn more", + "markdown": "-Wmalformed-warning-check clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmalformed-warning-check)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMalformedWarningCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedAltivecSrcCompat", + "shortDescription": { + "text": "deprecated-altivec-src-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-altivec-src-compat clang diagnostic · Learn more", + "markdown": "-Wdeprecated-altivec-src-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-altivec-src-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedAltivecSrcCompat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExtraSemiStmt", + "shortDescription": { + "text": "extra-semi-stmt clang diagnostic" + }, + "fullDescription": { + "text": "-Wextra-semi-stmt clang diagnostic · Learn more", + "markdown": "-Wextra-semi-stmt clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wextra-semi-stmt)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExtraSemiStmt", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InternalOrPrivateMemberNotDocumented", + "shortDescription": { + "text": "Missing XML comment for private or internal type or member" + }, + "fullDescription": { + "text": "Missing XML comment for private or internal type or member", + "markdown": "Missing XML comment for private or internal type or member" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "InternalOrPrivateMemberNotDocumented", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnusedConstVariable", + "shortDescription": { + "text": "unused-const-variable clang diagnostic" + }, + "fullDescription": { + "text": "-Wunused-const-variable clang diagnostic · Learn more", + "markdown": "-Wunused-const-variable clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunused-const-variable)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnusedConstVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanSimplifyIsAssignableFrom", + "shortDescription": { + "text": "Simplify 'IsInstanceOfType()' invocation" + }, + "fullDescription": { + "text": "IsInstanceOfType() invocation can be simplified with 'is' operator Learn more...", + "markdown": "IsInstanceOfType() invocation can be simplified with 'is' operator [Learn more...](https://www.jetbrains.com/help/rider/CanSimplifyIsAssignableFrom.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CanSimplifyIsAssignableFrom", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPreC11Compat", + "shortDescription": { + "text": "pre-c11-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wpre-c11-compat clang diagnostic · Learn more", + "markdown": "-Wpre-c11-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpre-c11-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPreC11Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IsExpressionAlwaysFalse", + "shortDescription": { + "text": "The expression of 'is' operator is never of the provided type" + }, + "fullDescription": { + "text": "The expression of 'is' operator is never of the provided type", + "markdown": "The expression of 'is' operator is never of the provided type" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IsExpressionAlwaysFalse", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDllAttributeOnRedeclaration", + "shortDescription": { + "text": "dll-attribute-on-redeclaration clang diagnostic" + }, + "fullDescription": { + "text": "-Wdll-attribute-on-redeclaration clang diagnostic · Learn more", + "markdown": "-Wdll-attribute-on-redeclaration clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdll-attribute-on-redeclaration)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDllAttributeOnRedeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1077", + "shortDescription": { + "text": "RoslynAnalyzers Optimize LINQ method call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RCS1077", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUENonExistentInputAction", + "shortDescription": { + "text": "Action with this name does not exist" + }, + "fullDescription": { + "text": "Action with this name does not exist", + "markdown": "Action with this name does not exist" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUENonExistentInputAction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1078", + "shortDescription": { + "text": "RoslynAnalyzers Use \"\" or 'string.Empty'" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1078", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticArcPerformSelectorLeaks", + "shortDescription": { + "text": "arc-performSelector-leaks clang diagnostic" + }, + "fullDescription": { + "text": "-Warc-performSelector-leaks clang diagnostic · Learn more", + "markdown": "-Warc-performSelector-leaks clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#warc-performSelector-leaks)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticArcPerformSelectorLeaks", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1079", + "shortDescription": { + "text": "RoslynAnalyzers Throwing of new NotImplementedException" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1079", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeAvoidCArrays", + "shortDescription": { + "text": "modernize-avoid-c-arrays clang-tidy check" + }, + "fullDescription": { + "text": "modernize-avoid-c-arrays clang-tidy check · Learn more", + "markdown": "modernize-avoid-c-arrays clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/avoid-c-arrays.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeAvoidCArrays", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadControlBracesIndent", + "shortDescription": { + "text": "Incorrect indent (around statement braces)" + }, + "fullDescription": { + "text": "Around statement braces", + "markdown": "Around statement braces" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadControlBracesIndent", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAnonEnumEnumConversion", + "shortDescription": { + "text": "anon-enum-enum-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wanon-enum-enum-conversion clang diagnostic · Learn more", + "markdown": "-Wanon-enum-enum-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wanon-enum-enum-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAnonEnumEnumConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppCoroutineCallResolveError", + "shortDescription": { + "text": "Cannot resolve a required coroutine function" + }, + "fullDescription": { + "text": "A coroutine-related function which is required by the C++20 standard cannot be resolved", + "markdown": "A coroutine-related function which is required by the C++20 standard cannot be resolved" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppCoroutineCallResolveError", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Compiler Warnings", + "index": 75, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRemoveRedundantBraces", + "shortDescription": { + "text": "Use preferred braces style (remove redundant braces)" + }, + "fullDescription": { + "text": "Braces can be safely removed without changing code semantics", + "markdown": "Braces can be safely removed without changing code semantics" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRemoveRedundantBraces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Syntax Style", + "index": 91, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDefaultIsUsedAsIdentifier", + "shortDescription": { + "text": "Keyword 'default' is used as identifier" + }, + "fullDescription": { + "text": "'default' is a keyword in the C++ standard and cannot be used as an identifier", + "markdown": "'default' is a keyword in the C++ standard and cannot be used as an identifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDefaultIsUsedAsIdentifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompleteUmbrella", + "shortDescription": { + "text": "incomplete-umbrella clang diagnostic" + }, + "fullDescription": { + "text": "-Wincomplete-umbrella clang diagnostic · Learn more", + "markdown": "-Wincomplete-umbrella clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincomplete-umbrella)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompleteUmbrella", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArgumentsStyleOther", + "shortDescription": { + "text": "Use preferred argument style" + }, + "fullDescription": { + "text": "Prefer using named/positional argument for all expressions except literal, named and anonymous function Learn more...", + "markdown": "Prefer using named/positional argument for all expressions except literal, named and anonymous function [Learn more...](https://www.jetbrains.com/help/rider/ArgumentsStyleOther.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArgumentsStyleOther", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantDefaultMemberInitializer", + "shortDescription": { + "text": "Redundant member initializer" + }, + "fullDescription": { + "text": "Initializing field/property/event with default value is redundant Learn more...", + "markdown": "Initializing field/property/event with default value is redundant [Learn more...](https://www.jetbrains.com/help/rider/RedundantDefaultMemberInitializer.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantDefaultMemberInitializer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.RedundantXamarinFormsClassDeclaration", + "shortDescription": { + "text": "Resource cannot be accessed by class name because of x:Key attribute" + }, + "fullDescription": { + "text": "Resource cannot be accessed by class name because of x:Key attribute", + "markdown": "Resource cannot be accessed by class name because of x:Key attribute" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.RedundantXamarinFormsClassDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Potential Code Quality Issues", + "index": 45, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedLabel", + "shortDescription": { + "text": "Unused label" + }, + "fullDescription": { + "text": "Label is never referenced", + "markdown": "Label is never referenced" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "UnusedLabel", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedCopy", + "shortDescription": { + "text": "deprecated-copy clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-copy clang diagnostic · Learn more", + "markdown": "-Wdeprecated-copy clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-copy)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedCopy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUESourceFileWithoutStandardLibrary", + "shortDescription": { + "text": "C/C++ standard library headers not found" + }, + "fullDescription": { + "text": "C++ standard library headers cannot be resolved in an Unreal Engine source file. You might need to regenerate the project files.", + "markdown": "C++ standard library headers cannot be resolved in an Unreal Engine source file. You might need to regenerate the project files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CppUESourceFileWithoutStandardLibrary", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticHigherPrecisionFp", + "shortDescription": { + "text": "higher-precision-fp clang diagnostic" + }, + "fullDescription": { + "text": "-Whigher-precision-fp clang diagnostic · Learn more", + "markdown": "-Whigher-precision-fp clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#whigher-precision-fp)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticHigherPrecisionFp", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDelegatingCtorCycles", + "shortDescription": { + "text": "delegating-ctor-cycles clang diagnostic" + }, + "fullDescription": { + "text": "-Wdelegating-ctor-cycles clang diagnostic · Learn more", + "markdown": "-Wdelegating-ctor-cycles clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdelegating-ctor-cycles)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDelegatingCtorCycles", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Razor.AssemblyNotResolved", + "shortDescription": { + "text": "Unknown Razor assembly" + }, + "fullDescription": { + "text": "Unknown Razor assembly", + "markdown": "Unknown Razor assembly" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Razor.AssemblyNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Razor/Potential Code Quality Issues", + "index": 93, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeMakeShared", + "shortDescription": { + "text": "modernize-make-shared clang-tidy check" + }, + "fullDescription": { + "text": "modernize-make-shared clang-tidy check · Learn more", + "markdown": "modernize-make-shared clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/make-shared.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeMakeShared", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCompoundTokenSplitBySpace", + "shortDescription": { + "text": "compound-token-split-by-space clang diagnostic" + }, + "fullDescription": { + "text": "-Wcompound-token-split-by-space clang diagnostic · Learn more", + "markdown": "-Wcompound-token-split-by-space clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wcompound-token-split-by-space)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCompoundTokenSplitBySpace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAbstractFinalClass", + "shortDescription": { + "text": "abstract-final-class clang diagnostic" + }, + "fullDescription": { + "text": "-Wabstract-final-class clang diagnostic · Learn more", + "markdown": "-Wabstract-final-class clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wabstract-final-class)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAbstractFinalClass", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedStringInterpolation", + "shortDescription": { + "text": "Nested string interpolation can be inlined" + }, + "fullDescription": { + "text": "Nested string interpolation can be inlined into containing one", + "markdown": "Nested string interpolation can be inlined into containing one" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "NestedStringInterpolation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReadAccessInDoubleCheckLocking", + "shortDescription": { + "text": "Possible incorrect implementation of Double-Check Locking pattern. Read access to checked field." + }, + "fullDescription": { + "text": "Possible incorrect implementation of Double-Check Locking pattern. Read access to checked field. Learn more...", + "markdown": "Possible incorrect implementation of Double-Check Locking pattern. Read access to checked field. [Learn more...](https://www.jetbrains.com/help/rider/ReadAccessInDoubleCheckLocking.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReadAccessInDoubleCheckLocking", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertMsc50Cpp", + "shortDescription": { + "text": "cert-msc50-cpp clang-tidy check" + }, + "fullDescription": { + "text": "cert-msc50-cpp clang-tidy check · Learn more", + "markdown": "cert-msc50-cpp clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/msc50-cpp.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertMsc50Cpp", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticLiteralRange", + "shortDescription": { + "text": "literal-range clang diagnostic" + }, + "fullDescription": { + "text": "-Wliteral-range clang diagnostic · Learn more", + "markdown": "-Wliteral-range clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wliteral-range)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticLiteralRange", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TooWideLocalVariableScope", + "shortDescription": { + "text": "Local variable has too wide declaration scope" + }, + "fullDescription": { + "text": "Local variable is declared in a wider scope than the scope of its actual use Learn more...", + "markdown": "Local variable is declared in a wider scope than the scope of its actual use [Learn more...](https://www.jetbrains.com/help/rider/TooWideLocalVariableScope.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "TooWideLocalVariableScope", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUnmatchedPragmaEndRegionDirective", + "shortDescription": { + "text": "Missing a matching '#pragma region' directive" + }, + "fullDescription": { + "text": "A '#pragma endregion' directive is missing a matching '#pragma region' directive", + "markdown": "A '#pragma endregion' directive is missing a matching '#pragma region' directive" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUnmatchedPragmaEndRegionDirective", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AspOdsMethodReferenceResolveError", + "shortDescription": { + "text": "Object data source method resolve problem" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "AspOdsMethodReferenceResolveError", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.RangeToValueIsNotReachable", + "shortDescription": { + "text": "NUnit. The maximum range value is not reachable with the step value." + }, + "fullDescription": { + "text": "NUnit. The maximum value of [Range] is not reachable, check range and step values. Learn more...", + "markdown": "NUnit. The maximum value of \\[Range\\] is not reachable, check range and step values. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.RangeToValueIsNotReachable.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.RangeToValueIsNotReachable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticQualifiedVoidReturnType", + "shortDescription": { + "text": "qualified-void-return-type clang diagnostic" + }, + "fullDescription": { + "text": "-Wqualified-void-return-type clang diagnostic · Learn more", + "markdown": "-Wqualified-void-return-type clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wqualified-void-return-type)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticQualifiedVoidReturnType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3001", + "shortDescription": { + "text": "RoslynAnalyzers Review code for SQL injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3001", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1098", + "shortDescription": { + "text": "RoslynAnalyzers Constant values should be placed on right side of comparisons" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1098", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1099", + "shortDescription": { + "text": "RoslynAnalyzers Default label should be the last label in a switch section" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1099", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3002", + "shortDescription": { + "text": "RoslynAnalyzers Review code for XSS vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3002", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStaticFloatInit", + "shortDescription": { + "text": "static-float-init clang diagnostic" + }, + "fullDescription": { + "text": "-Wstatic-float-init clang diagnostic · Learn more", + "markdown": "-Wstatic-float-init clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstatic-float-init)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStaticFloatInit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3003", + "shortDescription": { + "text": "RoslynAnalyzers Review code for file path injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3003", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Web.MappedPath", + "shortDescription": { + "text": "Mapped path" + }, + "fullDescription": { + "text": "Path is mapped to a different path in project settings", + "markdown": "Path is mapped to a different path in project settings" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Web.MappedPath", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Web.Config/Code Notification", + "index": 94, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3004", + "shortDescription": { + "text": "RoslynAnalyzers Review code for information disclosure vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3004", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3005", + "shortDescription": { + "text": "RoslynAnalyzers Review code for LDAP injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3005", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1050", + "shortDescription": { + "text": "RoslynAnalyzers Include/omit parentheses when creating new object" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1050", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1051", + "shortDescription": { + "text": "RoslynAnalyzers Add/remove parentheses from condition in conditional operator" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1051", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3006", + "shortDescription": { + "text": "RoslynAnalyzers Review code for process command injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3006", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3007", + "shortDescription": { + "text": "RoslynAnalyzers Review code for open redirect vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3007", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1052", + "shortDescription": { + "text": "RoslynAnalyzers Declare each attribute separately" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1052", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertErr33C", + "shortDescription": { + "text": "cert-err33-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-err33-c clang-tidy check · Learn more", + "markdown": "cert-err33-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/err33-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCertErr33C", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3008", + "shortDescription": { + "text": "RoslynAnalyzers Review code for XPath injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3008", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneNarrowingConversions", + "shortDescription": { + "text": "bugprone-narrowing-conversions clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-narrowing-conversions clang-tidy check · Learn more", + "markdown": "bugprone-narrowing-conversions clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/narrowing-conversions.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneNarrowingConversions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3009", + "shortDescription": { + "text": "RoslynAnalyzers Review code for XML injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3009", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadBracesSpaces", + "shortDescription": { + "text": "Incorrect spacing (around braces)" + }, + "fullDescription": { + "text": "Around braces Learn more...", + "markdown": "Around braces [Learn more...](https://www.jetbrains.com/help/rider/BadBracesSpaces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadBracesSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertErr60Cpp", + "shortDescription": { + "text": "cert-err60-cpp clang-tidy check" + }, + "fullDescription": { + "text": "cert-err60-cpp clang-tidy check · Learn more", + "markdown": "cert-err60-cpp clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/err60-cpp.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCertErr60Cpp", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanReplaceCastWithTypeArgument", + "shortDescription": { + "text": "Cast expression can be replaced with explicit type arguments" + }, + "fullDescription": { + "text": "Replace cast expression with explicit type arguments to enhance compile-time safety Learn more...", + "markdown": "Replace cast expression with explicit type arguments to enhance compile-time safety [Learn more...](https://www.jetbrains.com/help/rider/CanReplaceCastWithTypeArgument.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CanReplaceCastWithTypeArgument", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSliceWithRangeIndexer", + "shortDescription": { + "text": "Replace 'Slice' with range indexer" + }, + "fullDescription": { + "text": "Replace 'Slice' method call with range indexer access", + "markdown": "Replace 'Slice' method call with range indexer access" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSliceWithRangeIndexer", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1047", + "shortDescription": { + "text": "RoslynAnalyzers Non-asynchronous method name should not end with 'Async'" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1047", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1048", + "shortDescription": { + "text": "RoslynAnalyzers Use lambda expression instead of anonymous method" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1048", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3010", + "shortDescription": { + "text": "RoslynAnalyzers Review code for XAML injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3010", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1049", + "shortDescription": { + "text": "RoslynAnalyzers Simplify boolean comparison" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1049", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3011", + "shortDescription": { + "text": "RoslynAnalyzers Review code for DLL injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3011", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1043", + "shortDescription": { + "text": "RoslynAnalyzers Remove 'partial' modifier from type with a single part" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1043", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3012", + "shortDescription": { + "text": "RoslynAnalyzers Review code for regex injection vulnerabilities" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CA3012", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1044", + "shortDescription": { + "text": "RoslynAnalyzers Remove original exception from throw statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1044", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantPropertyPatternClause", + "shortDescription": { + "text": "Redundant property pattern clause" + }, + "fullDescription": { + "text": "Empty property pattern clause can be omitted", + "markdown": "Empty property pattern clause can be omitted" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantPropertyPatternClause", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1046", + "shortDescription": { + "text": "RoslynAnalyzers Asynchronous method name should end with 'Async'" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1046", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1040", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty 'else' clause" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1040", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1041", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty initializer" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1041", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1042", + "shortDescription": { + "text": "RoslynAnalyzers Remove enum default underlying type" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1042", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerUnixCstringBadSizeArg", + "shortDescription": { + "text": "unix.cstring.BadSizeArg clang static analyzer check" + }, + "fullDescription": { + "text": "unix.cstring.BadSizeArg clang static analyzer check · Learn more", + "markdown": "unix.cstring.BadSizeArg clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerUnixCstringBadSizeArg", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftMutableReference", + "shortDescription": { + "text": "microsoft-mutable-reference clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-mutable-reference clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-mutable-reference clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-mutable-reference)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftMutableReference", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticRewriteNotBool", + "shortDescription": { + "text": "rewrite-not-bool clang diagnostic" + }, + "fullDescription": { + "text": "-Wrewrite-not-bool clang diagnostic · Learn more", + "markdown": "-Wrewrite-not-bool clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wrewrite-not-bool)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticRewriteNotBool", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppParameterMayBeConst", + "shortDescription": { + "text": "Parameter can be made const" + }, + "fullDescription": { + "text": "Parameter can be made const Learn more...", + "markdown": "Parameter can be made const [Learn more...](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rconst-immutable)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppParameterMayBeConst", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadParensLineBreaks", + "shortDescription": { + "text": "Incorrect line breaks (around parenthesis)" + }, + "fullDescription": { + "text": "Around parenthesis Learn more...", + "markdown": "Around parenthesis [Learn more...](https://www.jetbrains.com/help/rider/BadParensLineBreaks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadParensLineBreaks", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPaddedBitfield", + "shortDescription": { + "text": "padded-bitfield clang diagnostic" + }, + "fullDescription": { + "text": "-Wpadded-bitfield clang diagnostic · Learn more", + "markdown": "-Wpadded-bitfield clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpadded-bitfield)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPaddedBitfield", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityFunctionCognitiveComplexity", + "shortDescription": { + "text": "readability-function-cognitive-complexity clang-tidy check" + }, + "fullDescription": { + "text": "readability-function-cognitive-complexity clang-tidy check · Learn more", + "markdown": "readability-function-cognitive-complexity clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/function-cognitive-complexity.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityFunctionCognitiveComplexity", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppIncompleteSwitchStatement", + "shortDescription": { + "text": "Possibly erroneous incomplete switch-statement" + }, + "fullDescription": { + "text": "The switch statement doesn't cover the whole range of the enumeration used", + "markdown": "The switch statement doesn't cover the whole range of the enumeration used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppIncompleteSwitchStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPortabilityRestrictSystemIncludes", + "shortDescription": { + "text": "portability-restrict-system-includes clang-tidy check" + }, + "fullDescription": { + "text": "portability-restrict-system-includes clang-tidy check · Learn more", + "markdown": "portability-restrict-system-includes clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/portability/restrict-system-includes.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyPortabilityRestrictSystemIncludes", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentInConditionalExpression", + "shortDescription": { + "text": "Assignment in conditional expression" + }, + "fullDescription": { + "text": "Assignment in conditional expression; did you mean to use '==' instead of '='? Learn more...", + "markdown": "Assignment in conditional expression; did you mean to use '==' instead of '='? [Learn more...](https://www.jetbrains.com/help/rider/AssignmentInConditionalExpression.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentInConditionalExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WebConfig.TypeNotResolved", + "shortDescription": { + "text": "Cannot resolve symbol" + }, + "fullDescription": { + "text": "Cannot resolve symbol", + "markdown": "Cannot resolve symbol" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WebConfig.TypeNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Web.Config/Potential Code Quality Issues", + "index": 82, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerNullabilityNullableReturnedFromNonnull", + "shortDescription": { + "text": "nullability.NullableReturnedFromNonnull clang static analyzer check" + }, + "fullDescription": { + "text": "nullability.NullableReturnedFromNonnull clang static analyzer check · Learn more", + "markdown": "nullability.NullableReturnedFromNonnull clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerNullabilityNullableReturnedFromNonnull", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1036", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove unnecessary blank line" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1036", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1037", + "shortDescription": { + "text": "RoslynAnalyzers Remove trailing white-space" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1037", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1038", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1038", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1039", + "shortDescription": { + "text": "RoslynAnalyzers Remove argument list from attribute" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1039", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1032", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant parentheses" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1032", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1033", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant boolean literal" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1033", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1034", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant 'sealed' modifier" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1034", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1035", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove redundant comma in initializer" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1035", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA1200", + "shortDescription": { + "text": "RoslynAnalyzers Avoid using cref tags with a prefix" + }, + "fullDescription": { + "text": "Use of cref tags with prefixes should be avoided, since it prevents the compiler from verifying references and the IDE from updating references during refactorings. It is permissible to suppress this error at a single documentation site if the cref must use a prefix because the type being mentioned is not findable by the compiler. For example, if a cref is mentioning a special attribute in the full framework but you're in a file that compiles against the portable framework, or if you want to reference a type at higher layer of Roslyn, you should suppress the error. You should not suppress the error just because you want to take a shortcut and avoid using the full syntax.", + "markdown": "Use of cref tags with prefixes should be avoided, since it prevents the compiler from verifying references and the IDE from updating references during refactorings. It is permissible to suppress this error at a single documentation site if the cref must use a prefix because the type being mentioned is not findable by the compiler. For example, if a cref is mentioning a special attribute in the full framework but you're in a file that compiles against the portable framework, or if you want to reference a type at higher layer of Roslyn, you should suppress the error. You should not suppress the error just because you want to take a shortcut and avoid using the full syntax." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA1200", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1072", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty namespace declaration" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1072", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1073", + "shortDescription": { + "text": "RoslynAnalyzers Convert 'if' to 'return' statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1073", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1074", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant constructor" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1074", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1075", + "shortDescription": { + "text": "RoslynAnalyzers Avoid empty catch clause that catches System.Exception" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1075", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticKeywordCompat", + "shortDescription": { + "text": "keyword-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wkeyword-compat clang diagnostic · Learn more", + "markdown": "-Wkeyword-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wkeyword-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticKeywordCompat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1070", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant default switch section" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1070", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIntegerOverflow", + "shortDescription": { + "text": "integer-overflow clang diagnostic" + }, + "fullDescription": { + "text": "-Winteger-overflow clang diagnostic · Learn more", + "markdown": "-Winteger-overflow clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winteger-overflow)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIntegerOverflow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1071", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant base constructor call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1071", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDocumentationDeprecatedSync", + "shortDescription": { + "text": "documentation-deprecated-sync clang diagnostic" + }, + "fullDescription": { + "text": "-Wdocumentation-deprecated-sync clang diagnostic · Learn more", + "markdown": "-Wdocumentation-deprecated-sync clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdocumentation-deprecated-sync)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDocumentationDeprecatedSync", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExpansionToDefined", + "shortDescription": { + "text": "expansion-to-defined clang diagnostic" + }, + "fullDescription": { + "text": "-Wexpansion-to-defined clang diagnostic · Learn more", + "markdown": "-Wexpansion-to-defined clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wexpansion-to-defined)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExpansionToDefined", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDllimportStaticFieldDef", + "shortDescription": { + "text": "dllimport-static-field-def clang diagnostic" + }, + "fullDescription": { + "text": "-Wdllimport-static-field-def clang diagnostic · Learn more", + "markdown": "-Wdllimport-static-field-def clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdllimport-static-field-def)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDllimportStaticFieldDef", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.ExpectedComponent", + "shortDescription": { + "text": "Expected a type derived from 'Component' or 'MonoBehaviour'" + }, + "fullDescription": { + "text": "A built-in type derived from 'Component' or a user-defined type derived from 'MonoBehaviour' is expected", + "markdown": "A built-in type derived from 'Component' or a user-defined type derived from 'MonoBehaviour' is expected" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.ExpectedComponent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FSharpRedundantNew", + "shortDescription": { + "text": "Redundant 'new' keyword" + }, + "fullDescription": { + "text": "'new' keyword is not required and can be safely removed.", + "markdown": "'new' keyword is not required and can be safely removed." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "FSharpRedundantNew", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "F#/Redundancies in Code", + "index": 73, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwapViaDeconstruction", + "shortDescription": { + "text": "Use deconstruction to swap variables" + }, + "fullDescription": { + "text": "Replace multiple assignments with single deconstructing assignment to perform swapping", + "markdown": "Replace multiple assignments with single deconstructing assignment to perform swapping" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SwapViaDeconstruction", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveConstructorInvocation", + "shortDescription": { + "text": "Remove constructor invocation" + }, + "fullDescription": { + "text": "new List<$T$>($seq$).ToArray()", + "markdown": "new List\\<$T$\\>($seq$).ToArray()" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveConstructorInvocation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1069", + "shortDescription": { + "text": "RoslynAnalyzers Remove unnecessary case label" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1069", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.CompiledBindingMissingDataTypeErrorHighlighting", + "shortDescription": { + "text": "x:DataType not specified for CompiledBinding" + }, + "fullDescription": { + "text": "x:DataType not specified for CompiledBinding", + "markdown": "x:DataType not specified for CompiledBinding" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "Xaml.CompiledBindingMissingDataTypeErrorHighlighting", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Code Notification", + "index": 5, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InlineOutVariableDeclaration", + "shortDescription": { + "text": "Inline 'out' variable declaration" + }, + "fullDescription": { + "text": "Replace ordinary variable declaration with inline variable declaration under 'out' argument Learn more...", + "markdown": "Replace ordinary variable declaration with inline variable declaration under 'out' argument [Learn more...](https://www.jetbrains.com/help/rider/InlineOutVariableDeclaration.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "InlineOutVariableDeclaration", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1065", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Avoid usage of while statement to create an infinite loop" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1065", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1066", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty 'finally' clause" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1066", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1068", + "shortDescription": { + "text": "RoslynAnalyzers Simplify logical negation" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1068", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertErr34C", + "shortDescription": { + "text": "cert-err34-c clang-tidy check" + }, + "fullDescription": { + "text": "cert-err34-c clang-tidy check · Learn more", + "markdown": "cert-err34-c clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/err34-c.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCertErr34C", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1061", + "shortDescription": { + "text": "RoslynAnalyzers Merge 'if' with nested 'if'" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1061", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithSingleCallToFirstOrDefault", + "shortDescription": { + "text": "Replace with single call to FirstOrDefault(..)" + }, + "fullDescription": { + "text": "$seq$.Where(Function ($x$) $expr$).FirstOrDefault()", + "markdown": "$seq$.Where(Function ($x$) $expr$).FirstOrDefault()" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithSingleCallToFirstOrDefault", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1063", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Avoid usage of do statement to create an infinite loop" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1063", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1064", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Avoid usage of for statement to create an infinite loop" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1064", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1060", + "shortDescription": { + "text": "RoslynAnalyzers Declare each type in separate file" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1060", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VirtualMemberCallInConstructor", + "shortDescription": { + "text": "Virtual member call in constructor" + }, + "fullDescription": { + "text": "When a virtual method is called, the actual type that executes the method is not selected until run time. When a constructor calls a virtual method, it is possible that the constructor for the instance that invokes the method has not executed. See http://msdn2.microsoft.com/en-us/library/ms182331.aspx. Learn more...", + "markdown": "When a virtual method is called, the actual type that executes the method is not selected until run time. When a constructor calls a virtual method, it is possible that the constructor for the instance that invokes the method has not executed. See . [Learn more...](https://www.jetbrains.com/help/rider/VirtualMemberCallInConstructor.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "VirtualMemberCallInConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp98Cpp11Compat", + "shortDescription": { + "text": "c++98-c++11-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++98-c++11-compat clang diagnostic · Learn more", + "markdown": "-Wc++98-c++11-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-98-c-11-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp98Cpp11Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnreachableCodeBreak", + "shortDescription": { + "text": "unreachable-code-break clang diagnostic" + }, + "fullDescription": { + "text": "-Wunreachable-code-break clang diagnostic · Learn more", + "markdown": "-Wunreachable-code-break clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunreachable-code-break)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnreachableCodeBreak", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FSharpDotLambdaCanBeUsed", + "shortDescription": { + "text": "Shorthand lambda can be used" + }, + "fullDescription": { + "text": "Shorthand lambda can be used", + "markdown": "Shorthand lambda can be used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FSharpDotLambdaCanBeUsed", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "F#/Redundancies in Code", + "index": 73, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AddressOfMarshalByRefObject", + "shortDescription": { + "text": "Captured field reference of a marshal-by-reference class may cause a runtime exception" + }, + "fullDescription": { + "text": "Captured field reference of a marshal-by-reference class may cause a runtime exception", + "markdown": "Captured field reference of a marshal-by-reference class may cause a runtime exception" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AddressOfMarshalByRefObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnnotationRedundancyAtValueType", + "shortDescription": { + "text": "Nullability attribute usage with declaration of void or value type" + }, + "fullDescription": { + "text": "Nullability attribute usage with declaration of void or value type does not affect code analysis Learn more...", + "markdown": "Nullability attribute usage with declaration of void or value type does not affect code analysis [Learn more...](https://www.jetbrains.com/help/rider/AnnotationRedundancyAtValueType.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AnnotationRedundancyAtValueType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClearAttributeIsObsolete", + "shortDescription": { + "text": "Obsolete tags and attributes (attribute 'clear' is obsolete)" + }, + "fullDescription": { + "text": "<$tag$ ([)clear=\"$val$\"(]) $a1$>", + "markdown": "\\<$tag$ (\\[)clear=\"$val$\"(\\]) $a1$\\>" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ClearAttributeIsObsolete", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Common Practices and Code Improvements", + "index": 74, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitPositionalPropertyDeclaration", + "shortDescription": { + "text": "Redundant explicit positional property declaration" + }, + "fullDescription": { + "text": "Redundant explicit positional property declaration in record type with primary constructor", + "markdown": "Redundant explicit positional property declaration in record type with primary constructor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantExplicitPositionalPropertyDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1058", + "shortDescription": { + "text": "RoslynAnalyzers Use compound assignment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1058", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1059", + "shortDescription": { + "text": "RoslynAnalyzers Avoid locking on publicly accessible instance" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1059", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OperationContractWithoutServiceContract", + "shortDescription": { + "text": "Method is marked as OperationContract but containing type is not marked as ServiceContract" + }, + "fullDescription": { + "text": "Marking method as OperationContract without ServiceContract attribute on the containing type could cause runtime exception", + "markdown": "Marking method as OperationContract without ServiceContract attribute on the containing type could cause runtime exception" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OperationContractWithoutServiceContract", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1055", + "shortDescription": { + "text": "RoslynAnalyzers Unnecessary semicolon at the end of declaration" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1055", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1056", + "shortDescription": { + "text": "RoslynAnalyzers Avoid usage of using alias directive" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1056", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadSquareBracketsSpaces", + "shortDescription": { + "text": "Incorrect spacing (around square brackets within a statement)" + }, + "fullDescription": { + "text": "Around square brackets within a statement Learn more...", + "markdown": "Around square brackets within a statement [Learn more...](https://www.jetbrains.com/help/rider/BadSquareBracketsSpaces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadSquareBracketsSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedMethodReturnValue.Global", + "shortDescription": { + "text": "Method return value is never used (non-private accessibility)" + }, + "fullDescription": { + "text": "Method return value is never used Learn more...", + "markdown": "Method return value is never used [Learn more...](https://www.jetbrains.com/help/rider/UnusedMethodReturnValue.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "UnusedMethodReturnValue.Global", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticFormatTruncationNonKprintf", + "shortDescription": { + "text": "format-truncation-non-kprintf clang diagnostic" + }, + "fullDescription": { + "text": "-Wformat-truncation-non-kprintf clang diagnostic · Learn more", + "markdown": "-Wformat-truncation-non-kprintf clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wformat-truncation-non-kprintf)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticFormatTruncationNonKprintf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticInvalidConstexpr", + "shortDescription": { + "text": "invalid-constexpr clang diagnostic" + }, + "fullDescription": { + "text": "-Winvalid-constexpr clang diagnostic · Learn more", + "markdown": "-Winvalid-constexpr clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winvalid-constexpr)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticInvalidConstexpr", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClearAttributeIsObsolete.All", + "shortDescription": { + "text": "Obsolete tags and attributes (attribute 'clear' is obsolete)" + }, + "fullDescription": { + "text": "<$tag$ ([)clear=all(]) $a1$>", + "markdown": "\\<$tag$ (\\[)clear=all(\\]) $a1$\\>" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ClearAttributeIsObsolete.All", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Common Practices and Code Improvements", + "index": 74, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyObjcMissingHash", + "shortDescription": { + "text": "objc-missing-hash clang-tidy check" + }, + "fullDescription": { + "text": "objc-missing-hash clang-tidy check · Learn more", + "markdown": "objc-missing-hash clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/objc/missing-hash.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyObjcMissingHash", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnreachableSwitchArmDueToIntegerAnalysis", + "shortDescription": { + "text": "Heuristically unreachable switch arm according to integer analysis" + }, + "fullDescription": { + "text": "Heuristically unreachable switch arm according to integer analysis Learn more...", + "markdown": "Heuristically unreachable switch arm according to integer analysis [Learn more...](https://www.jetbrains.com/help/rider/UnreachableSwitchArmDueToIntegerAnalysis.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnreachableSwitchArmDueToIntegerAnalysis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMissingDeclarations", + "shortDescription": { + "text": "missing-declarations clang diagnostic" + }, + "fullDescription": { + "text": "-Wmissing-declarations clang diagnostic · Learn more", + "markdown": "-Wmissing-declarations clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-declarations)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMissingDeclarations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnforceDoWhileStatementBraces", + "shortDescription": { + "text": "Use preferred braces style (enforce braces in 'do-while' statement)" + }, + "fullDescription": { + "text": "Use braces to separate 'do-while' statement body Learn more...", + "markdown": "Use braces to separate 'do-while' statement body [Learn more...](https://www.jetbrains.com/help/rider/EnforceDoWhileStatementBraces.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EnforceDoWhileStatementBraces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppWrongSlashesInIncludeDirective", + "shortDescription": { + "text": "Use preferred include directive style (slash symbol used in #include directive does not match code style settings)" + }, + "fullDescription": { + "text": "Slash symbol used in #include directive does not match code style settings", + "markdown": "Slash symbol used in #include directive does not match code style settings" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppWrongSlashesInIncludeDirective", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Syntax Style", + "index": 91, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PropertyCanBeMadeInitOnly.Global", + "shortDescription": { + "text": "Property can be made init-only (non-private accessibility)" + }, + "fullDescription": { + "text": "Property setter can be replaced with 'init' accessor to enforce property immutability Learn more...", + "markdown": "Property setter can be replaced with 'init' accessor to enforce property immutability [Learn more...](https://www.jetbrains.com/help/rider/PropertyCanBeMadeInitOnly.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "PropertyCanBeMadeInitOnly.Global", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseWithExpressionToCopyTuple", + "shortDescription": { + "text": "Use 'with' expression to copy tuple" + }, + "fullDescription": { + "text": "Use 'with' expression to create a modified copy of a tuple", + "markdown": "Use 'with' expression to create a modified copy of a tuple" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseWithExpressionToCopyTuple", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityRedundantPreprocessor", + "shortDescription": { + "text": "readability-redundant-preprocessor clang-tidy check" + }, + "fullDescription": { + "text": "readability-redundant-preprocessor clang-tidy check · Learn more", + "markdown": "readability-redundant-preprocessor clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/redundant-preprocessor.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityRedundantPreprocessor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuggestVarOrType_SimpleTypes", + "shortDescription": { + "text": "Use preferred 'var' style (when type is simple)" + }, + "fullDescription": { + "text": "Convert if simple type (not an array and does not have generic parameters) Learn more...", + "markdown": "Convert if simple type (not an array and does not have generic parameters) [Learn more...](https://www.jetbrains.com/help/rider/SuggestVarOrType_SimpleTypes.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SuggestVarOrType_SimpleTypes", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS8305", + "shortDescription": { + "text": "Type is for evaluation purposes only and is subject to change or removal in future updates." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS8305", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InParameterWithMustDisposeResourceAttribute", + "shortDescription": { + "text": "Meaningless [MustDisposeResource] annotation for an input parameter" + }, + "fullDescription": { + "text": "Meaningless [MustDisposeResource] annotation for an input parameter", + "markdown": "Meaningless \\[MustDisposeResource\\] annotation for an input parameter" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InParameterWithMustDisposeResourceAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantQualifier", + "shortDescription": { + "text": "Redundant qualifier" + }, + "fullDescription": { + "text": "Qualifier is redundant", + "markdown": "Qualifier is redundant" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantQualifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Redundancies in Code", + "index": 96, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3061", + "shortDescription": { + "text": "RoslynAnalyzers Do Not Add Schema By URL" + }, + "fullDescription": { + "text": "This overload of XmlSchemaCollection.Add method internally enables DTD processing on the XML reader instance used, and uses UrlResolver for resolving external XML entities. The outcome is information disclosure. Content from file system or network shares for the machine processing the XML can be exposed to attacker. In addition, an attacker can use this as a DoS vector.", + "markdown": "This overload of XmlSchemaCollection.Add method internally enables DTD processing on the XML reader instance used, and uses UrlResolver for resolving external XML entities. The outcome is information disclosure. Content from file system or network shares for the machine processing the XML can be exposed to attacker. In addition, an attacker can use this as a DoS vector." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA3061", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.RedundantGridSpan", + "shortDescription": { + "text": "Single-cell grid column/row span is redundant" + }, + "fullDescription": { + "text": "Single-cell grid column/row span is redundant", + "markdown": "Single-cell grid column/row span is redundant" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.RedundantGridSpan", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Redundancies in Code", + "index": 77, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppEnforceOverridingFunctionStyle", + "shortDescription": { + "text": "Use preferred overriding function style (enforce overriding function style)" + }, + "fullDescription": { + "text": "Enforce the 'virtual' and 'override' specifiers on overriding functions", + "markdown": "Enforce the 'virtual' and 'override' specifiers on overriding functions" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppEnforceOverridingFunctionStyle", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Syntax Style", + "index": 91, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerDeadcodeDeadStores", + "shortDescription": { + "text": "deadcode.DeadStores clang static analyzer check" + }, + "fullDescription": { + "text": "deadcode.DeadStores clang static analyzer check · Learn more", + "markdown": "deadcode.DeadStores clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerDeadcodeDeadStores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCtadMaybeUnsupported", + "shortDescription": { + "text": "ctad-maybe-unsupported clang diagnostic" + }, + "fullDescription": { + "text": "-Wctad-maybe-unsupported clang diagnostic · Learn more", + "markdown": "-Wctad-maybe-unsupported clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wctad-maybe-unsupported)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCtadMaybeUnsupported", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticInlineAsm", + "shortDescription": { + "text": "inline-asm clang diagnostic" + }, + "fullDescription": { + "text": "-Winline-asm clang diagnostic · Learn more", + "markdown": "-Winline-asm clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winline-asm)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticInlineAsm", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnnotateNotNullParameter", + "shortDescription": { + "text": "Declaration nullability inferred (parameter is inferred to be not null)" + }, + "fullDescription": { + "text": "Parameter is inferred always not to be null: consider annotating it with [NotNull] or [ItemNotNull] attribute", + "markdown": "Parameter is inferred always not to be null: consider annotating it with \\[NotNull\\] or \\[ItemNotNull\\] attribute" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AnnotateNotNullParameter", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeThisQualifier", + "shortDescription": { + "text": "Add/remove 'this.' qualifier" + }, + "fullDescription": { + "text": "'this.' qualifier can be safely added/removed without changing code semantics Learn more...", + "markdown": "'this.' qualifier can be safely added/removed without changing code semantics [Learn more...](https://www.jetbrains.com/help/rider/ArrangeThisQualifier.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeThisQualifier", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticArcRetainCycles", + "shortDescription": { + "text": "arc-retain-cycles clang diagnostic" + }, + "fullDescription": { + "text": "-Warc-retain-cycles clang diagnostic · Learn more", + "markdown": "-Warc-retain-cycles clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#warc-retain-cycles)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticArcRetainCycles", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppNewDeleteOperators", + "shortDescription": { + "text": "hicpp-new-delete-operators clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-new-delete-operators clang-tidy check · Learn more", + "markdown": "hicpp-new-delete-operators clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/new-delete-operators.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppNewDeleteOperators", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerSecurityPutenvStackArray", + "shortDescription": { + "text": "security.PutenvStackArray clang static analyzer check" + }, + "fullDescription": { + "text": "security.PutenvStackArray clang static analyzer check · Learn more", + "markdown": "security.PutenvStackArray clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerSecurityPutenvStackArray", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseUsing", + "shortDescription": { + "text": "modernize-use-using clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-using clang-tidy check · Learn more", + "markdown": "modernize-use-using clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-using.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseUsing", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneTooSmallLoopVariable", + "shortDescription": { + "text": "bugprone-too-small-loop-variable clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-too-small-loop-variable clang-tidy check · Learn more", + "markdown": "bugprone-too-small-loop-variable clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/too-small-loop-variable.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneTooSmallLoopVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscNonPrivateMemberVariablesInClasses", + "shortDescription": { + "text": "misc-non-private-member-variables-in-classes clang-tidy check" + }, + "fullDescription": { + "text": "misc-non-private-member-variables-in-classes clang-tidy check · Learn more", + "markdown": "misc-non-private-member-variables-in-classes clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyMiscNonPrivateMemberVariablesInClasses", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticXorUsedAsPow", + "shortDescription": { + "text": "xor-used-as-pow clang diagnostic" + }, + "fullDescription": { + "text": "-Wxor-used-as-pow clang diagnostic · Learn more", + "markdown": "-Wxor-used-as-pow clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wxor-used-as-pow)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticXorUsedAsPow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityIdentifierLength", + "shortDescription": { + "text": "readability-identifier-length clang-tidy check" + }, + "fullDescription": { + "text": "readability-identifier-length clang-tidy check · Learn more", + "markdown": "readability-identifier-length clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/identifier-length.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityIdentifierLength", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftRedeclareStatic", + "shortDescription": { + "text": "microsoft-redeclare-static clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-redeclare-static clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-redeclare-static clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-redeclare-static)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftRedeclareStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitArraySize", + "shortDescription": { + "text": "Redundant explicit size specification in array creation" + }, + "fullDescription": { + "text": "When array initializer has the same number of elements as specified in size expression, explicit size specification is redundant Learn more...", + "markdown": "When array initializer has the same number of elements as specified in size expression, explicit size specification is redundant [Learn more...](https://www.jetbrains.com/help/rider/RedundantExplicitArraySize.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantExplicitArraySize", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityAvoidReturnWithVoidValue", + "shortDescription": { + "text": "readability-avoid-return-with-void-value clang-tidy check" + }, + "fullDescription": { + "text": "readability-avoid-return-with-void-value clang-tidy check · Learn more", + "markdown": "readability-avoid-return-with-void-value clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/avoid-return-with-void-value.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityAvoidReturnWithVoidValue", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNonPowerOfTwoAlignment", + "shortDescription": { + "text": "non-power-of-two-alignment clang diagnostic" + }, + "fullDescription": { + "text": "-Wnon-power-of-two-alignment clang diagnostic · Learn more", + "markdown": "-Wnon-power-of-two-alignment clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnon-power-of-two-alignment)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNonPowerOfTwoAlignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanReplaceCastWithShorterTypeArgument", + "shortDescription": { + "text": "Cast expression can be replaced with simplified type arguments" + }, + "fullDescription": { + "text": "Replace cast expression with simplified type arguments to enhance compile-time safety and code conciseness Learn more...", + "markdown": "Replace cast expression with simplified type arguments to enhance compile-time safety and code conciseness [Learn more...](https://www.jetbrains.com/help/rider/CanReplaceCastWithShorterTypeArgument.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CanReplaceCastWithShorterTypeArgument", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionComplexityOverflow", + "shortDescription": { + "text": "Function body is too complex to analyze" + }, + "fullDescription": { + "text": "Function body is too complex to analyze, consider decomposing it or reducing number of variables", + "markdown": "Function body is too complex to analyze, consider decomposing it or reducing number of variables" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FunctionComplexityOverflow", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDoublePromotion", + "shortDescription": { + "text": "double-promotion clang diagnostic" + }, + "fullDescription": { + "text": "-Wdouble-promotion clang diagnostic · Learn more", + "markdown": "-Wdouble-promotion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdouble-promotion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDoublePromotion", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3075", + "shortDescription": { + "text": "RoslynAnalyzers Insecure DTD processing in XML" + }, + "fullDescription": { + "text": "Using XmlTextReader.Load(), creating an insecure XmlReaderSettings instance when invoking XmlReader.Create(), setting the InnerXml property of the XmlDocument and enabling DTD processing using XmlUrlResolver insecurely can lead to information disclosure. Replace it with a call to the Load() method overload that takes an XmlReader instance, use XmlReader.Create() to accept XmlReaderSettings arguments or consider explicitly setting secure values. The DataViewSettingCollectionString property of DataViewManager should always be assigned from a trusted source, the DtdProcessing property should be set to false, and the XmlResolver property should be changed to XmlSecureResolver or null.", + "markdown": "Using XmlTextReader.Load(), creating an insecure XmlReaderSettings instance when invoking XmlReader.Create(), setting the InnerXml property of the XmlDocument and enabling DTD processing using XmlUrlResolver insecurely can lead to information disclosure. Replace it with a call to the Load() method overload that takes an XmlReader instance, use XmlReader.Create() to accept XmlReaderSettings arguments or consider explicitly setting secure values. The DataViewSettingCollectionString property of DataViewManager should always be assigned from a trusted source, the DtdProcessing property should be set to false, and the XmlResolver property should be changed to XmlSecureResolver or null." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA3075", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3076", + "shortDescription": { + "text": "RoslynAnalyzers Insecure XSLT script processing" + }, + "fullDescription": { + "text": "Providing an insecure XsltSettings instance and an insecure XmlResolver instance to XslCompiledTransform.Load method is potentially unsafe as it allows processing script within XSL, which on an untrusted XSL input may lead to malicious code execution. Either replace the insecure XsltSettings argument with XsltSettings.Default or an instance that has disabled document function and script execution, or replace the XmlResolver argument with null or an XmlSecureResolver instance. This message may be suppressed if the input is known to be from a trusted source and external resource resolution from locations that are not known in advance must be supported.", + "markdown": "Providing an insecure XsltSettings instance and an insecure XmlResolver instance to XslCompiledTransform.Load method is potentially unsafe as it allows processing script within XSL, which on an untrusted XSL input may lead to malicious code execution. Either replace the insecure XsltSettings argument with XsltSettings.Default or an instance that has disabled document function and script execution, or replace the XmlResolver argument with null or an XmlSecureResolver instance. This message may be suppressed if the input is known to be from a trusted source and external resource resolution from locations that are not known in advance must be supported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA3076", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CA3077", + "shortDescription": { + "text": "RoslynAnalyzers Insecure Processing in API Design, XmlDocument and XmlTextReader" + }, + "fullDescription": { + "text": "Enabling DTD processing on all instances derived from XmlTextReader or XmlDocument and using XmlUrlResolver for resolving external XML entities may lead to information disclosure. Ensure to set the XmlResolver property to null, create an instance of XmlSecureResolver when processing untrusted input, or use XmlReader.Create method with a secure XmlReaderSettings argument. Unless you need to enable it, ensure the DtdProcessing property is set to false.", + "markdown": "Enabling DTD processing on all instances derived from XmlTextReader or XmlDocument and using XmlUrlResolver for resolving external XML entities may lead to information disclosure. Ensure to set the XmlResolver property to null, create an instance of XmlSecureResolver when processing untrusted input, or use XmlReader.Create method with a secure XmlReaderSettings argument. Unless you need to enable it, ensure the DtdProcessing property is set to false." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CA3077", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticReorderCtor", + "shortDescription": { + "text": "reorder-ctor clang diagnostic" + }, + "fullDescription": { + "text": "-Wreorder-ctor clang diagnostic · Learn more", + "markdown": "-Wreorder-ctor clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wreorder-ctor)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticReorderCtor", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PolymorphicFieldLikeEventInvocation", + "shortDescription": { + "text": "Invocation of polymorphic field-like event" + }, + "fullDescription": { + "text": "Invocation of 'virtual' or 'override' field-like event leads to unpredictable result because the invocation list is not virtual Learn more...", + "markdown": "Invocation of 'virtual' or 'override' field-like event leads to unpredictable result because the invocation list is not virtual [Learn more...](https://www.jetbrains.com/help/rider/PolymorphicFieldLikeEventInvocation.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PolymorphicFieldLikeEventInvocation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadEmptyBracesLineBreaks", + "shortDescription": { + "text": "Incorrect line breaks (around empty braces)" + }, + "fullDescription": { + "text": "Around empty braces", + "markdown": "Around empty braces" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadEmptyBracesLineBreaks", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOptinTaintTaintedAlloc", + "shortDescription": { + "text": "optin.taint.TaintedAlloc clang static analyzer check" + }, + "fullDescription": { + "text": "optin.taint.TaintedAlloc clang static analyzer check · Learn more", + "markdown": "optin.taint.TaintedAlloc clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOptinTaintTaintedAlloc", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantCast", + "shortDescription": { + "text": "Redundant cast" + }, + "fullDescription": { + "text": "Type cast can be safely removed Learn more...", + "markdown": "Type cast can be safely removed [Learn more...](https://www.jetbrains.com/help/rider/RedundantCast.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "RedundantCast", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerApiModelingLlvmCastValue", + "shortDescription": { + "text": "apiModeling.llvm.CastValue clang static analyzer check" + }, + "fullDescription": { + "text": "apiModeling.llvm.CastValue clang static analyzer check · Learn more", + "markdown": "apiModeling.llvm.CastValue clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerApiModelingLlvmCastValue", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringLiteralAsInterpolationArgument", + "shortDescription": { + "text": "String literal can be inlined" + }, + "fullDescription": { + "text": "String literal can be inlined into interpolation", + "markdown": "String literal can be inlined into interpolation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "StringLiteralAsInterpolationArgument", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerFuchsiaHandleChecker", + "shortDescription": { + "text": "fuchsia.HandleChecker clang static analyzer check" + }, + "fullDescription": { + "text": "fuchsia.HandleChecker clang static analyzer check · Learn more", + "markdown": "fuchsia.HandleChecker clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerFuchsiaHandleChecker", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShadowField", + "shortDescription": { + "text": "shadow-field clang diagnostic" + }, + "fullDescription": { + "text": "-Wshadow-field clang diagnostic · Learn more", + "markdown": "-Wshadow-field clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshadow-field)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShadowField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantWithExpression", + "shortDescription": { + "text": "Empty 'with' expression is redundant" + }, + "fullDescription": { + "text": "Empty 'with' expression applied to newly created object instance results in unnecessary clone creation", + "markdown": "Empty 'with' expression applied to newly created object instance results in unnecessary clone creation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantWithExpression", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExtraQualification", + "shortDescription": { + "text": "extra-qualification clang diagnostic" + }, + "fullDescription": { + "text": "-Wextra-qualification clang diagnostic · Learn more", + "markdown": "-Wextra-qualification clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wextra-qualification)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExtraQualification", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToVbAutoPropertyWhenPossible", + "shortDescription": { + "text": "Convert property to auto-property when possible" + }, + "fullDescription": { + "text": "Converts property declaration to VB.NET auto-property syntax.", + "markdown": "Converts property declaration to VB.NET auto-property syntax." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToVbAutoPropertyWhenPossible", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppNoexceptMove", + "shortDescription": { + "text": "hicpp-noexcept-move clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-noexcept-move clang-tidy check · Learn more", + "markdown": "hicpp-noexcept-move clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/noexcept-move.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppNoexceptMove", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAutoStorageClass", + "shortDescription": { + "text": "auto-storage-class clang diagnostic" + }, + "fullDescription": { + "text": "-Wauto-storage-class clang diagnostic · Learn more", + "markdown": "-Wauto-storage-class clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wauto-storage-class)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAutoStorageClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WebConfig.UnusedElementDueToConfigSourceAttribute", + "shortDescription": { + "text": "Redundant element or attribute because of 'configSource' attribute" + }, + "fullDescription": { + "text": "Element or attribute is not applied because of 'configSource' attribute and can be safely removed", + "markdown": "Element or attribute is not applied because of 'configSource' attribute and can be safely removed" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WebConfig.UnusedElementDueToConfigSourceAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Web.Config/Redundancies in Code", + "index": 98, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppConceptNeverUsed", + "shortDescription": { + "text": "Concept is never used" + }, + "fullDescription": { + "text": "Concept is never used", + "markdown": "Concept is never used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppConceptNeverUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadExpressionBracesLineBreaks", + "shortDescription": { + "text": "Incorrect line breaks (around expression braces)" + }, + "fullDescription": { + "text": "Around expression braces Learn more...", + "markdown": "Around expression braces [Learn more...](https://www.jetbrains.com/help/rider/BadExpressionBracesLineBreaks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadExpressionBracesLineBreaks", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompleteModule", + "shortDescription": { + "text": "incomplete-module clang diagnostic" + }, + "fullDescription": { + "text": "-Wincomplete-module clang diagnostic · Learn more", + "markdown": "-Wincomplete-module clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincomplete-module)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompleteModule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppMissingKeywordThrow", + "shortDescription": { + "text": "May be missing keyword 'throw'" + }, + "fullDescription": { + "text": "Object of exception type is created, but is not thrown", + "markdown": "Object of exception type is created, but is not thrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppMissingKeywordThrow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppNonInlineFunctionDefinitionInHeaderFile", + "shortDescription": { + "text": "Non-inline function definition in a header file" + }, + "fullDescription": { + "text": "A function definition in a header file that will lead to a multiple definition linkage error Learn more...", + "markdown": "A function definition in a header file that will lead to a multiple definition linkage error [Learn more...](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-inline)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppNonInlineFunctionDefinitionInHeaderFile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedMemberHierarchy.Local", + "shortDescription": { + "text": "Type member is only used in overrides (private accessibility)" + }, + "fullDescription": { + "text": "Type member is never used from outside of implementation hierarchy, it is only accessed from overrides through base call", + "markdown": "Type member is never used from outside of implementation hierarchy, it is only accessed from overrides through base call" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedMemberHierarchy.Local", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuStaticFloatInit", + "shortDescription": { + "text": "gnu-static-float-init clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-static-float-init clang diagnostic · Learn more", + "markdown": "-Wgnu-static-float-init clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-static-float-init)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuStaticFloatInit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.NoNullPatternMatching", + "shortDescription": { + "text": "Possible unintended bypass of lifetime check of underlying Unity engine object (pattern matching null checks on a type deriving from 'UnityEngine.Object' bypasses the lifetime check on the underlying Unity engine object)" + }, + "fullDescription": { + "text": "Pattern matching null checks operators do not call custom equality operators defined on 'UnityEngine.Object'. These operators check if the underlying Unity engine object has been destroyed. Prefer an explicit null comparison or implicit bool comparison if the lifetime check is intended, or explicitly use 'object.ReferenceEquals()' for a standard (and quicker) CLR null check. Learn more...", + "markdown": "Pattern matching null checks operators do not call custom equality operators defined on 'UnityEngine.Object'. These operators check if the underlying Unity engine object has been destroyed. Prefer an explicit null comparison or implicit bool comparison if the lifetime check is intended, or explicitly use 'object.ReferenceEquals()' for a standard (and quicker) CLR null check. [Learn more...](https://github.com/JetBrains/resharper-unity/wiki/Possible-unintended-bypass-of-lifetime-check-of-underlying-Unity-engine-object)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Unity.NoNullPatternMatching", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAssume", + "shortDescription": { + "text": "assume clang diagnostic" + }, + "fullDescription": { + "text": "-Wassume clang diagnostic · Learn more", + "markdown": "-Wassume clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wassume)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAssume", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp98CompatUnnamedTypeTemplateArgs", + "shortDescription": { + "text": "c++98-compat-unnamed-type-template-args clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++98-compat-unnamed-type-template-args clang diagnostic · Learn more", + "markdown": "-Wc++98-compat-unnamed-type-template-args clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-98-compat-unnamed-type-template-args)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp98CompatUnnamedTypeTemplateArgs", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DefaultStructEqualityIsUsed.Global", + "shortDescription": { + "text": "Struct with default equality members is used for comparison (non-private accessibility)" + }, + "fullDescription": { + "text": "Default implementations of the 'Equals' and 'GetHashCode' methods of a struct are based on reflection and perform poorly. To prevent boxing and improve performance, overriding the equality members is recommended. This inspection only triggers if the struct or its containing type (such as record) is actually used for equality comparisons in the solution. Learn more...", + "markdown": "Default implementations of the 'Equals' and 'GetHashCode' methods of a struct are based on reflection and perform poorly. To prevent boxing and improve performance, overriding the equality members is recommended. This inspection only triggers if the struct or its containing type (such as record) is actually used for equality comparisons in the solution. [Learn more...](https://www.jetbrains.com/help/rider/DefaultStructEqualityIsUsed.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DefaultStructEqualityIsUsed.Global", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1717", + "shortDescription": { + "text": "Assignment made to same variable" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/a1kzfw0z.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1717", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1711", + "shortDescription": { + "text": "XML comment has a 'typeparam' tag for 'TypeParameter', but there is no type parameter by that name" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1711)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1711", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1712", + "shortDescription": { + "text": "Type parameter has no matching typeparam tag in the XML comment" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/t8zca749.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1712", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSimpleAssignment.False", + "shortDescription": { + "text": "Replace with simple assignment" + }, + "fullDescription": { + "text": "$bool1$ &= false", + "markdown": "$bool1$ \\&= false" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSimpleAssignment.False", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CSharpWarnings__CS1710", + "shortDescription": { + "text": "Duplicate typeparam tag in XML comment" + }, + "fullDescription": { + "text": "Learn more...", + "markdown": "[Learn more...](https://msdn.microsoft.com/en-us/library/k5ya7w1x.aspx)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "CSharpWarnings__CS1710", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAndroidComparisonInTempFailureRetry", + "shortDescription": { + "text": "android-comparison-in-temp-failure-retry clang-tidy check" + }, + "fullDescription": { + "text": "android-comparison-in-temp-failure-retry clang-tidy check · Learn more", + "markdown": "android-comparison-in-temp-failure-retry clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAndroidComparisonInTempFailureRetry", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp20CompatPedantic", + "shortDescription": { + "text": "c++20-compat-pedantic clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++20-compat-pedantic clang diagnostic · Learn more", + "markdown": "-Wc++20-compat-pedantic clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-20-compat-pedantic)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp20CompatPedantic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithVirtualMembersNeverInherited.Local", + "shortDescription": { + "text": "Class with virtual (overridable) members never inherited (private accessibility)" + }, + "fullDescription": { + "text": "Non-abstract class has virtual (overridable) members but has no inheritors Learn more...", + "markdown": "Non-abstract class has virtual (overridable) members but has no inheritors [Learn more...](https://www.jetbrains.com/help/rider/ClassWithVirtualMembersNeverInherited.Local.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ClassWithVirtualMembersNeverInherited.Local", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCertOop57Cpp", + "shortDescription": { + "text": "cert-oop57-cpp clang-tidy check" + }, + "fullDescription": { + "text": "cert-oop57-cpp clang-tidy check · Learn more", + "markdown": "cert-oop57-cpp clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cert/oop57-cpp.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCertOop57Cpp", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NUnit.TestCaseResultPropertyIsObsolete", + "shortDescription": { + "text": "NUnit. Test case Result property is obsolete." + }, + "fullDescription": { + "text": "NUnit. Test case Result property is obsolete since NUnit 2.6. Learn more...", + "markdown": "NUnit. Test case Result property is obsolete since NUnit 2.6. [Learn more...](https://www.jetbrains.com/help/rider/NUnit.TestCaseResultPropertyIsObsolete.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NUnit.TestCaseResultPropertyIsObsolete", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/NUnit", + "index": 26, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUE4ProbableMemoryIssuesWithUObjectsInContainer", + "shortDescription": { + "text": "Objects stored in non-uproperty member can be destroyed during garbage collection, resulting in stale pointers" + }, + "fullDescription": { + "text": "Objects stored in non-uproperty member can be destroyed during garbage collection, resulting in stale pointers", + "markdown": "Objects stored in non-uproperty member can be destroyed during garbage collection, resulting in stale pointers" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUE4ProbableMemoryIssuesWithUObjectsInContainer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Unreal Engine", + "index": 6, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppPrintfRiskyFormat", + "shortDescription": { + "text": "Possibly invalid printf format specifier" + }, + "fullDescription": { + "text": "Format string contains a potential error", + "markdown": "Format string contains a potential error" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppPrintfRiskyFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsePositionalDeconstructionPattern", + "shortDescription": { + "text": "Use positional deconstruction pattern" + }, + "fullDescription": { + "text": "Replace property pattern member(s) of recursive pattern with positional deconstruction patterns", + "markdown": "Replace property pattern member(s) of recursive pattern with positional deconstruction patterns" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UsePositionalDeconstructionPattern", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.SharedStaticUnmanagedType", + "shortDescription": { + "text": "Shared static type parameter requires the unmanaged constraint" + }, + "fullDescription": { + "text": "Shared static type parameter requires the unmanaged constraint", + "markdown": "Shared static type parameter requires the unmanaged constraint" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.SharedStaticUnmanagedType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPadded", + "shortDescription": { + "text": "padded clang diagnostic" + }, + "fullDescription": { + "text": "-Wpadded clang diagnostic · Learn more", + "markdown": "-Wpadded clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpadded)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPadded", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLogicalConditionalExpressionOperand", + "shortDescription": { + "text": "Redundant operand in logical conditional expression" + }, + "fullDescription": { + "text": "Redundant operand in logical conditional expression, for example \r\n expr || false\r\n expr && true\r\n Learn more...", + "markdown": "Redundant operand in logical conditional expression, for example\n\n```\n\r\n expr || false\r\n expr && true\r\n```\n\n[Learn more...](https://www.jetbrains.com/help/rider/RedundantLogicalConditionalExpressionOperand.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLogicalConditionalExpressionOperand", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticLanguageExtensionToken", + "shortDescription": { + "text": "language-extension-token clang diagnostic" + }, + "fullDescription": { + "text": "-Wlanguage-extension-token clang diagnostic · Learn more", + "markdown": "-Wlanguage-extension-token clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wlanguage-extension-token)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticLanguageExtensionToken", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonAtomicCompoundOperator", + "shortDescription": { + "text": "Suspicious 'volatile' field usage: compound operation is not atomic. 'Interlocked' class can be used instead." + }, + "fullDescription": { + "text": "Suspicious 'volatile' field usage: compound operation is not atomic. 'Interlocked' class can be used instead.", + "markdown": "Suspicious 'volatile' field usage: compound operation is not atomic. 'Interlocked' class can be used instead." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NonAtomicCompoundOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHighlighting", + "shortDescription": { + "text": "Unknown clang-tidy checks" + }, + "fullDescription": { + "text": "Unknown clang-tidy checks.", + "markdown": "Unknown clang-tidy checks." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHighlighting", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnusedButSetVariable", + "shortDescription": { + "text": "unused-but-set-variable clang diagnostic" + }, + "fullDescription": { + "text": "-Wunused-but-set-variable clang diagnostic · Learn more", + "markdown": "-Wunused-but-set-variable clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunused-but-set-variable)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnusedButSetVariable", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1015FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Use nameof operator" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1015FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTautologicalObjcBoolCompare", + "shortDescription": { + "text": "tautological-objc-bool-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wtautological-objc-bool-compare clang diagnostic · Learn more", + "markdown": "-Wtautological-objc-bool-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtautological-objc-bool-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTautologicalObjcBoolCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverriddenWithSameValue", + "shortDescription": { + "text": "Resource is overridden with identical value" + }, + "fullDescription": { + "text": "Base resource item and the current item have the same value Learn more...", + "markdown": "Base resource item and the current item have the same value [Learn more...](https://www.jetbrains.com/help/rider/OverriddenWithSameValue.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "OverriddenWithSameValue", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ResX/Redundancies in Code", + "index": 99, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Asxx.PathError", + "shortDescription": { + "text": "Path error" + }, + "fullDescription": { + "text": "Path error", + "markdown": "Path error" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Asxx.PathError", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HttpHandler or WebService/Potential Code Quality Issues", + "index": 101, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMisspelledAssumption", + "shortDescription": { + "text": "misspelled-assumption clang diagnostic" + }, + "fullDescription": { + "text": "-Wmisspelled-assumption clang diagnostic · Learn more", + "markdown": "-Wmisspelled-assumption clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmisspelled-assumption)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMisspelledAssumption", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeNamespaceBody", + "shortDescription": { + "text": "Use preferred namespace body style" + }, + "fullDescription": { + "text": "Use file-scoped or block-scoped namespace body Learn more...", + "markdown": "Use file-scoped or block-scoped namespace body [Learn more...](https://www.jetbrains.com/help/rider/ArrangeNamespaceBody.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeNamespaceBody", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeUseTrailingReturnType", + "shortDescription": { + "text": "modernize-use-trailing-return-type clang-tidy check" + }, + "fullDescription": { + "text": "modernize-use-trailing-return-type clang-tidy check · Learn more", + "markdown": "modernize-use-trailing-return-type clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeUseTrailingReturnType", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftStaticAssert", + "shortDescription": { + "text": "microsoft-static-assert clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-static-assert clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-static-assert clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-static-assert)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftStaticAssert", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMissingTemplateArgListAfterTemplateKw", + "shortDescription": { + "text": "missing-template-arg-list-after-template-kw clang diagnostic" + }, + "fullDescription": { + "text": "-Wmissing-template-arg-list-after-template-kw clang diagnostic · Learn more", + "markdown": "-Wmissing-template-arg-list-after-template-kw clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-template-arg-list-after-template-kw)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMissingTemplateArgListAfterTemplateKw", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PropertyCanBeMadeInitOnly.Local", + "shortDescription": { + "text": "Property can be made init-only (private accessibility)" + }, + "fullDescription": { + "text": "Property setter can be replaced with 'init' accessor to enforce property immutability Learn more...", + "markdown": "Property setter can be replaced with 'init' accessor to enforce property immutability [Learn more...](https://www.jetbrains.com/help/rider/PropertyCanBeMadeInitOnly.Local.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PropertyCanBeMadeInitOnly.Local", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCastQual", + "shortDescription": { + "text": "cast-qual clang diagnostic" + }, + "fullDescription": { + "text": "-Wcast-qual clang diagnostic · Learn more", + "markdown": "-Wcast-qual clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wcast-qual)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCastQual", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp11Compat", + "shortDescription": { + "text": "c++11-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++11-compat clang diagnostic · Learn more", + "markdown": "-Wc++11-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-11-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp11Compat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftEnumValue", + "shortDescription": { + "text": "microsoft-enum-value clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-enum-value clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-enum-value clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-enum-value)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftEnumValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2007", + "shortDescription": { + "text": "RoslynAnalyzers Invalid entry in analyzer release file" + }, + "fullDescription": { + "text": "Invalid entry in analyzer release file.", + "markdown": "Invalid entry in analyzer release file." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2007", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneUnusedRaii", + "shortDescription": { + "text": "bugprone-unused-raii clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-unused-raii clang-tidy check · Learn more", + "markdown": "bugprone-unused-raii clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/unused-raii.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneUnusedRaii", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneMisplacedOperatorInStrlenInAlloc", + "shortDescription": { + "text": "bugprone-misplaced-operator-in-strlen-in-alloc clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-misplaced-operator-in-strlen-in-alloc clang-tidy check · Learn more", + "markdown": "bugprone-misplaced-operator-in-strlen-in-alloc clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/misplaced-operator-in-strlen-in-alloc.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneMisplacedOperatorInStrlenInAlloc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2008", + "shortDescription": { + "text": "RoslynAnalyzers Enable analyzer release tracking" + }, + "fullDescription": { + "text": "Enabling release tracking for analyzer packages helps in tracking and documenting the analyzer diagnostics that ship and/or change with each analyzer release. See details at https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md.", + "markdown": "Enabling release tracking for analyzer packages helps in tracking and documenting the analyzer diagnostics that ship and/or change with each analyzer release. See details at https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2008", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2005", + "shortDescription": { + "text": "RoslynAnalyzers Remove duplicate entries for diagnostic ID in the same analyzer release" + }, + "fullDescription": { + "text": "Remove duplicate entries for diagnostic ID in the same analyzer release.", + "markdown": "Remove duplicate entries for diagnostic ID in the same analyzer release." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2005", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2006", + "shortDescription": { + "text": "RoslynAnalyzers Remove duplicate entries for diagnostic ID between analyzer releases" + }, + "fullDescription": { + "text": "Remove duplicate entries for diagnostic ID between analyzer releases.", + "markdown": "Remove duplicate entries for diagnostic ID between analyzer releases." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2006", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2003", + "shortDescription": { + "text": "RoslynAnalyzers Shipped diagnostic IDs that are no longer reported should have an entry in the 'Removed Rules' table in unshipped file" + }, + "fullDescription": { + "text": "Shipped diagnostic IDs that are no longer reported should have an entry in the 'Removed Rules' table in unshipped file.", + "markdown": "Shipped diagnostic IDs that are no longer reported should have an entry in the 'Removed Rules' table in unshipped file." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2003", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticShorten64To32", + "shortDescription": { + "text": "shorten-64-to-32 clang diagnostic" + }, + "fullDescription": { + "text": "-Wshorten-64-to-32 clang diagnostic · Learn more", + "markdown": "-Wshorten-64-to-32 clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wshorten-64-to-32)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticShorten64To32", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2004", + "shortDescription": { + "text": "RoslynAnalyzers Diagnostic IDs marked as removed in analyzer release file should not be reported by analyzers" + }, + "fullDescription": { + "text": "Diagnostic IDs marked as removed in analyzer release file should not be reported by analyzers.", + "markdown": "Diagnostic IDs marked as removed in analyzer release file should not be reported by analyzers." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2004", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Html.EventNotResolved", + "shortDescription": { + "text": "Unknown event" + }, + "fullDescription": { + "text": "Unknown event in HTML and related technologies", + "markdown": "Unknown event in HTML and related technologies" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Html.EventNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Potential Code Quality Issues", + "index": 54, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAndroidCloexecEpollCreate", + "shortDescription": { + "text": "android-cloexec-epoll-create clang-tidy check" + }, + "fullDescription": { + "text": "android-cloexec-epoll-create clang-tidy check · Learn more", + "markdown": "android-cloexec-epoll-create clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/android/cloexec-epoll-create.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAndroidCloexecEpollCreate", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityAvoidUnconditionalPreprocessorIf", + "shortDescription": { + "text": "readability-avoid-unconditional-preprocessor-if clang-tidy check" + }, + "fullDescription": { + "text": "readability-avoid-unconditional-preprocessor-if clang-tidy check · Learn more", + "markdown": "readability-avoid-unconditional-preprocessor-if clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/avoid-unconditional-preprocessor-if.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityAvoidUnconditionalPreprocessorIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2001", + "shortDescription": { + "text": "RoslynAnalyzers Ensure up-to-date entry for analyzer diagnostic IDs are added to analyzer release" + }, + "fullDescription": { + "text": "Ensure up-to-date entry for analyzer diagnostic IDs are added to analyzer release.", + "markdown": "Ensure up-to-date entry for analyzer diagnostic IDs are added to analyzer release." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2001", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUninitializedDependentBaseClass", + "shortDescription": { + "text": "Uninitialized dependent base class" + }, + "fullDescription": { + "text": "Possibly uninitialized dependent base class", + "markdown": "Possibly uninitialized dependent base class" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUninitializedDependentBaseClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Compiler Warnings", + "index": 75, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticParenthesesEquality", + "shortDescription": { + "text": "parentheses-equality clang diagnostic" + }, + "fullDescription": { + "text": "-Wparentheses-equality clang diagnostic · Learn more", + "markdown": "-Wparentheses-equality clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wparentheses-equality)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticParenthesesEquality", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2002", + "shortDescription": { + "text": "RoslynAnalyzers Do not add removed analyzer diagnostic IDs to unshipped analyzer release" + }, + "fullDescription": { + "text": "Entries for analyzer diagnostic IDs that are no longer reported and never shipped can be removed from unshipped analyzer release.", + "markdown": "Entries for analyzer diagnostic IDs that are no longer reported and never shipped can be removed from unshipped analyzer release." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2002", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUseAutoForNumeric", + "shortDescription": { + "text": "Use preferred 'auto' style (numeric type can be replaced with auto)" + }, + "fullDescription": { + "text": "A numeric type can be replaced with 'auto'", + "markdown": "A numeric type can be replaced with 'auto'" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppUseAutoForNumeric", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Syntax Style", + "index": 91, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithSingleAssignment.1", + "shortDescription": { + "text": "Replace with single assignment" + }, + "fullDescription": { + "text": "Dim $x$ = False If($bool1$) Then $x$ = True", + "markdown": "Dim $x$ = False If($bool1$) Then $x$ = True" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithSingleAssignment.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithSingleAssignment.2", + "shortDescription": { + "text": "Replace with single assignment" + }, + "fullDescription": { + "text": "Dim $x$ = True If($bool1$) Then $x$ = False", + "markdown": "Dim $x$ = True If($bool1$) Then $x$ = False" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithSingleAssignment.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppTypeAliasNeverUsed", + "shortDescription": { + "text": "Type alias is never used" + }, + "fullDescription": { + "text": "A type alias is never used", + "markdown": "A type alias is never used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppTypeAliasNeverUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantReadonlyModifier", + "shortDescription": { + "text": "Redundant 'readonly' modifier" + }, + "fullDescription": { + "text": "Readonly 'redundant' member/accessor modifier in struct declaration", + "markdown": "Readonly 'redundant' member/accessor modifier in struct declaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantReadonlyModifier", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticSelfAssignField", + "shortDescription": { + "text": "self-assign-field clang diagnostic" + }, + "fullDescription": { + "text": "-Wself-assign-field clang diagnostic · Learn more", + "markdown": "-Wself-assign-field clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wself-assign-field)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticSelfAssignField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppPassValueParameterByConstReference", + "shortDescription": { + "text": "Pass value parameters by const reference" + }, + "fullDescription": { + "text": "Parameter of a type that is expensive to copy is passed by value, but it can be passed by const reference instead Learn more...", + "markdown": "Parameter of a type that is expensive to copy is passed by value, but it can be passed by const reference instead [Learn more...](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppPassValueParameterByConstReference", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticConditionalTypeMismatch", + "shortDescription": { + "text": "conditional-type-mismatch clang diagnostic" + }, + "fullDescription": { + "text": "-Wconditional-type-mismatch clang diagnostic · Learn more", + "markdown": "-Wconditional-type-mismatch clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wconditional-type-mismatch)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticConditionalTypeMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantArrayLowerBoundSpecification", + "shortDescription": { + "text": "Redundant array lower bound specification" + }, + "fullDescription": { + "text": "Array lower bound specification is redundant", + "markdown": "Array lower bound specification is redundant" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantArrayLowerBoundSpecification", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Redundancies in Code", + "index": 96, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBoostUseToString", + "shortDescription": { + "text": "boost-use-to-string clang-tidy check" + }, + "fullDescription": { + "text": "boost-use-to-string clang-tidy check · Learn more", + "markdown": "boost-use-to-string clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/boost/use-to-string.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyBoostUseToString", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JoinDeclarationAndInitializer", + "shortDescription": { + "text": "Join local variable declaration and assignment" + }, + "fullDescription": { + "text": "Join local variable declaration and assignment Learn more...", + "markdown": "Join local variable declaration and assignment [Learn more...](https://www.jetbrains.com/help/rider/JoinDeclarationAndInitializer.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JoinDeclarationAndInitializer", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RouteTemplates.SyntaxError", + "shortDescription": { + "text": "Syntax error" + }, + "fullDescription": { + "text": "Syntax error", + "markdown": "Syntax error" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RouteTemplates.SyntaxError", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ASP.NET route templates/Code Notification", + "index": 48, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementMissingSomeEnumCasesNoDefault", + "shortDescription": { + "text": "Some values of the enum are not processed inside 'switch' statement" + }, + "fullDescription": { + "text": "Some values of the enum are not processed inside 'switch' statement Learn more...", + "markdown": "Some values of the enum are not processed inside 'switch' statement [Learn more...](https://www.jetbrains.com/help/rider/SwitchStatementMissingSomeEnumCasesNoDefault.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SwitchStatementMissingSomeEnumCasesNoDefault", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneThrowKeywordMissing", + "shortDescription": { + "text": "bugprone-throw-keyword-missing clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-throw-keyword-missing clang-tidy check · Learn more", + "markdown": "bugprone-throw-keyword-missing clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/throw-keyword-missing.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneThrowKeywordMissing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstructorWithMustDisposeResourceAttributeBaseIsNotAnnotated", + "shortDescription": { + "text": "[MustDisposeResource] annotation is not inherited from the base constructor and should be placed explicitly" + }, + "fullDescription": { + "text": "[MustDisposeResource] annotation is not inherited from the base constructor Learn more...", + "markdown": "\\[MustDisposeResource\\] annotation is not inherited from the base constructor [Learn more...](https://www.jetbrains.com/help/rider/ConstructorWithMustDisposeResourceAttributeBaseIsNotAnnotated.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConstructorWithMustDisposeResourceAttributeBaseIsNotAnnotated", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantPatternParentheses", + "shortDescription": { + "text": "Remove redundant pattern-matching parentheses" + }, + "fullDescription": { + "text": "Parentheses surrounding a pattern are redundant if they do not change precedence of `or`-/`and`-patterns", + "markdown": "Parentheses surrounding a pattern are redundant if they do not change precedence of \\`or\\`-/\\`and\\`-patterns" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantPatternParentheses", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToPrimaryConstructor", + "shortDescription": { + "text": "Convert constructor into primary constructor" + }, + "fullDescription": { + "text": "Replace ordinary constructor with primary constructor Learn more...", + "markdown": "Replace ordinary constructor with primary constructor [Learn more...](https://www.jetbrains.com/help/rider/ConvertToPrimaryConstructor.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToPrimaryConstructor", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantLinebreak", + "shortDescription": { + "text": "Incorrect line breaks (line break is redundant elsewhere)" + }, + "fullDescription": { + "text": "Line break is redundant elsewhere", + "markdown": "Line break is redundant elsewhere" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRedundantLinebreak", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyZirconTemporaryObjects", + "shortDescription": { + "text": "zircon-temporary-objects clang-tidy check" + }, + "fullDescription": { + "text": "zircon-temporary-objects clang-tidy check · Learn more", + "markdown": "zircon-temporary-objects clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/zircon/temporary-objects.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyZirconTemporaryObjects", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGlobalConstructors", + "shortDescription": { + "text": "global-constructors clang diagnostic" + }, + "fullDescription": { + "text": "-Wglobal-constructors clang diagnostic · Learn more", + "markdown": "-Wglobal-constructors clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wglobal-constructors)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGlobalConstructors", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantTypenameKeyword", + "shortDescription": { + "text": "Redundant 'typename' keyword" + }, + "fullDescription": { + "text": "Redundant 'typename' keyword", + "markdown": "Redundant 'typename' keyword" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppRedundantTypenameKeyword", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Redundancies in Code", + "index": 34, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppDoxygenSyntaxError", + "shortDescription": { + "text": "Syntax error in doxygen comment" + }, + "fullDescription": { + "text": "Syntax error in a doxygen comment", + "markdown": "Syntax error in a doxygen comment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppDoxygenSyntaxError", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UselessComparisonToIntegralConstant", + "shortDescription": { + "text": "Comparison to integral constant is useless" + }, + "fullDescription": { + "text": "Comparison to integral constant is useless; the constant is outside the range of the target type", + "markdown": "Comparison to integral constant is useless; the constant is outside the range of the target type" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UselessComparisonToIntegralConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantElseKeyword", + "shortDescription": { + "text": "Redundant 'else' keyword" + }, + "fullDescription": { + "text": "Redundant 'else' keyword", + "markdown": "Redundant 'else' keyword" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRedundantElseKeyword", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Redundancies in Code", + "index": 34, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPackedNonPod", + "shortDescription": { + "text": "packed-non-pod clang diagnostic" + }, + "fullDescription": { + "text": "-Wpacked-non-pod clang diagnostic · Learn more", + "markdown": "-Wpacked-non-pod clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpacked-non-pod)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPackedNonPod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesSpecialMemberFunctions", + "shortDescription": { + "text": "cppcoreguidelines-special-member-functions clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-special-member-functions clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-special-member-functions clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/special-member-functions.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesSpecialMemberFunctions", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyConstructor", + "shortDescription": { + "text": "Empty constructor" + }, + "fullDescription": { + "text": "Empty public constructor declaration with no parameters is redundant. The compiler generates the same by default. Learn more...", + "markdown": "Empty public constructor declaration with no parameters is redundant. The compiler generates the same by default. [Learn more...](https://www.jetbrains.com/help/rider/EmptyConstructor.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "EmptyConstructor", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringIndexOfIsCultureSpecific.2", + "shortDescription": { + "text": "String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)" + }, + "fullDescription": { + "text": "$s$.IndexOf($sarg$, $iarg1$) Learn more...", + "markdown": "$s$.IndexOf($sarg$, $iarg1$) [Learn more...](https://www.jetbrains.com/help/rider/StringIndexOfIsCultureSpecific.2.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringIndexOfIsCultureSpecific.2", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneUnsafeFunctions", + "shortDescription": { + "text": "bugprone-unsafe-functions clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-unsafe-functions clang-tidy check · Learn more", + "markdown": "bugprone-unsafe-functions clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/unsafe-functions.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneUnsafeFunctions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesSlicing", + "shortDescription": { + "text": "cppcoreguidelines-slicing clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-slicing clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-slicing clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/slicing.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesSlicing", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringIndexOfIsCultureSpecific.3", + "shortDescription": { + "text": "String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)" + }, + "fullDescription": { + "text": "$s$.IndexOf($sarg$, $iarg1$, $iarg2$) Learn more...", + "markdown": "$s$.IndexOf($sarg$, $iarg1$, $iarg2$) [Learn more...](https://www.jetbrains.com/help/rider/StringIndexOfIsCultureSpecific.3.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringIndexOfIsCultureSpecific.3", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMixPackoffset", + "shortDescription": { + "text": "mix-packoffset clang diagnostic" + }, + "fullDescription": { + "text": "-Wmix-packoffset clang diagnostic · Learn more", + "markdown": "-Wmix-packoffset clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmix-packoffset)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMixPackoffset", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringIndexOfIsCultureSpecific.1", + "shortDescription": { + "text": "String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific)" + }, + "fullDescription": { + "text": "$s$.IndexOf($sarg$) Learn more...", + "markdown": "$s$.IndexOf($sarg$) [Learn more...](https://www.jetbrains.com/help/rider/StringIndexOfIsCultureSpecific.1.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringIndexOfIsCultureSpecific.1", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscMisleadingBidirectional", + "shortDescription": { + "text": "misc-misleading-bidirectional clang-tidy check" + }, + "fullDescription": { + "text": "misc-misleading-bidirectional clang-tidy check · Learn more", + "markdown": "misc-misleading-bidirectional clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/misleading-bidirectional.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyMiscMisleadingBidirectional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityConvertMemberFunctionsToStatic", + "shortDescription": { + "text": "readability-convert-member-functions-to-static clang-tidy check" + }, + "fullDescription": { + "text": "readability-convert-member-functions-to-static clang-tidy check · Learn more", + "markdown": "readability-convert-member-functions-to-static clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/convert-member-functions-to-static.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityConvertMemberFunctionsToStatic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticMemberInGenericType", + "shortDescription": { + "text": "Static field or auto-property in generic type" + }, + "fullDescription": { + "text": "Static field or auto-property in generic type may result in state duplication per each generic type instantiation Learn more...", + "markdown": "Static field or auto-property in generic type may result in state duplication per each generic type instantiation [Learn more...](https://www.jetbrains.com/help/rider/StaticMemberInGenericType.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StaticMemberInGenericType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUndefinedArmZa", + "shortDescription": { + "text": "undefined-arm-za clang diagnostic" + }, + "fullDescription": { + "text": "-Wundefined-arm-za clang diagnostic · Learn more", + "markdown": "-Wundefined-arm-za clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wundefined-arm-za)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUndefinedArmZa", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticReservedMacroIdentifier", + "shortDescription": { + "text": "reserved-macro-identifier clang diagnostic" + }, + "fullDescription": { + "text": "-Wreserved-macro-identifier clang diagnostic · Learn more", + "markdown": "-Wreserved-macro-identifier clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wreserved-macro-identifier)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticReservedMacroIdentifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppVararg", + "shortDescription": { + "text": "hicpp-vararg clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-vararg clang-tidy check · Learn more", + "markdown": "hicpp-vararg clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/vararg.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppVararg", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscDefinitionsInHeaders", + "shortDescription": { + "text": "misc-definitions-in-headers clang-tidy check" + }, + "fullDescription": { + "text": "misc-definitions-in-headers clang-tidy check · Learn more", + "markdown": "misc-definitions-in-headers clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/definitions-in-headers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyMiscDefinitionsInHeaders", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantUsingDirective.Global", + "shortDescription": { + "text": "Redundant global using directive" + }, + "fullDescription": { + "text": "Global using directive is not required by the code and can be safely removed Learn more...", + "markdown": "Global using directive is not required by the code and can be safely removed [Learn more...](https://www.jetbrains.com/help/rider/RedundantUsingDirective.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantUsingDirective.Global", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseIndexedProperty", + "shortDescription": { + "text": "Use indexed property" + }, + "fullDescription": { + "text": "Use indexed property in COM import types instead of the accessor usage", + "markdown": "Use indexed property in COM import types instead of the accessor usage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseIndexedProperty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyMiscNewDeleteOverloads", + "shortDescription": { + "text": "misc-new-delete-overloads clang-tidy check" + }, + "fullDescription": { + "text": "misc-new-delete-overloads clang-tidy check · Learn more", + "markdown": "misc-new-delete-overloads clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/new-delete-overloads.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyMiscNewDeleteOverloads", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1049FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Simplify boolean comparison" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1049FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDeprecatedEnumFloatConversion", + "shortDescription": { + "text": "deprecated-enum-float-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wdeprecated-enum-float-conversion clang diagnostic · Learn more", + "markdown": "-Wdeprecated-enum-float-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdeprecated-enum-float-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDeprecatedEnumFloatConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantComplexityInComparison", + "shortDescription": { + "text": "Expression can be simplified" + }, + "fullDescription": { + "text": "Expression can be simplified", + "markdown": "Expression can be simplified" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRedundantComplexityInComparison", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticRangeLoopBindReference", + "shortDescription": { + "text": "range-loop-bind-reference clang diagnostic" + }, + "fullDescription": { + "text": "-Wrange-loop-bind-reference clang diagnostic · Learn more", + "markdown": "-Wrange-loop-bind-reference clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wrange-loop-bind-reference)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticRangeLoopBindReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.LoadSceneWrongIndex", + "shortDescription": { + "text": "The index is missing in the build settings" + }, + "fullDescription": { + "text": "There is no scene with the same index in the Unity build settings.", + "markdown": "There is no scene with the same index in the Unity build settings." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.LoadSceneWrongIndex", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity", + "index": 18, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSuspiciousReallocUsage", + "shortDescription": { + "text": "bugprone-suspicious-realloc-usage clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-suspicious-realloc-usage clang-tidy check · Learn more", + "markdown": "bugprone-suspicious-realloc-usage clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/suspicious-realloc-usage.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSuspiciousReallocUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringCompareToIsCultureSpecific", + "shortDescription": { + "text": "String.CompareTo is culture-specific" + }, + "fullDescription": { + "text": "$s1$.CompareTo($s2$) Learn more...", + "markdown": "$s1$.CompareTo($s2$) [Learn more...](https://www.jetbrains.com/help/rider/StringCompareToIsCultureSpecific.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringCompareToIsCultureSpecific", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EventNeverInvoked", + "shortDescription": { + "text": "Event never invoked" + }, + "fullDescription": { + "text": "Event never invoked. Note that in C# this warning is the compiler warning CS0067 and is not configured here.", + "markdown": "Event never invoked. Note that in C# this warning is the compiler warning CS0067 and is not configured here." + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "EventNeverInvoked", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxCocoaNSAutoreleasePool", + "shortDescription": { + "text": "osx.cocoa.NSAutoreleasePool clang static analyzer check" + }, + "fullDescription": { + "text": "osx.cocoa.NSAutoreleasePool clang static analyzer check · Learn more", + "markdown": "osx.cocoa.NSAutoreleasePool clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxCocoaNSAutoreleasePool", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticOverridingMethodMismatch", + "shortDescription": { + "text": "overriding-method-mismatch clang diagnostic" + }, + "fullDescription": { + "text": "-Woverriding-method-mismatch clang diagnostic · Learn more", + "markdown": "-Woverriding-method-mismatch clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#woverriding-method-mismatch)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticOverridingMethodMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeObjectCreationWhenTypeNotEvident", + "shortDescription": { + "text": "Use preferred style of 'new' expression when created type is not evident" + }, + "fullDescription": { + "text": "Add or remove explicit type specification in 'new' expression when type is not evident from the usage Learn more...", + "markdown": "Add or remove explicit type specification in 'new' expression when type is not evident from the usage [Learn more...](https://www.jetbrains.com/help/rider/ArrangeObjectCreationWhenTypeNotEvident.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ArrangeObjectCreationWhenTypeNotEvident", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyForStatement", + "shortDescription": { + "text": "Empty 'for' loop is redundant" + }, + "fullDescription": { + "text": "Empty 'for' loop is redundant Learn more...", + "markdown": "Empty 'for' loop is redundant [Learn more...](https://www.jetbrains.com/help/rider/EmptyForStatement.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "EmptyForStatement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Asp.NotResolved", + "shortDescription": { + "text": "Unknown symbol" + }, + "fullDescription": { + "text": "Unknown symbol in ASP.NET and related technologies", + "markdown": "Unknown symbol in ASP.NET and related technologies" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "Asp.NotResolved", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnsupportedFriend", + "shortDescription": { + "text": "unsupported-friend clang diagnostic" + }, + "fullDescription": { + "text": "-Wunsupported-friend clang diagnostic · Learn more", + "markdown": "-Wunsupported-friend clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunsupported-friend)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnsupportedFriend", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSpuriouslyWakeUpFunctions", + "shortDescription": { + "text": "bugprone-spuriously-wake-up-functions clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-spuriously-wake-up-functions clang-tidy check · Learn more", + "markdown": "bugprone-spuriously-wake-up-functions clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSpuriouslyWakeUpFunctions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAndroidCloexecAccept4", + "shortDescription": { + "text": "android-cloexec-accept4 clang-tidy check" + }, + "fullDescription": { + "text": "android-cloexec-accept4 clang-tidy check · Learn more", + "markdown": "android-cloexec-accept4 clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/android/cloexec-accept4.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAndroidCloexecAccept4", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxCocoaDealloc", + "shortDescription": { + "text": "osx.cocoa.Dealloc clang static analyzer check" + }, + "fullDescription": { + "text": "osx.cocoa.Dealloc clang static analyzer check · Learn more", + "markdown": "osx.cocoa.Dealloc clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxCocoaDealloc", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntDivisionByZero", + "shortDescription": { + "text": "Division by zero in at least one execution path" + }, + "fullDescription": { + "text": "Division by zero in at least one execution path", + "markdown": "Division by zero in at least one execution path" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IntDivisionByZero", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticEnumTooLarge", + "shortDescription": { + "text": "enum-too-large clang diagnostic" + }, + "fullDescription": { + "text": "-Wenum-too-large clang diagnostic · Learn more", + "markdown": "-Wenum-too-large clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wenum-too-large)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticEnumTooLarge", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticProfileInstrUnprofiled", + "shortDescription": { + "text": "profile-instr-unprofiled clang diagnostic" + }, + "fullDescription": { + "text": "-Wprofile-instr-unprofiled clang diagnostic · Learn more", + "markdown": "-Wprofile-instr-unprofiled clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wprofile-instr-unprofiled)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticProfileInstrUnprofiled", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCoreUninitializedBranch", + "shortDescription": { + "text": "core.uninitialized.Branch clang static analyzer check" + }, + "fullDescription": { + "text": "core.uninitialized.Branch clang static analyzer check · Learn more", + "markdown": "core.uninitialized.Branch clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCoreUninitializedBranch", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxCocoaVariadicMethodTypes", + "shortDescription": { + "text": "osx.cocoa.VariadicMethodTypes clang static analyzer check" + }, + "fullDescription": { + "text": "osx.cocoa.VariadicMethodTypes clang static analyzer check · Learn more", + "markdown": "osx.cocoa.VariadicMethodTypes clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxCocoaVariadicMethodTypes", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1005FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Simplify nested using statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1005FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyLlvmlibcCalleeNamespace", + "shortDescription": { + "text": "llvmlibc-callee-namespace clang-tidy check" + }, + "fullDescription": { + "text": "llvmlibc-callee-namespace clang-tidy check · Learn more", + "markdown": "llvmlibc-callee-namespace clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/llvmlibc/callee-namespace.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyLlvmlibcCalleeNamespace", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyAbseilDurationComparison", + "shortDescription": { + "text": "abseil-duration-comparison clang-tidy check" + }, + "fullDescription": { + "text": "abseil-duration-comparison clang-tidy check · Learn more", + "markdown": "abseil-duration-comparison clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/abseil/duration-comparison.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyAbseilDurationComparison", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAutoVarId", + "shortDescription": { + "text": "auto-var-id clang diagnostic" + }, + "fullDescription": { + "text": "-Wauto-var-id clang diagnostic · Learn more", + "markdown": "-Wauto-var-id clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wauto-var-id)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAutoVarId", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseCollectionExpression", + "shortDescription": { + "text": "Use collection expression syntax" + }, + "fullDescription": { + "text": "Suggest to replace collection object construction and items additions with C# 12 collection expression syntax Learn more...", + "markdown": "Suggest to replace collection object construction and items additions with C# 12 collection expression syntax [Learn more...](https://www.jetbrains.com/help/rider/UseCollectionExpression.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseCollectionExpression", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUnmatchedPragmaRegionDirective", + "shortDescription": { + "text": "Missing a matching '#pragma endregion' directive" + }, + "fullDescription": { + "text": "A '#pragma region' directive is missing a matching '#pragma endregion' directive", + "markdown": "A '#pragma region' directive is missing a matching '#pragma endregion' directive" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppUnmatchedPragmaRegionDirective", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSingleOrDefault.4", + "shortDescription": { + "text": "Replace with SingleOrDefault($args$)" + }, + "fullDescription": { + "text": "$expr$ && $seq$.Any($args$) ? $seq$.Single($args$) : default($T$)", + "markdown": "$expr$ \\&\\& $seq$.Any($args$) ? $seq$.Single($args$) : default($T$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSingleOrDefault.4", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSingleOrDefault.2", + "shortDescription": { + "text": "Replace with SingleOrDefault($args$)" + }, + "fullDescription": { + "text": "$expr$ && $seq$.Any($args$) ? $seq$.Single($args$) : null", + "markdown": "$expr$ \\&\\& $seq$.Any($args$) ? $seq$.Single($args$) : null" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSingleOrDefault.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSingleOrDefault.3", + "shortDescription": { + "text": "Replace with SingleOrDefault($args$)" + }, + "fullDescription": { + "text": "$seq$.Any($args$) ? $seq$.Single($args$) : default($T$)", + "markdown": "$seq$.Any($args$) ? $seq$.Single($args$) : default($T$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSingleOrDefault.3", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticModuleFileExtension", + "shortDescription": { + "text": "module-file-extension clang diagnostic" + }, + "fullDescription": { + "text": "-Wmodule-file-extension clang diagnostic · Learn more", + "markdown": "-Wmodule-file-extension clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmodule-file-extension)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticModuleFileExtension", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Unity.BurstLoadingManagedType", + "shortDescription": { + "text": "Loading managed type is not supported" + }, + "fullDescription": { + "text": "Loading managed type is not supported", + "markdown": "Loading managed type is not supported" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Unity.BurstLoadingManagedType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Unity Burst Compiler Warnings", + "index": 57, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppFunctionSize", + "shortDescription": { + "text": "hicpp-function-size clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-function-size clang-tidy check · Learn more", + "markdown": "hicpp-function-size clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/function-size.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppFunctionSize", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnTypeCanBeEnumerable.Local", + "shortDescription": { + "text": "Return type can be IEnumerable (private accessibility)" + }, + "fullDescription": { + "text": "All usages of a method (or read-only property/indexer) use returned value as IEnumerable, but it is declared with more specific type (e.g. List) Learn more...", + "markdown": "All usages of a method (or read-only property/indexer) use returned value as IEnumerable, but it is declared with more specific type (e.g. List) [Learn more...](https://www.jetbrains.com/help/rider/ReturnTypeCanBeEnumerable.Local.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReturnTypeCanBeEnumerable.Local", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnusedMemberFunction", + "shortDescription": { + "text": "unused-member-function clang diagnostic" + }, + "fullDescription": { + "text": "-Wunused-member-function clang diagnostic · Learn more", + "markdown": "-Wunused-member-function clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunused-member-function)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnusedMemberFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExtraTokens", + "shortDescription": { + "text": "extra-tokens clang diagnostic" + }, + "fullDescription": { + "text": "-Wextra-tokens clang diagnostic · Learn more", + "markdown": "-Wextra-tokens clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wextra-tokens)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExtraTokens", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithSingleOrDefault.1", + "shortDescription": { + "text": "Replace with SingleOrDefault($args$)" + }, + "fullDescription": { + "text": "$seq$.Any($args$) ? $seq$.Single($args$) : null", + "markdown": "$seq$.Any($args$) ? $seq$.Single($args$) : null" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithSingleOrDefault.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticProblemInText", + "shortDescription": { + "text": "Cannot access static symbol in text argument" + }, + "fullDescription": { + "text": "Cannot access static symbol in text argument", + "markdown": "Cannot access static symbol in text argument" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StaticProblemInText", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RS2000", + "shortDescription": { + "text": "RoslynAnalyzers Add analyzer diagnostic IDs to analyzer release" + }, + "fullDescription": { + "text": "All supported analyzer diagnostic IDs should be part of an analyzer release.", + "markdown": "All supported analyzer diagnostic IDs should be part of an analyzer release." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RS2000", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RouteTemplates.ActionRoutePrefixCanBeExtractedToControllerRoute", + "shortDescription": { + "text": "Action's route prefix can be extracted to controller's route" + }, + "fullDescription": { + "text": "When all controller's actions' route templates have same prefixes, it's possible to extract their common prefix to controller's route template", + "markdown": "When all controller's actions' route templates have same prefixes, it's possible to extract their common prefix to controller's route template" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RouteTemplates.ActionRoutePrefixCanBeExtractedToControllerRoute", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "ASP.NET route templates/Code Notification", + "index": 48, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticAixCompat", + "shortDescription": { + "text": "aix-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Waix-compat clang diagnostic · Learn more", + "markdown": "-Waix-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#waix-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticAixCompat", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InterpolatedStringExpressionIsNotIFormattable", + "shortDescription": { + "text": "Formatting is specified, but interpolated string expression is not IFormattable" + }, + "fullDescription": { + "text": "Formatting is specified, but interpolated string expression is not IFormattable", + "markdown": "Formatting is specified, but interpolated string expression is not IFormattable" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InterpolatedStringExpressionIsNotIFormattable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InvertIf", + "shortDescription": { + "text": "Invert 'if' statement to reduce nesting" + }, + "fullDescription": { + "text": "Invert 'if' statement to reduce nesting Learn more...", + "markdown": "Invert 'if' statement to reduce nesting [Learn more...](https://www.jetbrains.com/help/rider/InvertIf.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "InvertIf", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedField.Compiler", + "shortDescription": { + "text": "Field is never used" + }, + "fullDescription": { + "text": "Field is never used (compiler warning) Learn more...", + "markdown": "Field is never used (compiler warning) [Learn more...](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0169)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "UnusedField.Compiler", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Compiler Warnings", + "index": 27, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMicrosoftStringLiteralFromPredefined", + "shortDescription": { + "text": "microsoft-string-literal-from-predefined clang diagnostic" + }, + "fullDescription": { + "text": "-Wmicrosoft-string-literal-from-predefined clang diagnostic · Learn more", + "markdown": "-Wmicrosoft-string-literal-from-predefined clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmicrosoft-string-literal-from-predefined)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMicrosoftStringLiteralFromPredefined", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyFuchsiaOverloadedOperator", + "shortDescription": { + "text": "fuchsia-overloaded-operator clang-tidy check" + }, + "fullDescription": { + "text": "fuchsia-overloaded-operator clang-tidy check · Learn more", + "markdown": "fuchsia-overloaded-operator clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/fuchsia/overloaded-operator.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyFuchsiaOverloadedOperator", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCastOfSelType", + "shortDescription": { + "text": "cast-of-sel-type clang diagnostic" + }, + "fullDescription": { + "text": "-Wcast-of-sel-type clang diagnostic · Learn more", + "markdown": "-Wcast-of-sel-type clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wcast-of-sel-type)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCastOfSelType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntVariableOverflowInUncheckedContext", + "shortDescription": { + "text": "Possible overflow in unchecked context" + }, + "fullDescription": { + "text": "Possible overflow in unchecked context", + "markdown": "Possible overflow in unchecked context" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IntVariableOverflowInUncheckedContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectCreationAsStatement", + "shortDescription": { + "text": "Possible unassigned object created by 'new' expression" + }, + "fullDescription": { + "text": "Object created by 'new' expression is possibly not assigned anywhere", + "markdown": "Object created by 'new' expression is possibly not assigned anywhere" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectCreationAsStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantNullnessAttributeWithNullableReferenceTypes", + "shortDescription": { + "text": "[NotNull] or [CanBeNull] attribute is applied to a type that already has the same annotation from nullable reference types" + }, + "fullDescription": { + "text": "[NotNull] or [CanBeNull] attribute has no effect because the target type already has the same annotation from nullable reference types", + "markdown": "\\[NotNull\\] or \\[CanBeNull\\] attribute has no effect because the target type already has the same annotation from nullable reference types" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantNullnessAttributeWithNullableReferenceTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCoreUninitializedNewArraySize", + "shortDescription": { + "text": "core.uninitialized.NewArraySize clang static analyzer check" + }, + "fullDescription": { + "text": "core.uninitialized.NewArraySize clang static analyzer check · Learn more", + "markdown": "core.uninitialized.NewArraySize clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCoreUninitializedNewArraySize", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StreamReadReturnValueIgnored", + "shortDescription": { + "text": "Actual number of bytes read by 'Stream.Read()' is ignored" + }, + "fullDescription": { + "text": "Use 'Stream.ReadExactly()' instead of 'Read()' to ensure that the number of bytes read from the stream is equal to the expected value", + "markdown": "Use 'Stream.ReadExactly()' instead of 'Read()' to ensure that the number of bytes read from the stream is equal to the expected value" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StreamReadReturnValueIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1130", + "shortDescription": { + "text": "RoslynAnalyzers Bitwise operation on enum without Flags attribute" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1130", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantExportKeyword", + "shortDescription": { + "text": "Keyword 'export' is redundant, because there is enclosing export declaration" + }, + "fullDescription": { + "text": "Keyword 'export' is redundant, because there is enclosing export declaration", + "markdown": "Keyword 'export' is redundant, because there is enclosing export declaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppRedundantExportKeyword", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Redundancies in Code", + "index": 34, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Xaml.PathError", + "shortDescription": { + "text": "Path error" + }, + "fullDescription": { + "text": "Path error", + "markdown": "Path error" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Xaml.PathError", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XAML/Potential Code Quality Issues", + "index": 45, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticC2xCompat", + "shortDescription": { + "text": "c2x-compat clang diagnostic" + }, + "fullDescription": { + "text": "-Wc2x-compat clang diagnostic · Learn more", + "markdown": "-Wc2x-compat clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc2x-compat)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticC2xCompat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPerformanceFasterStringFind", + "shortDescription": { + "text": "performance-faster-string-find clang-tidy check" + }, + "fullDescription": { + "text": "performance-faster-string-find clang-tidy check · Learn more", + "markdown": "performance-faster-string-find clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance/faster-string-find.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyPerformanceFasterStringFind", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionIsAlwaysTrueOrFalse", + "shortDescription": { + "text": "Expression is always 'true' or always 'false'" + }, + "fullDescription": { + "text": "Value of a boolean expression is always the same at this point Learn more...", + "markdown": "Value of a boolean expression is always the same at this point [Learn more...](https://www.jetbrains.com/help/rider/ConditionIsAlwaysTrueOrFalse.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "ConditionIsAlwaysTrueOrFalse", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStringPlusInt", + "shortDescription": { + "text": "string-plus-int clang diagnostic" + }, + "fullDescription": { + "text": "-Wstring-plus-int clang diagnostic · Learn more", + "markdown": "-Wstring-plus-int clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstring-plus-int)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStringPlusInt", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstructorInitializerLoop", + "shortDescription": { + "text": "Possible cyclic constructor call" + }, + "fullDescription": { + "text": "Possible cyclic constructor call Learn more...", + "markdown": "Possible cyclic constructor call [Learn more...](https://www.jetbrains.com/help/rider/ConstructorInitializerLoop.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "ConstructorInitializerLoop", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithFirstOrDefault", + "shortDescription": { + "text": "Replace with FirstOrDefault($args$)" + }, + "fullDescription": { + "text": "If ($seq$.Any($args$), $seq$.First($args$), Nothing)", + "markdown": "If ($seq$.Any($args$), $seq$.First($args$), Nothing)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithFirstOrDefault", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1128", + "shortDescription": { + "text": "RoslynAnalyzers Use coalesce expression" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1128", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1129", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant field initialization" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1129", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppUseAssociativeContains", + "shortDescription": { + "text": "'contains' member function can be used" + }, + "fullDescription": { + "text": "'contains' member function can be used", + "markdown": "'contains' member function can be used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppUseAssociativeContains", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1124", + "shortDescription": { + "text": "RoslynAnalyzers Inline local variable" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1124", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticMultichar", + "shortDescription": { + "text": "multichar clang diagnostic" + }, + "fullDescription": { + "text": "-Wmultichar clang diagnostic · Learn more", + "markdown": "-Wmultichar clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmultichar)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticMultichar", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1126", + "shortDescription": { + "text": "RoslynAnalyzers Add braces to if-else" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1126", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppMemberInit", + "shortDescription": { + "text": "hicpp-member-init clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-member-init clang-tidy check · Learn more", + "markdown": "hicpp-member-init clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/member-init.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppMemberInit", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1123", + "shortDescription": { + "text": "RoslynAnalyzers Add parentheses when necessary" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RCS1123", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.9", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.All(Function ($x$) $expr$ Is $expr2$)", + "markdown": "!$seq$.All(Function ($x$) $expr$ Is $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.9", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyReadabilityRedundantAccessSpecifiers", + "shortDescription": { + "text": "readability-redundant-access-specifiers clang-tidy check" + }, + "fullDescription": { + "text": "readability-redundant-access-specifiers clang-tidy check · Learn more", + "markdown": "readability-redundant-access-specifiers clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/redundant-access-specifiers.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyReadabilityRedundantAccessSpecifiers", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticInvalidOffsetof", + "shortDescription": { + "text": "invalid-offsetof clang diagnostic" + }, + "fullDescription": { + "text": "-Winvalid-offsetof clang diagnostic · Learn more", + "markdown": "-Winvalid-offsetof clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#winvalid-offsetof)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticInvalidOffsetof", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPrivateExtern", + "shortDescription": { + "text": "private-extern clang diagnostic" + }, + "fullDescription": { + "text": "-Wprivate-extern clang diagnostic · Learn more", + "markdown": "-Wprivate-extern clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wprivate-extern)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPrivateExtern", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.1", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.Any(Function ($x$) Not $expr$)", + "markdown": "!$seq$.Any(Function ($x$) Not $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.1", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.2", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.All(Function ($x$) Not $expr$)", + "markdown": "!$seq$.All(Function ($x$) Not $expr$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.2", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.3", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.Any(Function ($x$) $expr$ IsNot $expr2$)", + "markdown": "!$seq$.Any(Function ($x$) $expr$ IsNot $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.3", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.4", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.Any(Function ($x$) $expr$ <> $expr2$)", + "markdown": "!$seq$.Any(Function ($x$) $expr$ \\<\\> $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.4", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RazorErrors", + "shortDescription": { + "text": "Razor Errors" + }, + "fullDescription": { + "text": "Razor Errors", + "markdown": "Razor Errors" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "RazorErrors", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Razor/Non configurable", + "index": 107, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.5", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.All(Function ($x$) $expr$ IsNot $expr2$)", + "markdown": "!$seq$.All(Function ($x$) $expr$ IsNot $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.5", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.6", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.All(Function ($x$) $expr$ <> $expr2$)", + "markdown": "!$seq$.All(Function ($x$) $expr$ \\<\\> $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.6", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticStaticLocalInInline", + "shortDescription": { + "text": "static-local-in-inline clang diagnostic" + }, + "fullDescription": { + "text": "-Wstatic-local-in-inline clang diagnostic · Learn more", + "markdown": "-Wstatic-local-in-inline clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wstatic-local-in-inline)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticStaticLocalInInline", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.7", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.Any(Function ($x$) $expr$ Is $expr2$)", + "markdown": "!$seq$.Any(Function ($x$) $expr$ Is $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.7", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBSimplifyLinqExpression.8", + "shortDescription": { + "text": "Simplify expression" + }, + "fullDescription": { + "text": "!$seq$.Any(Function ($x$) $expr$ = $expr2$)", + "markdown": "!$seq$.Any(Function ($x$) $expr$ = $expr2$)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBSimplifyLinqExpression.8", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AccessRightsInText", + "shortDescription": { + "text": "Cannot access symbol in text argument" + }, + "fullDescription": { + "text": "Cannot access symbol in text argument", + "markdown": "Cannot access symbol in text argument" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AccessRightsInText", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticArcNonPodMemaccess", + "shortDescription": { + "text": "arc-non-pod-memaccess clang diagnostic" + }, + "fullDescription": { + "text": "-Warc-non-pod-memaccess clang diagnostic · Learn more", + "markdown": "-Warc-non-pod-memaccess clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#warc-non-pod-memaccess)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticArcNonPodMemaccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerSecuritySetgidSetuidOrder", + "shortDescription": { + "text": "security.SetgidSetuidOrder clang static analyzer check" + }, + "fullDescription": { + "text": "security.SetgidSetuidOrder clang static analyzer check · Learn more", + "markdown": "security.SetgidSetuidOrder clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerSecuritySetgidSetuidOrder", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1118", + "shortDescription": { + "text": "RoslynAnalyzers Mark local variable as const" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RCS1118", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1113", + "shortDescription": { + "text": "RoslynAnalyzers Use 'string.IsNullOrEmpty' method" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1113", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1114", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant delegate creation" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1114", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WebConfig.RedundantAddNamespaceTag", + "shortDescription": { + "text": "Redundant add namespace element" + }, + "fullDescription": { + "text": "Add namespace element is redundant because it duplicates another element of is cleared later and can be safely removed", + "markdown": "Add namespace element is redundant because it duplicates another element of is cleared later and can be safely removed" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WebConfig.RedundantAddNamespaceTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Web.Config/Redundancies in Code", + "index": 98, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticCpp11InlineNamespace", + "shortDescription": { + "text": "c++11-inline-namespace clang diagnostic" + }, + "fullDescription": { + "text": "-Wc++11-inline-namespace clang diagnostic · Learn more", + "markdown": "-Wc++11-inline-namespace clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wc-11-inline-namespace)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticCpp11InlineNamespace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1110", + "shortDescription": { + "text": "RoslynAnalyzers Declare type inside namespace" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1110", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1111", + "shortDescription": { + "text": "RoslynAnalyzers Add braces to switch section with multiple statements" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1111", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1112", + "shortDescription": { + "text": "RoslynAnalyzers Combine 'Enumerable.Where' method chain" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1112", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1151", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant cast" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1151", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EntityFramework.ClientSideDbFunctionCall", + "shortDescription": { + "text": "Database function must not be called in non-database context" + }, + "fullDescription": { + "text": "Reports database-only methods that can produce runtime exceptions when called outside the 'LINQ to Entities' context Learn more...", + "markdown": "Reports database-only methods that can produce runtime exceptions when called outside the 'LINQ to Entities' context [Learn more...](https://www.jetbrains.com/help/rider/EntityFramework.ClientSideDbFunctionCall.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EntityFramework.ClientSideDbFunctionCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Entity Framework", + "index": 37, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyModernizeMakeUnique", + "shortDescription": { + "text": "modernize-make-unique clang-tidy check" + }, + "fullDescription": { + "text": "modernize-make-unique clang-tidy check · Learn more", + "markdown": "modernize-make-unique clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/make-unique.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyModernizeMakeUnique", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppNonExplicitConvertingConstructor", + "shortDescription": { + "text": "Non-explicit converting constructor" + }, + "fullDescription": { + "text": "Non-explicit converting constructor Learn more...", + "markdown": "Non-explicit converting constructor [Learn more...](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-explicit)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppNonExplicitConvertingConstructor", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Common Practices and Code Improvements", + "index": 16, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleBuildUsingNamespace", + "shortDescription": { + "text": "google-build-using-namespace clang-tidy check" + }, + "fullDescription": { + "text": "google-build-using-namespace clang-tidy check · Learn more", + "markdown": "google-build-using-namespace clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/build-using-namespace.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleBuildUsingNamespace", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseDiscardAssignment", + "shortDescription": { + "text": "Use discard assignment" + }, + "fullDescription": { + "text": "Replace intentionally ignored variable declaration 'var _ = ...' with discard assignment '_ = ...'. Learn more...", + "markdown": "Replace intentionally ignored variable declaration 'var _ = ...' with discard assignment '_ = ...'. [Learn more...](https://www.jetbrains.com/help/rider/UseDiscardAssignment.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "UseDiscardAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleRuntimeInt", + "shortDescription": { + "text": "google-runtime-int clang-tidy check" + }, + "fullDescription": { + "text": "google-runtime-int clang-tidy check · Learn more", + "markdown": "google-runtime-int clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/runtime-int.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleRuntimeInt", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1146", + "shortDescription": { + "text": "RoslynAnalyzers Use conditional access" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1146", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1142", + "shortDescription": { + "text": "RoslynAnalyzers Add 'typeparam' element to documentation comment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1142", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1143", + "shortDescription": { + "text": "RoslynAnalyzers Simplify coalesce expression" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1143", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContractAnnotationNotParsed", + "shortDescription": { + "text": "Problem in contract annotation definition" + }, + "fullDescription": { + "text": "Input string in ContractAnnotation attribute could not be parsed Learn more...", + "markdown": "Input string in ContractAnnotation attribute could not be parsed [Learn more...](https://www.jetbrains.com/help/rider/ContractAnnotationNotParsed.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ContractAnnotationNotParsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Constraints Violations", + "index": 80, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1145", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant 'as' operator" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1145", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1140", + "shortDescription": { + "text": "RoslynAnalyzers Add exception to documentation comment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1140", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppRedundantDereferencingAndTakingAddress", + "shortDescription": { + "text": "Redundant dereferencing and taking address" + }, + "fullDescription": { + "text": "Redundant dereferencing and taking address", + "markdown": "Redundant dereferencing and taking address" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppRedundantDereferencingAndTakingAddress", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Redundancies in Code", + "index": 34, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticTautologicalBitwiseCompare", + "shortDescription": { + "text": "tautological-bitwise-compare clang diagnostic" + }, + "fullDescription": { + "text": "-Wtautological-bitwise-compare clang diagnostic · Learn more", + "markdown": "-Wtautological-bitwise-compare clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wtautological-bitwise-compare)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticTautologicalBitwiseCompare", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1141", + "shortDescription": { + "text": "RoslynAnalyzers Add 'param' element to documentation comment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1141", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBReplaceWithLastOrDefault", + "shortDescription": { + "text": "Replace with LastOrDefault($args$)" + }, + "fullDescription": { + "text": "If ($seq$.Any($args$), $seq$.Last($args$), Nothing)", + "markdown": "If ($seq$.Any($args$), $seq$.Last($args$), Nothing)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VBReplaceWithLastOrDefault", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WithExpressionInsteadOfInitializer", + "shortDescription": { + "text": "'with' expression is used instead of object initializer" + }, + "fullDescription": { + "text": "'with' expression applied to a newly created object instance results in unnecessary clone creation", + "markdown": "'with' expression applied to a newly created object instance results in unnecessary clone creation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "WithExpressionInsteadOfInitializer", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticExperimentalHeaderUnits", + "shortDescription": { + "text": "experimental-header-units clang diagnostic" + }, + "fullDescription": { + "text": "-Wexperimental-header-units clang diagnostic · Learn more", + "markdown": "-Wexperimental-header-units clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wexperimental-header-units)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticExperimentalHeaderUnits", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNullPointerSubtraction", + "shortDescription": { + "text": "null-pointer-subtraction clang diagnostic" + }, + "fullDescription": { + "text": "-Wnull-pointer-subtraction clang diagnostic · Learn more", + "markdown": "-Wnull-pointer-subtraction clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnull-pointer-subtraction)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNullPointerSubtraction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceObjectPatternWithVarPattern", + "shortDescription": { + "text": "Replace object pattern not performing any additional checks with 'var' pattern" + }, + "fullDescription": { + "text": "Replace '{ } x' object pattern not performing any additional checks with 'var x' pattern", + "markdown": "Replace '{ } x' object pattern not performing any additional checks with 'var x' pattern" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceObjectPatternWithVarPattern", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitArrayCreation", + "shortDescription": { + "text": "Redundant explicit type in array creation" + }, + "fullDescription": { + "text": "When array type can be inferred from the initializer, you can use an implicitly-typed array Learn more...", + "markdown": "When array type can be inferred from the initializer, you can use an implicitly-typed array [Learn more...](https://www.jetbrains.com/help/rider/RedundantExplicitArrayCreation.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "RedundantExplicitArrayCreation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyIIf", + "shortDescription": { + "text": "Simplify 'IIf'" + }, + "fullDescription": { + "text": "'IIf' contains 'True' or 'False' in result branch, for example \r\n IIf(condition, True, elseBranch)\r\n IIf(condition, thenBranch : True)", + "markdown": "'IIf' contains 'True' or 'False' in result branch, for example\n\n```\n\r\n IIf(condition, True, elseBranch)\r\n IIf(condition, thenBranch : True)\r\n \n```" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyIIf", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Common Practices and Code Improvements", + "index": 40, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1139", + "shortDescription": { + "text": "RoslynAnalyzers Add summary element to documentation comment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1139", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1135", + "shortDescription": { + "text": "RoslynAnalyzers Declare enum member with zero value (when enum has FlagsAttribute)" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1135", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1136", + "shortDescription": { + "text": "RoslynAnalyzers Merge switch sections with equivalent content" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1136", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1138", + "shortDescription": { + "text": "RoslynAnalyzers Add summary to documentation comment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1138", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PartialTypeWithSinglePart", + "shortDescription": { + "text": "Redundant 'partial' modifier on type declaration" + }, + "fullDescription": { + "text": "Class is declared as 'partial', but has only one part Learn more...", + "markdown": "Class is declared as 'partial', but has only one part [Learn more...](https://www.jetbrains.com/help/rider/PartialTypeWithSinglePart.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "PartialTypeWithSinglePart", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Symbol Declarations", + "index": 36, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1132", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant overriding member" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1132", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1133", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant Dispose/Close call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1133", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PossibleInvalidOperationExceptionCollectionWasModified", + "shortDescription": { + "text": "Possible 'System.InvalidOperationException: Collection was modified'" + }, + "fullDescription": { + "text": "Modifying the collection could result in a 'System.InvalidOperationException: Collection was modified' in the next foreach iteration", + "markdown": "Modifying the collection could result in a 'System.InvalidOperationException: Collection was modified' in the next foreach iteration" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PossibleInvalidOperationExceptionCollectionWasModified", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1134", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant statement" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1134", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticUnknownPragmas", + "shortDescription": { + "text": "unknown-pragmas clang diagnostic" + }, + "fullDescription": { + "text": "-Wunknown-pragmas clang diagnostic · Learn more", + "markdown": "-Wunknown-pragmas clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wunknown-pragmas)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticUnknownPragmas", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MemberCanBeInternal", + "shortDescription": { + "text": "Member or type can be made internal (friend)" + }, + "fullDescription": { + "text": "Member or type can be made internal (friend)", + "markdown": "Member or type can be made internal (friend)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MemberCanBeInternal", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticDisabledMacroExpansion", + "shortDescription": { + "text": "disabled-macro-expansion clang diagnostic" + }, + "fullDescription": { + "text": "-Wdisabled-macro-expansion clang diagnostic · Learn more", + "markdown": "-Wdisabled-macro-expansion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wdisabled-macro-expansion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticDisabledMacroExpansion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneSharedPtrArrayMismatch", + "shortDescription": { + "text": "bugprone-shared-ptr-array-mismatch clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-shared-ptr-array-mismatch clang-tidy check · Learn more", + "markdown": "bugprone-shared-ptr-array-mismatch clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneSharedPtrArrayMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyHicppNamedParameter", + "shortDescription": { + "text": "hicpp-named-parameter clang-tidy check" + }, + "fullDescription": { + "text": "hicpp-named-parameter clang-tidy check · Learn more", + "markdown": "hicpp-named-parameter clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/hicpp/named-parameter.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyHicppNamedParameter", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseFormatSpecifierInFormatString", + "shortDescription": { + "text": "Use format specifier in format strings" + }, + "fullDescription": { + "text": "'.ToString()' call can be replaced with format specifier Learn more...", + "markdown": "'.ToString()' call can be replaced with format specifier [Learn more...](https://www.jetbrains.com/help/rider/UseFormatSpecifierInFormatString.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseFormatSpecifierInFormatString", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingSpace", + "shortDescription": { + "text": "Incorrect spacing (space is missing elsewhere)" + }, + "fullDescription": { + "text": "Space is missing elsewhere Learn more...", + "markdown": "Space is missing elsewhere [Learn more...](https://www.jetbrains.com/help/rider/MissingSpace.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MissingSpace", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Formatting", + "index": 24, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator", + "shortDescription": { + "text": "Foreach loop can be converted into LINQ-expression but another 'GetEnumerator' method will be used" + }, + "fullDescription": { + "text": "A 'foreach' ('For Each' for VB.NET) can be converted into a LINQ-expression but another 'GetEnumerator' method will be used", + "markdown": "A 'foreach' ('For Each' for VB.NET) can be converted into a LINQ-expression but another 'GetEnumerator' method will be used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Language Usage Opportunities", + "index": 7, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerOsxCocoaMissingSuperCall", + "shortDescription": { + "text": "osx.cocoa.MissingSuperCall clang static analyzer check" + }, + "fullDescription": { + "text": "osx.cocoa.MissingSuperCall clang static analyzer check · Learn more", + "markdown": "osx.cocoa.MissingSuperCall clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerOsxCocoaMissingSuperCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HeuristicUnreachableCode", + "shortDescription": { + "text": "Heuristically unreachable code" + }, + "fullDescription": { + "text": "Heuristically unreachable code detected Learn more...", + "markdown": "Heuristically unreachable code detected [Learn more...](https://www.jetbrains.com/help/rider/HeuristicUnreachableCode.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "HeuristicUnreachableCode", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSuppressNullableWarningExpression", + "shortDescription": { + "text": "Redundant nullable warning suppression expression" + }, + "fullDescription": { + "text": "Nullable warning suppression expression does not suppress any warnings and is applied to an already non-nullable operand Learn more...", + "markdown": "Nullable warning suppression expression does not suppress any warnings and is applied to an already non-nullable operand [Learn more...](https://www.jetbrains.com/help/rider/RedundantSuppressNullableWarningExpression.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSuppressNullableWarningExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Redundancies in Code", + "index": 23, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyBugproneParentVirtualCall", + "shortDescription": { + "text": "bugprone-parent-virtual-call clang-tidy check" + }, + "fullDescription": { + "text": "bugprone-parent-virtual-call clang-tidy check · Learn more", + "markdown": "bugprone-parent-virtual-call clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone/parent-virtual-call.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyBugproneParentVirtualCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrangeAccessorOwnerBody", + "shortDescription": { + "text": "Use preferred body style (convert into property, indexer, or event with preferred body style)" + }, + "fullDescription": { + "text": "Use expression or block body Learn more...", + "markdown": "Use expression or block body [Learn more...](https://www.jetbrains.com/help/rider/ArrangeAccessorOwnerBody.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrangeAccessorOwnerBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Syntax Style", + "index": 21, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotAccessedPositionalProperty.Global", + "shortDescription": { + "text": "Non-accessed positional property (non-private accessibility)" + }, + "fullDescription": { + "text": "Positional property is never accessed for reading Learn more...", + "markdown": "Positional property is never accessed for reading [Learn more...](https://www.jetbrains.com/help/rider/NotAccessedPositionalProperty.Global.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NotAccessedPositionalProperty.Global", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticIncompatiblePropertyType", + "shortDescription": { + "text": "incompatible-property-type clang diagnostic" + }, + "fullDescription": { + "text": "-Wincompatible-property-type clang diagnostic · Learn more", + "markdown": "-Wincompatible-property-type clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-property-type)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticIncompatiblePropertyType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Mvc.ViewNotResolved", + "shortDescription": { + "text": "MVC (unknown view)" + }, + "fullDescription": { + "text": "Unknown ASP.NET MVC View Learn more...", + "markdown": "Unknown ASP.NET MVC View [Learn more...](https://www.jetbrains.com/help/rider/Mvc.ViewNotResolved.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Mvc.ViewNotResolved", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Aspx/Potential Code Quality Issues", + "index": 64, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBadAngleBracketsSpaces", + "shortDescription": { + "text": "Incorrect spacing (around angle brackets)" + }, + "fullDescription": { + "text": "Around angle brackets", + "markdown": "Around angle brackets" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppBadAngleBracketsSpaces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Formatting", + "index": 28, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyGoogleReadabilityAvoidUnderscoreInGoogletestName", + "shortDescription": { + "text": "google-readability-avoid-underscore-in-googletest-name clang-tidy check" + }, + "fullDescription": { + "text": "google-readability-avoid-underscore-in-googletest-name clang-tidy check · Learn more", + "markdown": "google-readability-avoid-underscore-in-googletest-name clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/google/readability-avoid-underscore-in-googletest-name.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyGoogleReadabilityAvoidUnderscoreInGoogletestName", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangAnalyzerCplusplusPureVirtualCall", + "shortDescription": { + "text": "cplusplus.PureVirtualCall clang static analyzer check" + }, + "fullDescription": { + "text": "cplusplus.PureVirtualCall clang static analyzer check · Learn more", + "markdown": "cplusplus.PureVirtualCall clang static analyzer check · [Learn more](https://clang-analyzer.llvm.org/available_checks.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppClangTidyClangAnalyzerCplusplusPureVirtualCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Static Analyzer Checks", + "index": 32, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppBoostFormatMixedArgs", + "shortDescription": { + "text": "Positional and non-positional arguments in the same boost::format call" + }, + "fullDescription": { + "text": "An argument of boost::format should contain either positional (%N%, %|N$...|) or serial (%|...|, %s) arguments, not both", + "markdown": "An argument of boost::format should contain either positional (%N%, %\\|N$...\\|) or serial (%\\|...\\|, %s) arguments, not both" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CppBoostFormatMixedArgs", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1106", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty destructor" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1106", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1107", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant 'ToCharArray' call" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1107", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppEnforceFunctionDeclarationStyle", + "shortDescription": { + "text": "Use preferred declaration style (enforce function declaration style)" + }, + "fullDescription": { + "text": "Enforce usage of the trailing return type or the regular return type syntax", + "markdown": "Enforce usage of the trailing return type or the regular return type syntax" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CppEnforceFunctionDeclarationStyle", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Syntax Style", + "index": 91, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1108", + "shortDescription": { + "text": "RoslynAnalyzers Add 'static' modifier to all partial class declarations" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1108", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticNullConversion", + "shortDescription": { + "text": "null-conversion clang diagnostic" + }, + "fullDescription": { + "text": "-Wnull-conversion clang diagnostic · Learn more", + "markdown": "-Wnull-conversion clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wnull-conversion)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticNullConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1102", + "shortDescription": { + "text": "RoslynAnalyzers Make class static" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RCS1102", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1103", + "shortDescription": { + "text": "RoslynAnalyzers Convert 'if' to assignment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1103", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1104", + "shortDescription": { + "text": "RoslynAnalyzers Simplify conditional expression" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1104", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1105", + "shortDescription": { + "text": "RoslynAnalyzers Unnecessary interpolation" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1105", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1100", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Format documentation summary on a single line" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1100", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1101", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Format documentation summary on multiple lines" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1101", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticPedanticCoreFeatures", + "shortDescription": { + "text": "pedantic-core-features clang diagnostic" + }, + "fullDescription": { + "text": "-Wpedantic-core-features clang diagnostic · Learn more", + "markdown": "-Wpedantic-core-features clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wpedantic-core-features)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticPedanticCoreFeatures", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyPerformanceNoAutomaticMove", + "shortDescription": { + "text": "performance-no-automatic-move clang-tidy check" + }, + "fullDescription": { + "text": "performance-no-automatic-move clang-tidy check · Learn more", + "markdown": "performance-no-automatic-move clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance/no-automatic-move.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyPerformanceNoAutomaticMove", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticVexingParse", + "shortDescription": { + "text": "vexing-parse clang diagnostic" + }, + "fullDescription": { + "text": "-Wvexing-parse clang diagnostic · Learn more", + "markdown": "-Wvexing-parse clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wvexing-parse)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticVexingParse", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBWarnings__BC42505", + "shortDescription": { + "text": "The CallerArgumentExpressionAttribute applied to parameter will have no effect. It is applied with an invalid parameter name." + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "VBWarnings__BC42505", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Compiler Warnings", + "index": 110, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppMsExtReinterpretCastFromNullptr", + "shortDescription": { + "text": "Casting from nullptr to pointer type with reinterpret_cast is non-standard Microsoft C++ extension" + }, + "fullDescription": { + "text": "Casting from nullptr to pointer type with reinterpret_cast is non-standard Microsoft C++ extension", + "markdown": "Casting from nullptr to pointer type with reinterpret_cast is non-standard Microsoft C++ extension" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppMsExtReinterpretCastFromNullptr", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Potential Code Quality Issues", + "index": 9, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnreachableSwitchCaseDueToIntegerAnalysis", + "shortDescription": { + "text": "Heuristically unreachable case according to integer analysis" + }, + "fullDescription": { + "text": "Heuristically unreachable case label according to integer analysis Learn more...", + "markdown": "Heuristically unreachable case label according to integer analysis [Learn more...](https://www.jetbrains.com/help/rider/UnreachableSwitchCaseDueToIntegerAnalysis.html)" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnreachableSwitchCaseDueToIntegerAnalysis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Potential Code Quality Issues", + "index": 1, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyCppcoreguidelinesInterfacesGlobalInit", + "shortDescription": { + "text": "cppcoreguidelines-interfaces-global-init clang-tidy check" + }, + "fullDescription": { + "text": "cppcoreguidelines-interfaces-global-init clang-tidy check · Learn more", + "markdown": "cppcoreguidelines-interfaces-global-init clang-tidy check · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/interfaces-global-init.html)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyCppcoreguidelinesInterfacesGlobalInit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang-Tidy Checks", + "index": 8, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VBWarnings__BC42504", + "shortDescription": { + "text": "The CallerArgumentExpressionAttribute applied to parameter will have no effect because it's self-referential" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "VBWarnings__BC42504", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "VB.NET/Compiler Warnings", + "index": 110, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticBoundsSafetyCountedByEltTypeUnknownSize", + "shortDescription": { + "text": "bounds-safety-counted-by-elt-type-unknown-size clang diagnostic" + }, + "fullDescription": { + "text": "-Wbounds-safety-counted-by-elt-type-unknown-size clang diagnostic · Learn more", + "markdown": "-Wbounds-safety-counted-by-elt-type-unknown-size clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wbounds-safety-counted-by-elt-type-unknown-size)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticBoundsSafetyCountedByEltTypeUnknownSize", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1066FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers [deprecated] Remove empty 'finally' clause" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1066FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RCS1212FadeOut", + "shortDescription": { + "text": "RoslynAnalyzers Remove redundant assignment" + }, + "fullDescription": { + "text": "", + "markdown": "" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RCS1212FadeOut", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Roslyn Analyzers", + "index": 35, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToConstant.Local", + "shortDescription": { + "text": "Convert local variable or field into constant (private accessibility)" + }, + "fullDescription": { + "text": "Convert local variable or field into constant", + "markdown": "Convert local variable or field into constant" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToConstant.Local", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C#/Common Practices and Code Improvements", + "index": 12, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CppClangTidyClangDiagnosticGnuOffsetofExtensions", + "shortDescription": { + "text": "gnu-offsetof-extensions clang diagnostic" + }, + "fullDescription": { + "text": "-Wgnu-offsetof-extensions clang diagnostic · Learn more", + "markdown": "-Wgnu-offsetof-extensions clang diagnostic · [Learn more](https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wgnu-offsetof-extensions)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CppClangTidyClangDiagnosticGnuOffsetofExtensions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "C_C++/Clang Diagnostics", + "index": 3, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OtherTagsInsideScript1", + "shortDescription": { + "text": "Script tag errors (other tags inside \n '", + "markdown": "Reports empty tags that do not work in some browsers.\n\n**Example:**\n\n\n \n \n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckEmptyScriptTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownTarget", + "shortDescription": { + "text": "Unresolved file in a link" + }, + "fullDescription": { + "text": "Reports an unresolved file in a link.", + "markdown": "Reports an unresolved file in a link." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownTarget", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlWrongRootElement", + "shortDescription": { + "text": "Wrong root element" + }, + "fullDescription": { + "text": "Reports a root tag name different from the name specified in the '' tag.", + "markdown": "Reports a root tag name different from the name specified in the `` tag." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlWrongRootElement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownAttribute", + "shortDescription": { + "text": "Unknown attribute" + }, + "fullDescription": { + "text": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported.", + "markdown": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantEscape", + "shortDescription": { + "text": "Redundant character escape" + }, + "fullDescription": { + "text": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets '[]' of a character class. Although unescaped opening curly braces '{' outside of character classes are allowed in some dialects (JavaScript, Python, and so on), it can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters. For this reason the inspection does not report escaped opening curly braces. Example: '\\-\\;[\\.]' After the quick-fix is applied: '-;[.]' The Ignore escaped closing brackets '}' and ']' option specifies whether to report '\\}' and '\\]' outside of a character class when they are allowed to be unescaped by the RegExp dialect. New in 2017.3", + "markdown": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets `[]` of a character class.\n\n\nAlthough unescaped opening curly braces `{` outside of character classes are allowed in some dialects (JavaScript, Python, and so on),\nit can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters.\nFor this reason the inspection does not report escaped opening curly braces.\n\n**Example:**\n\n\n \\-\\;[\\.]\n\nAfter the quick-fix is applied:\n\n\n -;[.]\n\n\nThe **Ignore escaped closing brackets '}' and '\\]'** option specifies whether to report `\\}` and `\\]` outside of a character class\nwhen they are allowed to be unescaped by the RegExp dialect.\n\nNew in 2017.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRedundantEscape", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlExtraClosingTag", + "shortDescription": { + "text": "Redundant closing tag" + }, + "fullDescription": { + "text": "Reports redundant closing tags on empty elements, for example, 'img' or 'br'. Example: '\n \n

    \n \n ' After the quick-fix is applied: '\n \n
    \n \n '", + "markdown": "Reports redundant closing tags on empty elements, for example, `img` or `br`.\n\n**Example:**\n\n\n \n \n

    \n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n
    \n \n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlExtraClosingTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDuplicatedId", + "shortDescription": { + "text": "Duplicate 'id' attribute" + }, + "fullDescription": { + "text": "Reports a duplicate 'id' attribute in XML.", + "markdown": "Reports a duplicate `id` attribute in XML." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlDuplicatedId", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlUnboundNsPrefix", + "shortDescription": { + "text": "Unbound namespace prefix" + }, + "fullDescription": { + "text": "Reports an unbound namespace prefix in XML.", + "markdown": "Reports an unbound namespace prefix in XML." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlUnboundNsPrefix", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlPathReference", + "shortDescription": { + "text": "Unresolved file reference" + }, + "fullDescription": { + "text": "Reports an unresolved file reference in XML.", + "markdown": "Reports an unresolved file reference in XML." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlPathReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LossyEncoding", + "shortDescription": { + "text": "Lossy encoding" + }, + "fullDescription": { + "text": "Reports characters that cannot be displayed because of the current document encoding. Examples: If you type international characters in a document with the US-ASCII charset, some characters will be lost on save. If you load a UTF-8-encoded file using the ISO-8859-1 one-byte charset, some characters will be displayed incorrectly. You can fix this by changing the file encoding either by specifying the encoding directly in the file, e.g. by editing 'encoding=' attribute in the XML prolog of XML file, or by changing the corresponding options in Settings | Editor | File Encodings.", + "markdown": "Reports characters that cannot be displayed because of the current document encoding.\n\nExamples:\n\n* If you type international characters in a document with the **US-ASCII** charset, some characters will be lost on save.\n* If you load a **UTF-8** -encoded file using the **ISO-8859-1** one-byte charset, some characters will be displayed incorrectly.\n\nYou can fix this by changing the file encoding\neither by specifying the encoding directly in the file, e.g. by editing `encoding=` attribute in the XML prolog of XML file,\nor by changing the corresponding options in **Settings \\| Editor \\| File Encodings**." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LossyEncoding", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Internationalization", + "index": 124, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantNestedCharacterClass", + "shortDescription": { + "text": "Redundant nested character class" + }, + "fullDescription": { + "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", + "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRedundantNestedCharacterClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpOctalEscape", + "shortDescription": { + "text": "Octal escape" + }, + "fullDescription": { + "text": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion. Example: '\\07' After the quick-fix is applied: '\\x07' New in 2017.1", + "markdown": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion.\n\n**Example:**\n\n\n \\07\n\nAfter the quick-fix is applied:\n\n\n \\x07\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpOctalEscape", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedDefine", + "shortDescription": { + "text": "Unused define" + }, + "fullDescription": { + "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored.", + "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedDefine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RELAX NG", + "index": 136, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpDuplicateAlternationBranch", + "shortDescription": { + "text": "Duplicate branch in alternation" + }, + "fullDescription": { + "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1", + "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpDuplicateAlternationBranch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSuppression", + "shortDescription": { + "text": "Redundant suppression" + }, + "fullDescription": { + "text": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context: '@SuppressWarning' annotation, or '// noinspection' line comment, or '/** noinspection */' JavaDoc comment Example: 'public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n}'", + "markdown": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context:\n\n* `@SuppressWarning` annotation, or\n* `// noinspection` line comment, or\n* `/** noinspection */` JavaDoc comment\n\nExample:\n\n\n public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSuppression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CustomRegExpInspection", + "shortDescription": { + "text": "Custom RegExp inspection" + }, + "fullDescription": { + "text": "Custom Regex Inspection", + "markdown": "Custom Regex Inspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CustomRegExpInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpUnexpectedAnchor", + "shortDescription": { + "text": "Begin or end anchor in unexpected position" + }, + "fullDescription": { + "text": "Reports '^' or '\\A' anchors not at the beginning of the pattern and '$', '\\Z' or '\\z' anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the '^' and '$' anchors, most likely the literal character was meant and the escape forgotten. Example: '(Price $10)' New in 2018.1", + "markdown": "Reports `^` or `\\A` anchors not at the beginning of the pattern and `$`, `\\Z` or `\\z` anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the `^` and `$` anchors, most likely the literal character was meant and the escape forgotten.\n\n**Example:**\n\n\n (Price $10)\n\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpUnexpectedAnchor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SpellCheckingInspection", + "shortDescription": { + "text": "Typo" + }, + "fullDescription": { + "text": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click.", + "markdown": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SpellCheckingInspection", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Proofreading", + "index": 122, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpSimplifiable", + "shortDescription": { + "text": "Regular expression can be simplified" + }, + "fullDescription": { + "text": "Reports regular expressions that can be simplified. Example: '[a] xx* [ah-hz]' After the quick-fix is applied: 'a x+ [ahz]' New in 2022.1", + "markdown": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpSimplifiable", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpEmptyAlternationBranch", + "shortDescription": { + "text": "Empty branch in alternation" + }, + "fullDescription": { + "text": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation. Example: '(alpha||bravo)' After the quick-fix is applied: '(alpha|bravo)' New in 2017.2", + "markdown": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation.\n\n**Example:**\n\n\n (alpha||bravo)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo)\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpEmptyAlternationBranch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TodoComment", + "shortDescription": { + "text": "TODO comment" + }, + "fullDescription": { + "text": "Reports TODO comments in your code. You can configure the format for TODO comments in Settings | Editor | TODO. Enable the Only warn on TODO comments without any details option to only warn on empty TODO comments, that don't provide any description on the task that should be done. Disable to report all TODO comments.", + "markdown": "Reports **TODO** comments in your code.\n\nYou can configure the format for **TODO** comments in [Settings \\| Editor \\| TODO](settings://preferences.toDoOptions).\n\nEnable the **Only warn on TODO comments without any details** option to only warn on empty TODO comments, that\ndon't provide any description on the task that should be done. Disable to report all TODO comments." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TodoComment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDefaultAttributeValue", + "shortDescription": { + "text": "Redundant attribute with default value" + }, + "fullDescription": { + "text": "Reports a redundant assignment of the default value to an XML attribute.", + "markdown": "Reports a redundant assignment of the default value to an XML attribute." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlDefaultAttributeValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyDirectory", + "shortDescription": { + "text": "Empty directory" + }, + "fullDescription": { + "text": "Reports empty directories. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Only report empty directories located under a source folder option to have only directories under source roots reported.", + "markdown": "Reports empty directories.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Only report empty directories located under a source folder** option to have only directories under source\nroots reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyDirectory", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonAsciiCharacters", + "shortDescription": { + "text": "Non-ASCII characters" + }, + "fullDescription": { + "text": "Reports code elements that use non-ASCII symbols in an unusual context. Example: Non-ASCII characters used in identifiers, strings, or comments. Identifiers written in different languages, such as 'myСollection' with the letter 'C' written in Cyrillic. Comments or strings containing Unicode symbols, such as long dashes and arrows.", + "markdown": "Reports code elements that use non-ASCII symbols in an unusual context.\n\nExample:\n\n* Non-ASCII characters used in identifiers, strings, or comments.\n* Identifiers written in different languages, such as `my`**С**`ollection` with the letter **C** written in Cyrillic.\n* Comments or strings containing Unicode symbols, such as long dashes and arrows." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonAsciiCharacters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Internationalization", + "index": 124, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IgnoreFileDuplicateEntry", + "shortDescription": { + "text": "Ignore file duplicates" + }, + "fullDescription": { + "text": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed. Example: '# Output directories\n /out/\n /target/\n /out/'", + "markdown": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed.\n\nExample:\n\n\n # Output directories\n /out/\n /target/\n /out/\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IgnoreFileDuplicateEntry", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Version control", + "index": 148, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpSuspiciousBackref", + "shortDescription": { + "text": "Suspicious back reference" + }, + "fullDescription": { + "text": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation. Example of a group defined after its back reference: '\\1(abc)' Example of a group and a back reference in different branches: 'a(b)c|(xy)\\1z' New in 2022.1", + "markdown": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation.\n\n**Example of a group defined after its back reference:**\n\n\n \\1(abc)\n\n**Example of a group and a back reference in different branches:**\n\n\n a(b)c|(xy)\\1z\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpSuspiciousBackref", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedReference", + "shortDescription": { + "text": "Unresolved reference" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a named pattern ('define') in RELAX-NG files that use XML syntax. Suggests creating the referenced 'define' element.", + "markdown": "Reports an unresolved reference to a named pattern (`define`) in RELAX-NG files that use XML syntax. Suggests creating the referenced `define` element." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UnresolvedReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RELAX NG", + "index": 136, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlMissingClosingTag", + "shortDescription": { + "text": "Missing closing tag" + }, + "fullDescription": { + "text": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional. Example: '\n \n

    Behold!\n \n ' After the quick-fix is applied: '\n \n

    Behold!

    \n \n '", + "markdown": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional.\n\n**Example:**\n\n\n \n \n

    Behold!\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n

    Behold!

    \n \n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HtmlMissingClosingTag", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlInvalidId", + "shortDescription": { + "text": "Unresolved 'id' reference" + }, + "fullDescription": { + "text": "Reports an unresolved 'id' reference in XML.", + "markdown": "Reports an unresolved `id` reference in XML." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlInvalidId", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDeprecatedElement", + "shortDescription": { + "text": "Deprecated symbol" + }, + "fullDescription": { + "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", + "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlDeprecatedElement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpAnonymousGroup", + "shortDescription": { + "text": "Anonymous capturing group or numeric back reference" + }, + "fullDescription": { + "text": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. '(?:xxx)' instead of '(xxx)'. Example: '(\\d\\d\\d\\d)\\1' A better regex pattern could look like this: '(?\\d\\d\\d\\d)\\k' New in 2017.2", + "markdown": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. `(?:xxx)` instead of `(xxx)`.\n\n**Example:**\n\n\n (\\d\\d\\d\\d)\\1\n\nA better regex pattern could look like this:\n\n\n (?\\d\\d\\d\\d)\\k\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpAnonymousGroup", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlUnresolvedReference", + "shortDescription": { + "text": "Unresolved references" + }, + "fullDescription": { + "text": "Reports an unresolved references in XML.", + "markdown": "Reports an unresolved references in XML." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlUnresolvedReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRepeatedSpace", + "shortDescription": { + "text": "Consecutive spaces" + }, + "fullDescription": { + "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1", + "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRepeatedSpace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentLineSeparators", + "shortDescription": { + "text": "Inconsistent line separators" + }, + "fullDescription": { + "text": "Reports files with line separators different from the ones that are specified in the project's settings. For example, the inspection will be triggered if you set the line separator to '\\n' in Settings | Editor | Code Style | Line separator, while the file you are editing uses '\\r\\n' as a line separator. The inspection also warns you about mixed line separators within a file.", + "markdown": "Reports files with line separators different from the ones that are specified in the project's settings.\n\nFor example, the inspection will be triggered if you set the line separator to `\\n` in\n[Settings \\| Editor \\| Code Style \\| Line separator](settings://preferences.sourceCode?Line%20separator),\nwhile the file you are editing uses `\\r\\n` as a line separator.\n\nThe inspection also warns you about mixed line separators within a file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InconsistentLineSeparators", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProblematicWhitespace", + "shortDescription": { + "text": "Problematic whitespace" + }, + "fullDescription": { + "text": "Reports the following problems: Tabs used for indentation when the code style is configured to use only spaces. Spaces used for indentation when the code style is configured to use only tabs. Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs.", + "markdown": "Reports the following problems:\n\n* Tabs used for indentation when the code style is configured to use only spaces.\n* Spaces used for indentation when the code style is configured to use only tabs.\n* Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProblematicWhitespace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LongLine", + "shortDescription": { + "text": "Line is longer than allowed by code style" + }, + "fullDescription": { + "text": "Reports lines that are longer than the Hard wrap at parameter specified in Settings | Editor | Code Style | General.", + "markdown": "Reports lines that are longer than the **Hard wrap at** parameter specified in [Settings \\| Editor \\| Code Style \\| General](settings://preferences.sourceCode?Hard%20wrap%20at)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LongLine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownTag", + "shortDescription": { + "text": "Unknown tag" + }, + "fullDescription": { + "text": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported.", + "markdown": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlHighlighting", + "shortDescription": { + "text": "XML highlighting" + }, + "fullDescription": { + "text": "Reports XML validation problems in the results of a batch code inspection.", + "markdown": "Reports XML validation problems in the results of a batch code inspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlHighlighting", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 56, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpDuplicateCharacterInClass", + "shortDescription": { + "text": "Duplicate character in character class" + }, + "fullDescription": { + "text": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex. Example: '[aabc]' After the quick-fix is applied: '[abc]'", + "markdown": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex.\n\n**Example:**\n\n\n [aabc]\n\nAfter the quick-fix is applied:\n\n\n [abc]\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpDuplicateCharacterInClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RequiredAttributes", + "shortDescription": { + "text": "Missing required attribute" + }, + "fullDescription": { + "text": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported.", + "markdown": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RequiredAttributes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantClassElement", + "shortDescription": { + "text": "Redundant '\\d', '[:digit:]', or '\\D' class elements" + }, + "fullDescription": { + "text": "Reports redundant '\\d' or '[:digit:]' that are used in one class with '\\w' or '[:word:]' ('\\D' with '\\W') and can be removed. Example: '[\\w\\d]' After the quick-fix is applied: '[\\w]' New in 2022.2", + "markdown": "Reports redundant `\\d` or `[:digit:]` that are used in one class with `\\w` or `[:word:]` (`\\D` with `\\W`) and can be removed.\n\n**Example:**\n\n\n [\\w\\d]\n\nAfter the quick-fix is applied:\n\n\n [\\w]\n\nNew in 2022.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpRedundantClassElement", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 58, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlWrongAttributeValue", + "shortDescription": { + "text": "Wrong attribute value" + }, + "fullDescription": { + "text": "Reports an incorrect HTML attribute value.", + "markdown": "Reports an incorrect HTML attribute value." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlWrongAttributeValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MsbuildTargetFrameworkTagInspection", + "shortDescription": { + "text": "TargetFramework tag checks" + }, + "fullDescription": { + "text": "RIDER-83136", + "markdown": "[RIDER-83136](https://youtrack.jetbrains.com/issue/RIDER-83136/)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MsbuildTargetFrameworkTagInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "MSBuild", + "index": 165, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckValidXmlInScriptTagBody", + "shortDescription": { + "text": "Malformed content of 'script' tag" + }, + "fullDescription": { + "text": "Reports contents of 'script' tags that are invalid XML. Example: '' After the quick-fix is applied: ''", + "markdown": "Reports contents of `script` tags that are invalid XML. \n\n**Example:**\n\n\n \n\nAfter the quick-fix is applied:\n\n\n \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CheckValidXmlInScriptTagBody", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownAnchorTarget", + "shortDescription": { + "text": "Unresolved fragment in a link" + }, + "fullDescription": { + "text": "Reports an unresolved last part of an URL after the '#' sign.", + "markdown": "Reports an unresolved last part of an URL after the `#` sign." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownAnchorTarget", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Annotator", + "shortDescription": { + "text": "Annotator" + }, + "fullDescription": { + "text": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection: Option \"Report syntax errors\": report parser-related issues. Option \"Report issues from language-specific annotators\": report issues found by annotators configured for the relevant language. See Custom Language Support: Annotators for details. Option \"Report other highlighting problems\": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See Custom Language Support: Highlighting for details.", + "markdown": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection:\n\n* Option \"**Report syntax errors**\": report parser-related issues.\n* Option \"**Report issues from language-specific annotators** \": report issues found by annotators configured for the relevant language. See [Custom Language Support: Annotators](https://plugins.jetbrains.com/docs/intellij/annotator.html) for details.\n* Option \"**Report other highlighting problems** \": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See [Custom Language Support: Highlighting](https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#semantic-highlighting) for details." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Annotator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.plugins.postcss", + "version": "243.24609", + "rules": [ + { + "id": "PostCssUnresolvedModuleValueReference", + "shortDescription": { + "text": "Unresolved CSS module value" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a CSS Module Value ('@value' declaration). Example: '@value foo from unknown;'", + "markdown": "Reports an unresolved reference to a [CSS Module Value](https://github.com/css-modules/postcss-modules-values) (`@value` declaration).\n\nExample:\n\n\n @value foo from unknown;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PostCssUnresolvedModuleValueReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "PostCSS", + "index": 13, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostCssNesting", + "shortDescription": { + "text": "Invalid nested rule" + }, + "fullDescription": { + "text": "Reports a nested style rule whose syntax doesn't comply with the PostCSS Nested or the PostCSS Nesting specification. Example: '.phone {\n &_title {}\n}'", + "markdown": "Reports a nested style rule whose syntax doesn't comply with the [PostCSS Nested](https://github.com/postcss/postcss-nested) or the [PostCSS Nesting](https://github.com/csstools/postcss-nesting) specification.\n\nExample:\n\n\n .phone {\n &_title {}\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PostCssNesting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "PostCSS", + "index": 13, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostCssCustomMedia", + "shortDescription": { + "text": "Invalid custom media" + }, + "fullDescription": { + "text": "Reports a syntax error in a PostCSS Custom Media query. Example: '@custom-media --small-viewport (max-width: 30em);'", + "markdown": "Reports a syntax error in a [PostCSS Custom Media](https://github.com/postcss/postcss-custom-media) query.\n\nExample:\n\n\n @custom-media --small-viewport (max-width: 30em);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PostCssCustomMedia", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "PostCSS", + "index": 13, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostCssCustomSelector", + "shortDescription": { + "text": "Invalid custom selector" + }, + "fullDescription": { + "text": "Reports a syntax error in PostCSS Custom Selector. Example: '@custom-selector :--heading h1, h2, h3;'", + "markdown": "Reports a syntax error in [PostCSS Custom Selector](https://github.com/postcss/postcss-custom-selectors).\n\nExample:\n\n\n @custom-selector :--heading h1, h2, h3;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PostCssCustomSelector", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "PostCSS", + "index": 13, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostCssMediaRange", + "shortDescription": { + "text": "Invalid media query range" + }, + "fullDescription": { + "text": "Checks range context syntax, which may alternatively be used for media features with a 'range' type. Example: '@media screen and (500px <= width <= 1200px) {}'", + "markdown": "Checks [range context](https://github.com/postcss/postcss-media-minmax) syntax, which may alternatively be used for media features with a 'range' type.\n\nExample:\n\n\n @media screen and (500px <= width <= 1200px) {}\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PostCssMediaRange", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "PostCSS", + "index": 13, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "JavaScript", + "version": "243.24609", + "rules": [ + { + "id": "ShiftOutOfRangeJS", + "shortDescription": { + "text": "Shift operation by possibly wrong constant" + }, + "fullDescription": { + "text": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range '0..31', shifting by negative or overly large values.", + "markdown": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range `0..31`, shifting by negative or overly large values." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ShiftOutOfRangeJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Bitwise operation issues", + "index": 15, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSClosureCompilerSyntax", + "shortDescription": { + "text": "Incorrect usage of JSDoc tags" + }, + "fullDescription": { + "text": "Reports warnings implied by Google Closure Compiler annotations including correct use of '@abstract', '@interface', and '@implements' tags.", + "markdown": "Reports warnings implied by *Google Closure Compiler* annotations including correct use of `@abstract`, `@interface`, and `@implements` tags." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSClosureCompilerSyntax", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadExpressionStatementJS", + "shortDescription": { + "text": "Expression statement which is not assignment or call" + }, + "fullDescription": { + "text": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error.", + "markdown": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BadExpressionStatementJS", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContinueStatementJS", + "shortDescription": { + "text": "'continue' statement" + }, + "fullDescription": { + "text": "Reports a 'continue' statement.", + "markdown": "Reports a `continue` statement." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ContinueStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSXSyntaxUsed", + "shortDescription": { + "text": "JSX syntax used" + }, + "fullDescription": { + "text": "Reports a usage of a JSX tag in JavaScript code.", + "markdown": "Reports a usage of a JSX tag in JavaScript code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JSXSyntaxUsed", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSJoinVariableDeclarationAndAssignment", + "shortDescription": { + "text": "Variable declaration can be merged with the first assignment to the variable" + }, + "fullDescription": { + "text": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression.", + "markdown": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSJoinVariableDeclarationAndAssignment", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertModuleExportToExport", + "shortDescription": { + "text": "'module.exports' is used instead of 'export'" + }, + "fullDescription": { + "text": "Reports a 'module.export' statement. Suggests replacing it with an 'export' or 'export default' statement. Please note that the quick-fix for converting 'module.export' into 'export' is not available for 'module.export' inside functions or statements because 'export' statements can only be at the top level of a module.", + "markdown": "Reports a `module.export` statement. Suggests replacing it with an `export` or `export default` statement. \n\nPlease note that the quick-fix for converting `module.export` into `export` is not available for `module.export` inside functions or statements because `export` statements can only be at the top level of a module." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertModuleExportToExport", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DocumentWriteJS", + "shortDescription": { + "text": "Call to 'document.write()'" + }, + "fullDescription": { + "text": "Reports a method call to 'document.write()' or 'document.writeln()'. Most usages of such calls are performed better with explicit DOM calls, such as 'getElementByID()' and 'createElement()'. Additionally, the 'write()' and 'writeln()' calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs.", + "markdown": "Reports a method call to `document.write()` or `document.writeln()`. Most usages of such calls are performed better with explicit DOM calls, such as `getElementByID()` and `createElement()`. Additionally, the `write()` and `writeln()` calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DocumentWriteJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/DOM issues", + "index": 51, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncompatibleMaskJS", + "shortDescription": { + "text": "Incompatible bitwise mask operation" + }, + "fullDescription": { + "text": "Reports a bitwise mask expression which for sure evaluates to 'true' or 'false'. Expressions are of the form '(var & constant1) == constant2' or '(var | constant1) == constant2', where 'constant1' and 'constant2' are incompatible bitmask constants. Example: '// Incompatible mask: as the last byte in mask is zero,\n// something like 0x1200 would be possible, but not 0x1234\nif ((mask & 0xFF00) == 0x1234) {...}'", + "markdown": "Reports a bitwise mask expression which for sure evaluates to `true` or `false`. Expressions are of the form `(var & constant1) == constant2` or `(var | constant1) == constant2`, where `constant1` and `constant2` are incompatible bitmask constants.\n\nExample:\n\n\n // Incompatible mask: as the last byte in mask is zero,\n // something like 0x1200 would be possible, but not 0x1234\n if ((mask & 0xFF00) == 0x1234) {...}\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IncompatibleBitwiseMaskOperation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Bitwise operation issues", + "index": 15, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSDuplicatedDeclaration", + "shortDescription": { + "text": "Duplicate declaration" + }, + "fullDescription": { + "text": "Reports multiple declarations in a scope.", + "markdown": "Reports multiple declarations in a scope." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSDuplicatedDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptValidateGenericTypes", + "shortDescription": { + "text": "Incorrect generic type argument" + }, + "fullDescription": { + "text": "Reports an invalid type argument in a function, interface, or class declaration.", + "markdown": "Reports an invalid type argument in a function, interface, or class declaration." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "TypeScriptValidateGenericTypes", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSFileReferences", + "shortDescription": { + "text": "Unresolved file reference" + }, + "fullDescription": { + "text": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references.", + "markdown": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSFileReferences", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionWithInconsistentReturnsJS", + "shortDescription": { + "text": "Function with inconsistent returns" + }, + "fullDescription": { + "text": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error. Example: 'function foo() {\n if (true)\n return 3;\n return;\n}'", + "markdown": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error.\n\nExample:\n\n\n function foo() {\n if (true)\n return 3;\n return;\n }\n\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionWithInconsistentReturnsJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ClassMemberInitializationOrder", + "shortDescription": { + "text": "Use of possibly unassigned property in a static initializer" + }, + "fullDescription": { + "text": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. Initialization of class members happens consequently for fields, so a field cannot reference another field that is declared later.", + "markdown": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. \n\nInitialization of class members happens consequently for fields, so a field cannot reference another field that is declared later." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ES6ClassMemberInitializationOrder", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedFunctionJS", + "shortDescription": { + "text": "Nested function" + }, + "fullDescription": { + "text": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing. Use the checkbox below to ignore anonymous nested functions.", + "markdown": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing.\n\n\nUse the checkbox below to ignore anonymous nested functions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedFunctionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptUMDGlobal", + "shortDescription": { + "text": "Referenced UMD global variable" + }, + "fullDescription": { + "text": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly.", + "markdown": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptUMDGlobal", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryReturnJS", + "shortDescription": { + "text": "Unnecessary 'return' statement" + }, + "fullDescription": { + "text": "Reports an unnecessary 'return' statement, that is, a 'return' statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed.", + "markdown": "Reports an unnecessary `return` statement, that is, a `return` statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryReturnStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StandardJS", + "shortDescription": { + "text": "Standard code style" + }, + "fullDescription": { + "text": "Reports a discrepancy detected by the JavaScript Standard Style linter. The highlighting severity in the editor is based on the severity level the linter reports.", + "markdown": "Reports a discrepancy detected by the [JavaScript Standard Style](https://standardjs.com/) linter. \n\nThe highlighting severity in the editor is based on the severity level the linter reports." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "StandardJS", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code quality tools", + "index": 69, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSCommentMatchesSignature", + "shortDescription": { + "text": "Mismatched JSDoc and function signature" + }, + "fullDescription": { + "text": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment. Example: '/**\n * @param height Height in pixels\n */\nfunction sq(height, width) {} // width is not documented' After the quick-fix is applied: '/**\n * @param height Height in pixels\n * @param width\n */\nfunction sq(height, width) {}'", + "markdown": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment.\n\n**Example:**\n\n\n /**\n * @param height Height in pixels\n */\n function sq(height, width) {} // width is not documented\n\nAfter the quick-fix is applied:\n\n\n /**\n * @param height Height in pixels\n * @param width\n */\n function sq(height, width) {}\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSCommentMatchesSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionWithMultipleReturnPointsJS", + "shortDescription": { + "text": "Function with multiple return points" + }, + "fullDescription": { + "text": "Reports a function with multiple return points. Such functions are hard to understand and maintain.", + "markdown": "Reports a function with multiple return points. Such functions are hard to understand and maintain." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionWithMultipleReturnPointsJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSRemoveUnnecessaryParentheses", + "shortDescription": { + "text": "Unnecessary parentheses" + }, + "fullDescription": { + "text": "Reports redundant parentheses. In expressions: 'var x = ((1) + 2) + 3' In arrow function argument lists: 'var incrementer = (x) => x + 1' In TypeScript and Flow type declarations: 'type Card = (Suit & Rank) | (Suit & Number)'", + "markdown": "Reports redundant parentheses.\n\nIn expressions:\n\n var x = ((1) + 2) + 3\n\nIn arrow function argument lists:\n\n var incrementer = (x) => x + 1\n\nIn TypeScript and Flow type declarations:\n\n type Card = (Suit & Rank) | (Suit & Number)\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSRemoveUnnecessaryParentheses", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CommaExpressionJS", + "shortDescription": { + "text": "Comma expression" + }, + "fullDescription": { + "text": "Reports a comma expression. Such expressions are often a sign of overly clever code, and may lead to subtle bugs. Comma expressions in the initializer or in the update section of 'for' loops are ignored.", + "markdown": "Reports a comma expression. Such expressions are often a sign of overly clever code, and may lead to subtle bugs. Comma expressions in the initializer or in the update section of `for` loops are ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CommaExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6BindWithArrowFunction", + "shortDescription": { + "text": "Suspicious usage of 'bind' with arrow function" + }, + "fullDescription": { + "text": "Reports 'bind' used together with an arrow function. Because arrow functions use lexical 'this', a 'bind' call will have no effect on them. See here for details.", + "markdown": "Reports `bind` used together with an arrow function. \nBecause arrow functions use lexical `this`, a `bind` call will have no effect on them. \nSee [here](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions#Lexical_this) for details." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ES6BindWithArrowFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSBitwiseOperatorUsage", + "shortDescription": { + "text": "Bitwise operator usage" + }, + "fullDescription": { + "text": "Reports a suspicious usage of a bitwise AND (\"'&'\") or OR (\"'|'\") operator. Usually it is a typo and the result of applying boolean operations AND (\"'&&'\") and OR (\"'||'\") is expected.", + "markdown": "Reports a suspicious usage of a bitwise AND (\"`&`\") or OR (\"`|`\") operator. Usually it is a typo and the result of applying boolean operations AND (\"`&&`\") and OR (\"`||`\") is expected." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSBitwiseOperatorUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Bitwise operation issues", + "index": 15, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfStatementWithIdenticalBranchesJS", + "shortDescription": { + "text": "'if' statement with identical branches" + }, + "fullDescription": { + "text": "Reports an 'if' statement with identical 'then' and 'else' branches. Such statements are almost certainly an error.", + "markdown": "Reports an `if` statement with identical `then` and `else` branches. Such statements are almost certainly an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IfStatementWithIdenticalBranchesJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSConsecutiveCommasInArrayLiteral", + "shortDescription": { + "text": "Consecutive commas in array literal" + }, + "fullDescription": { + "text": "Reports a consecutive comma in an array literal. The skipped element accepts the 'undefined' value, but it could be done unintentionally, for example, when commas are at the end of one line and at the beginning of the next one.", + "markdown": "Reports a consecutive comma in an array literal. The skipped element accepts the `undefined` value, but it could be done unintentionally, for example, when commas are at the end of one line and at the beginning of the next one." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSConsecutiveCommasInArrayLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSValidateTypes", + "shortDescription": { + "text": "Type mismatch" + }, + "fullDescription": { + "text": "Reports incorrect type of: a parameter in a function call a return value an assigned expression TypeScript code is ignored.", + "markdown": "Reports incorrect type of:\n\n* a parameter in a function call\n* a return value\n* an assigned expression\n\nTypeScript code is ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSValidateTypes", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSPotentiallyInvalidUsageOfClassThis", + "shortDescription": { + "text": "Potentially invalid reference to 'this' of a class from closure" + }, + "fullDescription": { + "text": "Reports an attempt to reference a member of an ECMAScript class via the 'this.' qualifier in a nested function that is not a lambda. 'this' in a nested function that is not a lambda is the function's own 'this' and doesn't relate to the outer class.", + "markdown": "Reports an attempt to reference a member of an ECMAScript class via the `this.` qualifier in a nested function that is not a lambda. \n`this` in a nested function that is not a lambda is the function's own `this` and doesn't relate to the outer class." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSPotentiallyInvalidUsageOfClassThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryContinueJS", + "shortDescription": { + "text": "Unnecessary 'continue' statement" + }, + "fullDescription": { + "text": "Reports an unnecessary 'continue' statement at the end of a loop. Suggests removing such statements.", + "markdown": "Reports an unnecessary `continue` statement at the end of a loop. Suggests removing such statements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryContinueJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BreakStatementWithLabelJS", + "shortDescription": { + "text": "'break' statement with label" + }, + "fullDescription": { + "text": "Reports a labeled 'break' statement.", + "markdown": "Reports a labeled `break` statement." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BreakStatementWithLabelJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSDeclarationsAtScopeStart", + "shortDescription": { + "text": "'var' declared not at the beginning of a function" + }, + "fullDescription": { + "text": "Checks that declarations of local variables declared with var are at the top of a function scope. By default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code.", + "markdown": "Checks that declarations of local variables declared with **var** are at the top of a function scope. \n\nBy default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSDeclarationsAtScopeStart", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertIndexedForToForOf", + "shortDescription": { + "text": "Indexed 'for' is used instead of 'for..of'" + }, + "fullDescription": { + "text": "Reports an indexed 'for' loop used on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops are introduced in ECMAScript 6 and iterate over 'iterable' objects.", + "markdown": "Reports an indexed [for](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) loop used on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops are introduced in ECMAScript 6 and iterate over `iterable` objects." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertIndexedForToForOf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertVarToLetConst", + "shortDescription": { + "text": "'var' is used instead of 'let' or 'const'" + }, + "fullDescription": { + "text": "Reports a 'var' declaration that is used instead of 'let' or 'const'. Both 'let' and 'const' are block-scoped and behave more strictly. Suggests replacing all 'var' declarations with 'let' or 'const' declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. Select the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action.", + "markdown": "Reports a `var` declaration that is used instead of `let` or `const`. \nBoth `let` and `const` are block-scoped and behave more strictly. \n\nSuggests replacing all `var` declarations with `let` or `const` declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. \nSelect the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertVarToLetConst", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DynamicallyGeneratedCodeJS", + "shortDescription": { + "text": "Execution of dynamically generated code" + }, + "fullDescription": { + "text": "Reports a call of the 'eval()', 'setTimeout()', or 'setInterval()' function or an allocation of a 'Function' object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. Ignores the cases when a callback function is provided to these methods statically, without code generation.", + "markdown": "Reports a call of the `eval()`, `setTimeout()`, or `setInterval()` function or an allocation of a `Function` object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. \n\nIgnores the cases when a callback function is provided to these methods statically, without code generation." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DynamicallyGeneratedCodeJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedCatchParameterJS", + "shortDescription": { + "text": "Unused 'catch' parameter" + }, + "fullDescription": { + "text": "Reports a 'catch' parameter that is not used in the corresponding block. The 'catch' parameters named 'ignore' or 'ignored' are ignored. Use the checkbox below to disable this inspection for 'catch' blocks with comments.", + "markdown": "Reports a `catch` parameter that is not used in the corresponding block. The `catch` parameters named `ignore` or `ignored` are ignored.\n\n\nUse the checkbox below to disable this inspection for `catch`\nblocks with comments." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedCatchParameterJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousFunctionJS", + "shortDescription": { + "text": "Anonymous function" + }, + "fullDescription": { + "text": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a 'name' property specified in the ECMAScript 6 standard. For example, 'var bar = function() {};' is not reported.", + "markdown": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a `name` property specified in the ECMAScript 6 standard. For example, `var bar = function() {};` is not reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnonymousFunctionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyCatchBlockJS", + "shortDescription": { + "text": "Empty 'catch' block" + }, + "fullDescription": { + "text": "Reports an empty 'catch' block. This indicates that errors are simply ignored instead of handling them. Any comment in a 'catch' block mutes the inspection.", + "markdown": "Reports an empty `catch` block. This indicates that errors are simply ignored instead of handling them. \n\nAny comment in a `catch` block mutes the inspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyCatchBlockJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowFromFinallyBlockJS", + "shortDescription": { + "text": "'throw' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports s 'throw' statement inside a 'finally' block. Such 'throw' statements may mask exceptions thrown, and complicate debugging.", + "markdown": "Reports s `throw` statement inside a `finally` block. Such `throw` statements may mask exceptions thrown, and complicate debugging." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowInsideFinallyBlockJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSPotentiallyInvalidUsageOfThis", + "shortDescription": { + "text": "Potentially invalid reference to 'this' from closure" + }, + "fullDescription": { + "text": "Reports a 'this' in closure that is used for referencing properties of outer context. Example: 'function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n}'", + "markdown": "Reports a `this` in closure that is used for referencing properties of outer context.\n\nExample:\n\n\n function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSPotentiallyInvalidUsageOfThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnresolvedLibraryURL", + "shortDescription": { + "text": "Missed locally stored library for HTTP link" + }, + "fullDescription": { + "text": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation.", + "markdown": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnresolvedLibraryURL", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptFieldCanBeMadeReadonly", + "shortDescription": { + "text": "Field can be readonly" + }, + "fullDescription": { + "text": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor).", + "markdown": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptFieldCanBeMadeReadonly", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedIfStatementJS", + "shortDescription": { + "text": "Negated 'if' statement" + }, + "fullDescription": { + "text": "Reports if statements which have an else branch and a negated condition. Flipping the order of the if and else branches will usually increase the clarity of such statements.", + "markdown": "Reports **if** statements which have an **else** branch and a negated condition. Flipping the order of the **if** and **else** branches will usually increase the clarity of such statements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NegatedIfStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalExpressionWithIdenticalBranchesJS", + "shortDescription": { + "text": "Conditional expression with identical branches" + }, + "fullDescription": { + "text": "Reports a ternary conditional expression with identical 'then' and 'else' branches.", + "markdown": "Reports a ternary conditional expression with identical `then` and `else` branches." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionalExpressionWithIdenticalBranchesJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSIncompatibleTypesComparison", + "shortDescription": { + "text": "Comparison of expressions having incompatible types" + }, + "fullDescription": { + "text": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values.", + "markdown": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSIncompatibleTypesComparison", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6TopLevelAwaitExpression", + "shortDescription": { + "text": "Top-level 'await' expression" + }, + "fullDescription": { + "text": "Reports a usage of a top-level 'await' expression. While the new 'top-level async' proposal is on its way, using 'await' outside async functions is not allowed.", + "markdown": "Reports a usage of a top-level `await` expression. While the new 'top-level async' proposal is on its way, using `await` outside async functions is not allowed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ES6TopLevelAwaitExpression", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Async code and promises", + "index": 103, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterNamingConventionJS", + "shortDescription": { + "text": "Function parameter naming convention" + }, + "fullDescription": { + "text": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", + "markdown": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterNamingConventionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Naming conventions", + "index": 104, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParametersPerFunctionJS", + "shortDescription": { + "text": "Function with too many parameters" + }, + "fullDescription": { + "text": "Reports a function with too many parameters. Such functions often indicate problems with design. Use the field below to specify the maximum acceptable number of parameters for a function.", + "markdown": "Reports a function with too many parameters. Such functions often indicate problems with design.\n\n\nUse the field below to specify the maximum acceptable number of parameters for a function." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexFunctionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSSuspiciousNameCombination", + "shortDescription": { + "text": "Suspicious variable/parameter name combination" + }, + "fullDescription": { + "text": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it. Example: 'var x = 0;\n var y = x;' or 'var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);' Here the inspection guesses that 'x' and 'y' are mixed up. Specify the names that should not be used together. An error is reported if a parameter name or an assignment target name contains words from one group while the name of the assigned or passed variable contains words from another group.", + "markdown": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it.\n\nExample:\n\n\n var x = 0;\n var y = x;\n\nor\n\n\n var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);\n\nHere the inspection guesses that `x` and `y` are mixed up.\n\nSpecify the names that should not be used together. An error is reported\nif a parameter name or an assignment target name contains words from one group while the name of the assigned or passed\nvariable contains words from another group." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSSuspiciousNameCombination", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChainedFunctionCallJS", + "shortDescription": { + "text": "Chained function call" + }, + "fullDescription": { + "text": "Reports a function call whose target is another function call, for example, 'foo().bar()'", + "markdown": "Reports a function call whose target is another function call, for example, `foo().bar()`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainedFunctionCallJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantOnLHSOfComparisonJS", + "shortDescription": { + "text": "Constant on left side of comparison" + }, + "fullDescription": { + "text": "Reports a comparison operation with a constant value in the left-hand side. According to coding conventions, constants should be in the right-hand side of comparisons.", + "markdown": "Reports a comparison operation with a constant value in the left-hand side. According to coding conventions, constants should be in the right-hand side of comparisons." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantOnLefSideOfComparisonJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSCheckFunctionSignatures", + "shortDescription": { + "text": "Signature mismatch" + }, + "fullDescription": { + "text": "Reports a JavaScript call expression where the arguments do not match the signature of the referenced function, including the types of arguments and their number. Also, reports if the overloading function doesn't match the overloaded one in terms of parameters and return types. TypeScript code is ignored.", + "markdown": "Reports a JavaScript call expression where the arguments do not match the signature of the referenced function, including the types of arguments and their number. Also, reports if the overloading function doesn't match the overloaded one in terms of parameters and return types.\n\nTypeScript code is ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSCheckFunctionSignatures", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptUnresolvedReference", + "shortDescription": { + "text": "Unresolved TypeScript reference" + }, + "fullDescription": { + "text": "Reports an unresolved reference in TypeScript code.", + "markdown": "Reports an unresolved reference in TypeScript code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "TypeScriptUnresolvedReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6RedundantAwait", + "shortDescription": { + "text": "Redundant 'await' expression" + }, + "fullDescription": { + "text": "Reports a redundant usage of 'await', such as 'await await', or awaiting a non-promise result. When the 'Report for promises' option is selected, suggests removing 'await' before promises when applicable (in 'return' statements, and with 'Promise.resolve/reject'). Removing 'await' in such contexts causes two problems. Surrounding your code with 'try-catch' and forgetting to add 'await' will change code semantics while you may fail to notice that. Having an explicit 'await' may prevent the V8 runtime from providing async stack traces.", + "markdown": "Reports a redundant usage of `await`, such as `await await`, or awaiting a non-promise result.\n\n\nWhen the 'Report for promises' option is selected, suggests removing `await` before promises when applicable\n(in `return` statements, and with `Promise.resolve/reject`).\n\nRemoving `await` in such contexts causes two problems.\n\n* Surrounding your code with `try-catch` and forgetting to add `await` will change code semantics while you may fail to notice that.\n* Having an explicit `await` may prevent the V8 runtime from providing [async stack traces](http://bit.ly/v8-zero-cost-async-stack-traces)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6RedundantAwait", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Async code and promises", + "index": 103, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToFunctionParameterJS", + "shortDescription": { + "text": "Assignment to function parameter" + }, + "fullDescription": { + "text": "Reports an assignment to a function parameter, including increment and decrement operations. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error.", + "markdown": "Reports an assignment to a function parameter, including increment and decrement operations. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToFunctionParameterJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FallThroughInSwitchStatementJS", + "shortDescription": { + "text": "Fallthrough in 'switch' statement" + }, + "fullDescription": { + "text": "Reports a 'switch' statement where control can proceed from a branch to the next one. Such \"fall-through\" often indicates an error, for example, a missing 'break' or 'return'.", + "markdown": "Reports a `switch` statement where control can proceed from a branch to the next one. Such \"fall-through\" often indicates an error, for example, a missing `break` or `return`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FallThroughInSwitchStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallerJS", + "shortDescription": { + "text": "Use of 'caller' property" + }, + "fullDescription": { + "text": "Reports a usage of the 'caller' property in a JavaScript function. Using this property to access the stack frame of the calling method can be extremely confusing and result in subtle bugs.", + "markdown": "Reports a usage of the `caller` property in a JavaScript function. Using this property to access the stack frame of the calling method can be extremely confusing and result in subtle bugs." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallerJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSSwitchVariableDeclarationIssue", + "shortDescription": { + "text": "Variable is declared and being used in different 'case' clauses" + }, + "fullDescription": { + "text": "Reports a variable that is declared in one 'case' clause of a 'switch' statement but is used in another 'case' clause of the same statement. For block-scoped variables, this results in throwing a 'ReferenceError'. For 'var' variables, it indicates a potential error. Disable the inspection for 'var' variables if this pattern is used intentionally.", + "markdown": "Reports a variable that is declared in one `case` clause of a `switch` statement but is used in another `case` clause of the same statement. For block-scoped variables, this results in throwing a `ReferenceError`. For `var` variables, it indicates a potential error.\n\nDisable the inspection for `var` variables if this pattern is used intentionally." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSSwitchVariableDeclarationIssue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReuseOfLocalVariableJS", + "shortDescription": { + "text": "Reuse of local variable" + }, + "fullDescription": { + "text": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.", + "markdown": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReuseOfLocalVariableJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Data flow", + "index": 112, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertLetToConst", + "shortDescription": { + "text": "'let' is used instead of 'const'" + }, + "fullDescription": { + "text": "Reports a 'let' declaration that can be made 'const'.", + "markdown": "Reports a `let` declaration that can be made `const`. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertLetToConst", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSReferencingMutableVariableFromClosure", + "shortDescription": { + "text": "Referencing mutable variable from closure" + }, + "fullDescription": { + "text": "Reports access to outer mutable variables from functions. Example: 'for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }'", + "markdown": "Reports access to outer mutable variables from functions.\n\nExample:\n\n\n for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSReferencingMutableVariableFromClosure", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertRequireIntoImport", + "shortDescription": { + "text": "'require()' is used instead of 'import'" + }, + "fullDescription": { + "text": "Reports a 'require()' statement. Suggests converting it to a 'require()' call with an 'import' statement. Enable 'Convert require() inside inner scopes with Fix all action' to convert all 'require()' calls inside the nested functions and statements when using the 'Fix all' action. Please note that converting 'require()' statements inside inner scopes to 'import' statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. 'require()' calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. Clear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action.", + "markdown": "Reports a `require()` statement. Suggests converting it to a `require()` call with an `import` statement. \n\nEnable 'Convert require() inside inner scopes with Fix all action' to convert all `require()` calls inside the nested functions and statements when using the 'Fix all' action. \n\nPlease note that converting `require()` statements inside inner scopes to `import` statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. `require()` calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. \nClear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertRequireIntoImport", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnusedGlobalSymbols", + "shortDescription": { + "text": "Unused global symbol" + }, + "fullDescription": { + "text": "Reports an unused globally accessible public function, variable, class, or property.", + "markdown": "Reports an unused globally accessible public function, variable, class, or property." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnusedGlobalSymbols", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Unused symbols", + "index": 117, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedConditionalExpressionJS", + "shortDescription": { + "text": "Nested conditional expression" + }, + "fullDescription": { + "text": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic.", + "markdown": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedConditionalExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6PossiblyAsyncFunction", + "shortDescription": { + "text": "'await' in non-async function" + }, + "fullDescription": { + "text": "Reports a usage of 'await' in a function that was possibly intended to be async but is actually missing the 'async' modifier. Although 'await' can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made 'async'.", + "markdown": "Reports a usage of `await` in a function that was possibly intended to be async but is actually missing the `async` modifier. Although `await` can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made `async`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6PossiblyAsyncFunction", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Async code and promises", + "index": 103, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FlowJSFlagCommentPlacement", + "shortDescription": { + "text": "Misplaced @flow flag" + }, + "fullDescription": { + "text": "Reports a '@flow' flag comment that is not located at the top of a file.", + "markdown": "Reports a `@flow` flag comment that is not located at the top of a file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FlowJSFlagCommentPlacement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Flow type checker", + "index": 118, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSMissingSwitchDefault", + "shortDescription": { + "text": "'switch' statement has no 'default' branch" + }, + "fullDescription": { + "text": "Reports a 'switch' statement without a 'default' clause when some possible values are not enumerated.", + "markdown": "Reports a `switch` statement without a `default` clause when some possible values are not enumerated." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSMissingSwitchDefault", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSXNamespaceValidation", + "shortDescription": { + "text": "Missing JSX namespace" + }, + "fullDescription": { + "text": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation.", + "markdown": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSXNamespaceValidation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReservedWordUsedAsNameJS", + "shortDescription": { + "text": "Reserved word used as name" + }, + "fullDescription": { + "text": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords.", + "markdown": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReservedWordAsName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncrementDecrementResultUsedJS", + "shortDescription": { + "text": "Result of increment or decrement used" + }, + "fullDescription": { + "text": "Reports an increment ('++') or decrement ('--') expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: 'var a = b++'", + "markdown": "Reports an increment (`++`) or decrement (`--`) expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: `var a = b++`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IncrementDecrementResultUsedJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousTypeOfGuard", + "shortDescription": { + "text": "Unsound type guard check" + }, + "fullDescription": { + "text": "Reports a 'typeof' or 'instanceof' unsound type guard check. The 'typeof x' type guard can be unsound in one of the following two cases: 'typeof x' never corresponds to the specified value (for example, 'typeof x === 'number'' when 'x' is of the type 'string | boolean') 'typeof x' always corresponds to the specified value (for example, 'typeof x === 'string'' when 'x' is of the type 'string') The 'x instanceof A' type guard can be unsound in one of the following two cases: The type of 'x' is not related to 'A' The type of 'x' is 'A' or a subtype of 'A'", + "markdown": "Reports a `typeof` or `instanceof` unsound type guard check. The `typeof x` type guard can be unsound in one of the following two cases:\n\n* `typeof x` never corresponds to the specified value (for example, `typeof x === 'number'` when `x` is of the type 'string \\| boolean')\n* `typeof x` always corresponds to the specified value (for example, `typeof x === 'string'` when `x` is of the type 'string')\n\nThe `x instanceof A` type guard can be unsound in one of the following two cases:\n\n* The type of `x` is not related to `A`\n* The type of `x` is `A` or a subtype of `A`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousTypeOfGuard", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoopStatementThatDoesntLoopJS", + "shortDescription": { + "text": "Loop statement that doesn't loop" + }, + "fullDescription": { + "text": "Reports a 'for', 'while', or 'do' statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error.", + "markdown": "Reports a `for`, `while`, or `do` statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LoopStatementThatDoesntLoopJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSNonASCIINames", + "shortDescription": { + "text": "Identifiers with non-ASCII symbols" + }, + "fullDescription": { + "text": "Reports a non-ASCII symbol in a name. If the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. Otherwise reports all names that contain both ASCII and non-ASCII symbols.", + "markdown": "Reports a non-ASCII symbol in a name. \n\nIf the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. \nOtherwise reports all names that contain both ASCII and non-ASCII symbols." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSNonASCIINames", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Naming conventions", + "index": 104, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6MissingAwait", + "shortDescription": { + "text": "Missing await for an async function call" + }, + "fullDescription": { + "text": "Reports an 'async' function call without an expected 'await' prefix inside an 'async' function. Such call returns a 'Promise' and control flow is continued immediately. Example: 'async function bar() { /* ... */ }\nasync function foo() {\n bar(); // bad\n}' After the quick-fix is applied, the 'await' prefix is added: 'async function bar() { /* ... */ }\nasync function foo() {\n await bar(); // good\n}' When the 'Report for promises in return statements' checkbox is selected, also suggests adding 'await' in return statements. While this is generally not necessary, it gives two main benefits. You won't forget to add 'await' when surrounding your code with 'try-catch'. An explicit 'await' helps V8 runtime to provide async stack traces.", + "markdown": "Reports an `async` function call without an expected `await` prefix inside an `async` function. Such call returns a `Promise` and control flow is continued immediately.\n\nExample:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n bar(); // bad\n }\n\n\nAfter the quick-fix is applied, the `await` prefix is added:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n await bar(); // good\n }\n\nWhen the 'Report for promises in return statements' checkbox is selected, also suggests adding `await` in return statements. \nWhile this is generally not necessary, it gives two main benefits. \n\n* You won't forget to add `await` when surrounding your code with `try-catch`.\n* An explicit `await` helps V8 runtime to provide [async stack traces](https://bit.ly/v8-zero-cost-async-stack-traces)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6MissingAwait", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Async code and promises", + "index": 103, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TailRecursionJS", + "shortDescription": { + "text": "Tail recursion" + }, + "fullDescription": { + "text": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments.", + "markdown": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TailRecursionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingPlusesOrMinusesJS", + "shortDescription": { + "text": "Confusing sequence of '+' or '-'" + }, + "fullDescription": { + "text": "Reports a suspicious combination of '+' or '-' characters in JavaScript code (for example, 'a+++b'. Such sequences are confusing, and their semantics may change through changes in the whitespace.", + "markdown": "Reports a suspicious combination of `+` or `-` characters in JavaScript code (for example, `a+++b`. Such sequences are confusing, and their semantics may change through changes in the whitespace." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingPlusesOrMinusesJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptConfig", + "shortDescription": { + "text": "Inconsistent tsconfig.json properties" + }, + "fullDescription": { + "text": "Reports inconsistency of a 'paths', 'checkJs', or 'extends' property in a tsconfig.json file. The 'checkJs' property requires 'allowJs'. The 'extends' property should be a valid file reference.", + "markdown": "Reports inconsistency of a `paths`, `checkJs`, or `extends` property in a tsconfig.json file. \nThe `checkJs` property requires `allowJs`. \nThe `extends` property should be a valid file reference." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeScriptConfig", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyComplexBooleanExpressionJS", + "shortDescription": { + "text": "Overly complex boolean expression" + }, + "fullDescription": { + "text": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", + "markdown": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexBooleanExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyComplexArithmeticExpressionJS", + "shortDescription": { + "text": "Overly complex arithmetic expression" + }, + "fullDescription": { + "text": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", + "markdown": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexArithmeticExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateConditionJS", + "shortDescription": { + "text": "Duplicate condition in 'if' statement" + }, + "fullDescription": { + "text": "Reports duplicate conditions in different branches of an 'if' statement. Duplicate conditions usually represent programmer oversight. Example: 'if (a) {\n ...\n } else if (a) {\n ...\n }'", + "markdown": "Reports duplicate conditions in different branches of an `if` statement. Duplicate conditions usually represent programmer oversight.\n\nExample:\n\n\n if (a) {\n ...\n } else if (a) {\n ...\n }\n\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateConditionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLabelJS", + "shortDescription": { + "text": "Unnecessary label" + }, + "fullDescription": { + "text": "Reports an unused label.", + "markdown": "Reports an unused label." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLabelJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InnerHTMLJS", + "shortDescription": { + "text": "Use of 'innerHTML' property" + }, + "fullDescription": { + "text": "Reports a JavaScript access to DOM nodes as text using the 'innerHTML' property. Most usages of 'innerHTML' are performed better with explicit DOM calls, such as 'getElementByID()' and 'createElement()'. Additionally, 'innerHTML' will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can lead to difficulties in diagnosing bugs.", + "markdown": "Reports a JavaScript access to DOM nodes as text using the `innerHTML` property. Most usages of `innerHTML` are performed better with explicit DOM calls, such as `getElementByID()` and `createElement()`. Additionally, `innerHTML` will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can lead to difficulties in diagnosing bugs." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InnerHTMLJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/DOM issues", + "index": 51, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6UnusedImports", + "shortDescription": { + "text": "Unused import" + }, + "fullDescription": { + "text": "Reports a redundant 'import' statement. This is usually the case if the imported symbols are not used in the source file. To avoid side-effects, consider using bare import 'import 'packageName'' instead of the regular one.", + "markdown": "Reports a redundant `import` statement. This is usually the case if the imported symbols are not used in the source file. To avoid side-effects, consider using bare import `import 'packageName'` instead of the regular one." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ES6UnusedImports", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSAssignmentUsedAsCondition", + "shortDescription": { + "text": "Assignment used as condition" + }, + "fullDescription": { + "text": "Reports an assignment that is used as the condition of an 'if', 'while', 'for', or 'do' statement. Although occasionally intended, this usage is confusing, and often indicates a typo (for example, '=' instead of '==').", + "markdown": "Reports an assignment that is used as the condition of an `if`, `while`, `for`, or `do` statement. Although occasionally intended, this usage is confusing, and often indicates a typo (for example, `=` instead of `==`)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSAssignmentUsedAsCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForLoopReplaceableByWhileJS", + "shortDescription": { + "text": "'for' loop may be replaced by 'while' loop" + }, + "fullDescription": { + "text": "Reports a 'for' loop that contains neither initialization nor an update component. Suggests replacing the loop with a simpler 'while' statement. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied the result looks like: 'while(exitCondition()) {\n process();\n }' Use the checkbox below if you wish this inspection to ignore for loops with trivial or non-existent conditions.", + "markdown": "Reports a `for` loop that contains neither initialization nor an update component. Suggests replacing the loop with a simpler `while` statement.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied the result looks like:\n\n\n while(exitCondition()) {\n process();\n }\n\nUse the checkbox below if you wish this inspection to ignore **for** loops with trivial or non-existent conditions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForLoopReplaceableByWhile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantConditionalExpressionJS", + "shortDescription": { + "text": "Constant conditional expression" + }, + "fullDescription": { + "text": "Reports a conditional expression in the format 'true? result1: result2' or 'false? result1: result2. Suggests simplifying the expression.'", + "markdown": "Reports a conditional expression in the format `true? result1: result2` or `false? result1: result2``.\nSuggests simplifying the expression.\n`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantConditionalExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSValidateJSDoc", + "shortDescription": { + "text": "Syntax errors and unresolved references in JSDoc" + }, + "fullDescription": { + "text": "Reports a syntax discrepancy in a documentation comment.", + "markdown": "Reports a syntax discrepancy in a documentation comment." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSValidateJSDoc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonBlockStatementBodyJS", + "shortDescription": { + "text": "Statement body without braces" + }, + "fullDescription": { + "text": "Reports a 'if', 'while', 'for', or 'with' statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance.", + "markdown": "Reports a `if`, `while`, `for`, or `with` statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonBlockStatementBodyJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FlowJSConfig", + "shortDescription": { + "text": "Missing .flowconfig" + }, + "fullDescription": { + "text": "Reports a JavaScript file with a '@flow' flag that doesn't have an associated '.flowconfig' file in the project.", + "markdown": "Reports a JavaScript file with a `@flow` flag that doesn't have an associated `.flowconfig` file in the project." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FlowJSConfig", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Flow type checker", + "index": 118, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptValidateTypes", + "shortDescription": { + "text": "Type mismatch" + }, + "fullDescription": { + "text": "Reports a parameter, return value, or assigned expression of incorrect type.", + "markdown": "Reports a parameter, return value, or assigned expression of incorrect type." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "TypeScriptValidateTypes", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSObjectNullOrUndefined", + "shortDescription": { + "text": "Object is 'null' or 'undefined'" + }, + "fullDescription": { + "text": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is 'undefined' or 'null'.", + "markdown": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is `undefined` or `null`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSObjectNullOrUndefined", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessArithmeticExpressionJS", + "shortDescription": { + "text": "Pointless arithmetic expression" + }, + "fullDescription": { + "text": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring.", + "markdown": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessArithmeticExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptSmartCast", + "shortDescription": { + "text": "Narrowed type" + }, + "fullDescription": { + "text": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection.", + "markdown": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeScriptSmartCast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSAccessibilityCheck", + "shortDescription": { + "text": "Inaccessible @private and @protected members referenced" + }, + "fullDescription": { + "text": "Reports a reference to a JavaScript member that is marked with a '@private' or '@protected' tag but does not comply with visibility rules that these tags imply.", + "markdown": "Reports a reference to a JavaScript member that is marked with a `@private` or `@protected` tag but does not comply with visibility rules that these tags imply." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSAccessibilityCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionWithMultipleLoopsJS", + "shortDescription": { + "text": "Function with multiple loops" + }, + "fullDescription": { + "text": "Reports a function with multiple loop statements.", + "markdown": "Reports a function with multiple loop statements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionWithMultipleLoopsJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NpmUsedModulesInstalled", + "shortDescription": { + "text": "Missing module dependency" + }, + "fullDescription": { + "text": "Reports a module from a 'require()' call or an 'import' statement that is not installed or is not listed in package.json dependencies. Suggests installing the module and/or including it into package.json. For 'require()' calls, works only in the files from the scope of Node.js Core JavaScript library.", + "markdown": "Reports a module from a `require()` call or an `import` statement that is not installed or is not listed in package.json dependencies.\n\nSuggests installing the module and/or including it into package.json.\n\nFor `require()` calls, works only in the files from the scope of *Node.js Core* JavaScript library." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "NpmUsedModulesInstalled", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionNamingConventionJS", + "shortDescription": { + "text": "Function naming convention" + }, + "fullDescription": { + "text": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression for function names. Use the standard 'java.util.regex' format for regular expressions.", + "markdown": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nfor function names. Use the standard `java.util.regex` format for regular expressions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionNamingConventionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Naming conventions", + "index": 104, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectAllocationIgnoredJS", + "shortDescription": { + "text": "Result of object allocation ignored" + }, + "fullDescription": { + "text": "Reports object allocation where the result of the allocated object is ignored, for example, 'new Error();' as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy.", + "markdown": "Reports object allocation where the result of the allocated object is ignored, for example, `new Error();` as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectAllocationIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSHint", + "shortDescription": { + "text": "JSHint" + }, + "fullDescription": { + "text": "Reports a problem detected by the JSHint linter.", + "markdown": "Reports a problem detected by the [JSHint](https://jshint.com/) linter." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JSHint", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code quality tools", + "index": 69, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExceptionCaughtLocallyJS", + "shortDescription": { + "text": "Exception used for local control-flow" + }, + "fullDescription": { + "text": "Reports a 'throw' statement whose exceptions are always caught by the containing 'try' statement. Using 'throw' statements as a 'goto' to change the local flow of control is confusing.", + "markdown": "Reports a `throw` statement whose exceptions are always caught by the containing `try` statement. Using `throw` statements as a `goto` to change the local flow of control is confusing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExceptionCaughtLocallyJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclomaticComplexityJS", + "shortDescription": { + "text": "Overly complex function" + }, + "fullDescription": { + "text": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test. Use the field provided below to specify the maximum acceptable cyclomatic complexity for a function.", + "markdown": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test.\n\n\nUse the field provided below to specify the maximum acceptable cyclomatic complexity for a function." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexFunctionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptJSXUnresolvedComponent", + "shortDescription": { + "text": "Unresolved JSX component" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name. The template for a new component can be modified in Editor | File and Code Templates.", + "markdown": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptJSXUnresolvedComponent", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnfilteredForInLoop", + "shortDescription": { + "text": "Unfiltered for..in loop" + }, + "fullDescription": { + "text": "Reports unfiltered 'for-in' loops. The use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when 'Object''s prototype may be incorrectly modified. For example, the following code will print 42 and myMethod: 'Object.prototype.myMethod = function myMethod() {};\nlet a = { foo: 42 };\nfor (let i in a) {\n console.log(a[i]);\n}' Suggests replacing the whole loop with a 'Object.keys()' method or adding a 'hasOwnProperty()' check. After applying the quick-fix the code looks as follows: 'for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n}'", + "markdown": "Reports unfiltered `for-in` loops. \n\nThe use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when `Object`'s prototype may be incorrectly modified. For example, the following code will print **42** and **myMethod** : \n\n\n Object.prototype.myMethod = function myMethod() {};\n let a = { foo: 42 };\n for (let i in a) {\n console.log(a[i]);\n }\n\nSuggests replacing the whole loop with a `Object.keys()` method or adding a `hasOwnProperty()` check. After applying the quick-fix the code looks as follows:\n\n\n for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnfilteredForInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSFunctionExpressionToArrowFunction", + "shortDescription": { + "text": "Function expression is used instead of arrow function" + }, + "fullDescription": { + "text": "Reports a function expression. Suggests converting it to an arrow function. Example: 'arr.map(function(el) {return el + 1})' After applying the quick-fix the code looks as follows: 'arr.map(el => el + 1)'", + "markdown": "Reports a [function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function) expression. Suggests converting it to an [arrow function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions).\n\nExample:\n\n arr.map(function(el) {return el + 1})\n\nAfter applying the quick-fix the code looks as follows:\n\n arr.map(el => el + 1)\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSFunctionExpressionToArrowFunction", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UpdateDependencyToLatestVersion", + "shortDescription": { + "text": "Update package.json dependencies to latest versions" + }, + "fullDescription": { + "text": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions.", + "markdown": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UpdateDependencyToLatestVersion", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentResultUsedJS", + "shortDescription": { + "text": "Result of assignment used" + }, + "fullDescription": { + "text": "Reports an assignment expression where the result of the assignment is used in the containing expression. Such assignments often indicate coding errors, for example, '=' instead of '=='. Moreover, they can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Expressions in parentheses are ignored.", + "markdown": "Reports an assignment expression where the result of the assignment is used in the containing expression. Such assignments often indicate coding errors, for example, `=` instead of `==`. Moreover, they can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways.\n\nExpressions in parentheses are ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentResultUsedJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantOnRHSOfComparisonJS", + "shortDescription": { + "text": "Constant on right side of comparison" + }, + "fullDescription": { + "text": "Reports a comparison operation with a constant in the right-hand side. According to coding conventions, constants should only be in the left-hand side of comparisons.", + "markdown": "Reports a comparison operation with a constant in the right-hand side. According to coding conventions, constants should only be in the left-hand side of comparisons." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantOnRightSideOfComparisonJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnnecessarySemicolon", + "shortDescription": { + "text": "Unnecessary semicolon" + }, + "fullDescription": { + "text": "Reports an unneeded semicolon.", + "markdown": "Reports an unneeded semicolon." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnnecessarySemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSSuspiciousEqPlus", + "shortDescription": { + "text": "Suspicious '=+' assignment" + }, + "fullDescription": { + "text": "Reports an assignment in the form 'a =+ b'. Suggests replacing with 'a += b'.", + "markdown": "Reports an assignment in the form `a =+ b`. Suggests replacing with `a += b`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSSuspiciousEqPlus", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnusedAssignment", + "shortDescription": { + "text": "Unused assignment" + }, + "fullDescription": { + "text": "Reports a variable whose value is never used after assignment. Suggests removing the unused variable to shorten the code and to avoid redundant allocations. The following cases are reported: A variable is never read after assignment. The value of a variable is always overwritten with another assignment before the variable is read next time. The initializer of a variable is redundant (for one of the above-mentioned reasons).", + "markdown": "Reports a variable whose value is never used after assignment. \nSuggests removing the unused variable to shorten the code and to avoid redundant allocations.\n\nThe following cases are reported:\n\n* A variable is never read after assignment.\n* The value of a variable is always overwritten with another assignment before the variable is read next time.\n* The initializer of a variable is redundant (for one of the above-mentioned reasons)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnusedAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Unused symbols", + "index": 117, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingFloatingPointLiteralJS", + "shortDescription": { + "text": "Confusing floating point literal" + }, + "fullDescription": { + "text": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards.", + "markdown": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingFloatingPointLiteralJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContinueOrBreakFromFinallyBlockJS", + "shortDescription": { + "text": "'continue' or 'break' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports a 'break' or 'continue' statement inside a 'finally' block. Such statements are very confusing, may hide exceptions, and complicate debugging.", + "markdown": "Reports a `break` or `continue` statement inside a `finally` block. Such statements are very confusing, may hide exceptions, and complicate debugging." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ContinueOrBreakFromFinallyBlockJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSMethodCanBeStatic", + "shortDescription": { + "text": "Method can be made 'static'" + }, + "fullDescription": { + "text": "Reports a class method that can be safely made 'static'. A method can be 'static' if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass. Use the first checkbox below to inspect only 'private' methods.", + "markdown": "Reports a class method that can be safely made `static`. A method can be `static` if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass.\n\n\nUse the first checkbox below to inspect only `private` methods." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSMethodCanBeStatic", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUndeclaredVariable", + "shortDescription": { + "text": "Implicitly declared global JavaScript variable" + }, + "fullDescription": { + "text": "Reports an implicit declaration of a global variable. Example: 'var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere'", + "markdown": "Reports an implicit declaration of a global variable.\n\nExample:\n\n\n var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSUndeclaredVariable", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SillyAssignmentJS", + "shortDescription": { + "text": "Variable is assigned to itself" + }, + "fullDescription": { + "text": "Reports an assignment in the form 'x = x'.", + "markdown": "Reports an assignment in the form `x = x`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SillyAssignmentJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptCheckImport", + "shortDescription": { + "text": "Unresolved imported name" + }, + "fullDescription": { + "text": "Reports an unresolved name or binding in an 'import' declaration in TypeScript code.", + "markdown": "Reports an unresolved name or binding in an `import` declaration in TypeScript code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "TypeScriptCheckImport", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InfiniteRecursionJS", + "shortDescription": { + "text": "Infinite recursion" + }, + "fullDescription": { + "text": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally.", + "markdown": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InfiniteRecursionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSMismatchedCollectionQueryUpdate", + "shortDescription": { + "text": "Mismatched query and update of collection" + }, + "fullDescription": { + "text": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error. Query methods are automatically detected, based on whether they return something, or a callback is passed to them. Use the table below to specify which methods are update methods.", + "markdown": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error.\n\n\nQuery methods are automatically detected, based on whether they return something, or a callback is passed to them.\nUse the table below to specify which methods are update methods." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSMismatchedCollectionQueryUpdate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6PreferShortImport", + "shortDescription": { + "text": "Import can be shortened" + }, + "fullDescription": { + "text": "Reports an ES6 import whose 'from' part can be shortened. Suggests importing the parent directory.", + "markdown": "Reports an ES6 import whose `from` part can be shortened. Suggests importing the parent directory." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ES6PreferShortImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessBitwiseExpressionJS", + "shortDescription": { + "text": "Bitwise expression can be simplified" + }, + "fullDescription": { + "text": "Reports an expression that includes 'and' with zero, 'or' by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings.", + "markdown": "Reports an expression that includes `and` with zero, `or` by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessBitwiseExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Bitwise operation issues", + "index": 15, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSStringConcatenationToES6Template", + "shortDescription": { + "text": "String concatenation is used instead of template literal" + }, + "fullDescription": { + "text": "Reports a string concatenation. Suggests replacing it with a template literal Example '\"result: \" + a + \".\"' After applying the quick-fix the code looks as follows: '`result: ${a}.`'", + "markdown": "Reports a string concatenation. Suggests replacing it with a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)\n\nExample\n\n \"result: \" + a + \".\" \n\nAfter applying the quick-fix the code looks as follows:\n\n `result: ${a}.` \n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSStringConcatenationToES6Template", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceAssignmentWithOperatorAssignmentJS", + "shortDescription": { + "text": "Assignment could be replaced with operator assignment" + }, + "fullDescription": { + "text": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer. Example: 'x = x + 3;'\n 'x = x / 3;'\n After the quick fix is applied the result looks like: 'x += 3;'\n 'x /= 3;'", + "markdown": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer.\n\n\nExample:\n\n x = x + 3;\n x = x / 3;\n\nAfter the quick fix is applied the result looks like:\n\n x += 3;\n x /= 3;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentReplaceableWithOperatorAssignmentJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6DestructuringVariablesMerge", + "shortDescription": { + "text": "Destructuring properties with the same key" + }, + "fullDescription": { + "text": "Reports multiple destructuring properties with identical keys. Suggests merging the properties.", + "markdown": "Reports multiple destructuring properties with identical keys. Suggests merging the properties." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6DestructuringVariablesMerge", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptRedundantGenericType", + "shortDescription": { + "text": "Redundant type arguments" + }, + "fullDescription": { + "text": "Reports a type argument that is equal to the default one and can be removed. Example: 'type Foo = T;\nlet z: Foo;'", + "markdown": "Reports a type argument that is equal to the default one and can be removed.\n\n\nExample:\n\n\n type Foo = T;\n let z: Foo;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptRedundantGenericType", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSLastCommaInObjectLiteral", + "shortDescription": { + "text": "Unneeded last comma in object literal" + }, + "fullDescription": { + "text": "Reports usages of a trailing comma in object literals. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Trailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", + "markdown": "Reports usages of a trailing comma in object literals.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nTrailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSLastCommaInObjectLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedAssignmentJS", + "shortDescription": { + "text": "Nested assignment" + }, + "fullDescription": { + "text": "Reports an assignment expression nested inside another expression, for example, 'a = b = 1'. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing.", + "markdown": "Reports an assignment expression nested inside another expression, for example, `a = b = 1`. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedAssignmentJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DefaultNotLastCaseInSwitchJS", + "shortDescription": { + "text": "'default' not last case in 'switch'" + }, + "fullDescription": { + "text": "Reports a 'switch' statement where the 'default' case comes before another case instead of being the very last case, which may cause confusion.", + "markdown": "Reports a `switch` statement where the `default` case comes before another case instead of being the very last case, which may cause confusion." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DefaultNotLastCaseInSwitchJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyFinallyBlockJS", + "shortDescription": { + "text": "Empty 'finally' block" + }, + "fullDescription": { + "text": "Reports an empty 'finally' block, which usually indicates an error.", + "markdown": "Reports an empty `finally` block, which usually indicates an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyFinallyBlockJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForLoopThatDoesntUseLoopVariableJS", + "shortDescription": { + "text": "'for' loop where update or condition does not use loop variable" + }, + "fullDescription": { + "text": "Reports a 'for' loop where the condition or update does not use the 'for' loop variable.", + "markdown": "Reports a `for` loop where the condition or update does not use the `for` loop variable." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForLoopThatDoesntUseLoopVariableJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptAbstractClassConstructorCanBeMadeProtected", + "shortDescription": { + "text": "Abstract class constructor can be made protected" + }, + "fullDescription": { + "text": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public).", + "markdown": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptAbstractClassConstructorCanBeMadeProtected", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreeNegationsPerFunctionJS", + "shortDescription": { + "text": "Function with more than three negations" + }, + "fullDescription": { + "text": "Reports a function with three or more negation operations ('!' or '!='). Such functions may be unnecessarily confusing.", + "markdown": "Reports a function with three or more negation operations (`!` or `!=`). Such functions may be unnecessarily confusing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionWithMoreThanThreeNegationsJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrivialIfJS", + "shortDescription": { + "text": "Redundant 'if' statement" + }, + "fullDescription": { + "text": "Reports an 'if' statement that can be simplified to a single assignment or a 'return' statement. Example: 'if(foo())\n {\n return true;\n }\n else\n {\n return false;\n }' After applying the quick-fix the code looks as follows: 'return foo();'", + "markdown": "Reports an `if` statement that can be simplified to a single assignment or a `return` statement.\n\nExample:\n\n\n if(foo())\n {\n return true;\n }\n else\n {\n return false;\n }\n\nAfter applying the quick-fix the code looks as follows:\n\n return foo();\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantIfStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnterminatedStatementJS", + "shortDescription": { + "text": "Unterminated statement" + }, + "fullDescription": { + "text": "Reports a statement without a semicolon or a newline at the end. Select the 'Terminate statements with semicolons' option in Editor | Code Style | JavaScript or TypeScript - Punctuation to report any statement that doesn't end with a semicolon, even if a newline is used. According to some coding styles, semicolons are preferred to line-breaks for consistency with the other languages.", + "markdown": "Reports a statement without a semicolon or a newline at the end.\n\nSelect the 'Terminate statements with semicolons' option in *Editor \\| Code Style \\| JavaScript or TypeScript - Punctuation* to report any statement that doesn't end with a semicolon, even if a newline is used.\nAccording to some coding styles, semicolons are preferred to line-breaks for consistency with the other languages." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnterminatedStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnreachableSwitchBranches", + "shortDescription": { + "text": "Unreachable 'case' branch of a 'switch' statement" + }, + "fullDescription": { + "text": "Reports an unreachable 'case' branch of a 'switch' statement. Example: '/**\n * @param {('foo' | 'bar')} p\n */\nfunction foo(p) {\n switch (p) {\n case 'foo': break;\n case 'bar': break;\n case 'baz': break; // unreachable\n }\n}'", + "markdown": "Reports an unreachable `case` branch of a `switch` statement.\n\nExample:\n\n\n /**\n * @param {('foo' | 'bar')} p\n */\n function foo(p) {\n switch (p) {\n case 'foo': break;\n case 'bar': break;\n case 'baz': break; // unreachable\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnreachableSwitchBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrivialConditionalJS", + "shortDescription": { + "text": "Redundant conditional expression" + }, + "fullDescription": { + "text": "Reports a conditional expression of the form 'condition ? true : false\ncondition ? false : true' These expressions may be safely converted to 'condition\n!condition'", + "markdown": "Reports a conditional expression of the form\n\n\n condition ? true : false\n condition ? false : true\n\n\nThese expressions may be safely converted to\n\n\n condition\n !condition\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantConditionalExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSTestFailedLine", + "shortDescription": { + "text": "Highlight failure line in test code" + }, + "fullDescription": { + "text": "Reports a failed method call or an assertion in a test.", + "markdown": "Reports a failed method call or an assertion in a test." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSTestFailedLine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Unit testing", + "index": 140, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfStatementWithTooManyBranchesJS", + "shortDescription": { + "text": "'if' statement with too many branches" + }, + "fullDescription": { + "text": "Reports an 'if' statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction. Use the field below to specify the maximum number of branches expected.", + "markdown": "Reports an `if` statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction.\n\n\nUse the field below to specify the maximum number of branches expected." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IfStatementWithTooManyBranchesJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BreakStatementJS", + "shortDescription": { + "text": "'break' statement" + }, + "fullDescription": { + "text": "Reports a 'break' statements. Ignores 'break' statements that end case blocks.", + "markdown": "Reports a `break` statements. Ignores `break` statements that end case blocks." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BreakStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DebuggerStatementJS", + "shortDescription": { + "text": "'debugger' statement" + }, + "fullDescription": { + "text": "Reports a 'debugger' statement used for interaction with the Javascript debuggers. Such statements should not appear in production code.", + "markdown": "Reports a `debugger` statement used for interaction with the Javascript debuggers. Such statements should not appear in production code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DebuggerStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToForLoopParameterJS", + "shortDescription": { + "text": "Assignment to 'for' loop parameter" + }, + "fullDescription": { + "text": "Reports an assignment to a variable declared as a 'for' loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error.", + "markdown": "Reports an assignment to a variable declared as a `for` loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToForLoopParameterJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Assignment issues", + "index": 108, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalExpressionJS", + "shortDescription": { + "text": "Conditional expression" + }, + "fullDescription": { + "text": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit 'if' statements.", + "markdown": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit `if` statements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionalExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessBooleanExpressionJS", + "shortDescription": { + "text": "Pointless statement or boolean expression" + }, + "fullDescription": { + "text": "Reports a pointless or pointlessly complicated boolean expression or statement. Example: 'let a = !(false && x);\n let b = false || x;' After the quick fix is applied the result looks like: 'let a = true;\n let b = x;'", + "markdown": "Reports a pointless or pointlessly complicated boolean expression or statement.\n\nExample:\n\n\n let a = !(false && x);\n let b = false || x;\n\nAfter the quick fix is applied the result looks like:\n\n\n let a = true;\n let b = x;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessBooleanExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUrlImportUsage", + "shortDescription": { + "text": "URL import is used" + }, + "fullDescription": { + "text": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. URLs in import specifiers are supported only for ECMAScript modules in the JavaScript language.", + "markdown": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. \n\nURLs in import specifiers are supported only for ECMAScript modules in the JavaScript language." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSUrlImportUsage", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLabelOnContinueStatementJS", + "shortDescription": { + "text": "Unnecessary label on 'continue' statement" + }, + "fullDescription": { + "text": "Reports a labeled 'continue' statement whose labels may be removed without changing the flow of control.", + "markdown": "Reports a labeled `continue` statement whose labels may be removed without changing the flow of control." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLabelOnContinueStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", + "shortDescription": { + "text": "Possibly incorrect target of indexed property access" + }, + "fullDescription": { + "text": "Reports a potentially invalid indexed property access, for example, 'Array[1]'.", + "markdown": "Reports a potentially invalid indexed property access, for example, `Array[1]`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSTypeOfValues", + "shortDescription": { + "text": "'typeof' comparison with non-standard value" + }, + "fullDescription": { + "text": "Reports a comparison of a 'typeof' expression with a literal string which is not one of the standard types: 'undefined', 'object', 'boolean', 'number', 'string', 'function', or 'symbol'. Such comparisons always return 'false'.", + "markdown": "Reports a comparison of a `typeof` expression with a literal string which is not one of the standard types: `undefined`, `object`, `boolean`, `number`, `string`, `function`, or `symbol`. Such comparisons always return `false`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSTypeOfValues", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XHTMLIncompatabilitiesJS", + "shortDescription": { + "text": "Incompatible XHTML usages" + }, + "fullDescription": { + "text": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include document.body, document.images, document.applets, document.links, document.forms, and document.anchors.", + "markdown": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include **document.body** , **document.images** , **document.applets** , **document.links** , **document.forms** , and **document.anchors**." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XHTMLIncompatabilitiesJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/DOM issues", + "index": 51, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSAnnotator", + "shortDescription": { + "text": "ECMAScript specification is not followed" + }, + "fullDescription": { + "text": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. Generally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors.", + "markdown": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. \nGenerally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JSAnnotator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6ConvertToForOf", + "shortDescription": { + "text": "'for..in' is used instead of 'for..of'" + }, + "fullDescription": { + "text": "Reports a usage of a 'for..in' loop on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops, which are introduced in ECMAScript 6, iterate over 'iterable' objects. For arrays, this structure is preferable to 'for..in', because it works only with array values but not with array object's properties.", + "markdown": "Reports a usage of a [for..in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) loop on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops, which are introduced in ECMAScript 6, iterate over `iterable` objects. For arrays, this structure is preferable to `for..in`, because it works only with array values but not with array object's properties." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6ConvertToForOf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/ES2015 migration aids", + "index": 49, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThisExpressionReferencesGlobalObjectJS", + "shortDescription": { + "text": "'this' expression which references the global object" + }, + "fullDescription": { + "text": "Reports a 'this' expression outside an object literal or a constructor body. Such 'this' expressions reference the top-level \"global\" JavaScript object, but are mostly useless.", + "markdown": "Reports a `this` expression outside an object literal or a constructor body. Such `this` expressions reference the top-level \"global\" JavaScript object, but are mostly useless." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThisExpressionReferencesGlobalObjectJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedFunctionCallJS", + "shortDescription": { + "text": "Nested function call" + }, + "fullDescription": { + "text": "Reports a function call that is used as an argument in another function call, for example, 'foo(bar())'", + "markdown": "Reports a function call that is used as an argument in another function call, for example, `foo(bar())`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedFunctionCallJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSEqualityComparisonWithCoercion", + "shortDescription": { + "text": "Equality operator may cause type coercion" + }, + "fullDescription": { + "text": "Reports a usage of an equality operator that may cause unexpected type coercions. Suggests replacing '==' and '!=' with type-safe equality operators '===' and '!=='. Depending on the option selected, one of the following cases will be reported: All usages of '==' and '!=' operators. All usages except comparison with null. Some code styles allow using 'x == null' as a replacement for 'x === null || x === undefined'. Only suspicious expressions, such as: '==' or '!=' comparisons with '0', '''', 'null', 'true', 'false', or 'undefined'.", + "markdown": "Reports a usage of an equality operator that may cause unexpected type coercions. Suggests replacing `==` and `!=` with type-safe equality operators `===` and `!==`.\n\nDepending on the option selected, one of the following cases will be reported:\n\n* All usages of `==` and `!=` operators.\n* All usages except comparison with null. Some code styles allow using `x == null` as a replacement for `x === null || x === undefined`.\n* Only suspicious expressions, such as: `==` or `!=` comparisons with `0`, `''`, `null`, `true`, `false`, or `undefined`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EqualityComparisonWithCoercionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSNonStrictModeUsed", + "shortDescription": { + "text": "Non-strict mode used" + }, + "fullDescription": { + "text": "Reports a JavaScript file that is not in the 'strict' mode.", + "markdown": "Reports a JavaScript file that is not in the `strict` mode." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSNonStrictModeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptExplicitMemberType", + "shortDescription": { + "text": "Explicit types" + }, + "fullDescription": { + "text": "Reports a type annotation that doesn't match the current code style for explicit types. Type declarations are not necessary when the type that is inferred from the context exactly matches the type annotation, for example: 'var pi: number = 3.14' In some cases it is preferable to always have explicit types - this prevents accidental type changes and makes code more explicit.", + "markdown": "Reports a type annotation that doesn't match the current code style for explicit types.\n\n\nType declarations are not necessary when the type that is inferred from the context exactly matches the type annotation, for example:\n\n\n var pi: number = 3.14\n\nIn some cases it is preferable to always have explicit types - this prevents accidental type changes and makes code more explicit." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptExplicitMemberType", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSDuplicateCaseLabel", + "shortDescription": { + "text": "Duplicate 'case' label" + }, + "fullDescription": { + "text": "Reports a duplicated 'case' label on a 'switch' statement, which normally indicates an error.", + "markdown": "Reports a duplicated `case` label on a `switch` statement, which normally indicates an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSDuplicateCaseLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSXDomNesting", + "shortDescription": { + "text": "Invalid DOM element nesting" + }, + "fullDescription": { + "text": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements.", + "markdown": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSXDomNesting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/React", + "index": 158, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLocalVariableJS", + "shortDescription": { + "text": "Redundant local variable" + }, + "fullDescription": { + "text": "Reports an unnecessary local variable that does not make a function more comprehensible: a local variable that is immediately returned a local variable that is immediately assigned to another variable and is not used anymore a local variable that always has the same value as another local variable or parameter. Use the checkbox below to have this inspection ignore variables that are immediately returned or thrown. Some coding styles suggest using such variables for clarity and ease of debugging.", + "markdown": "Reports an unnecessary local variable that does not make a function more comprehensible:\n\n* a local variable that is immediately returned\n* a local variable that is immediately assigned to another variable and is not used anymore\n* a local variable that always has the same value as another local variable or parameter.\n\n\nUse the checkbox below to have this inspection ignore variables that are immediately\nreturned or thrown. Some coding styles suggest using such variables for clarity and\nease of debugging." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLocalVariableJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Data flow", + "index": 112, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSXUnresolvedComponent", + "shortDescription": { + "text": "Unresolved JSX component" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name. The template for a new component can be modified in Editor | File and Code Templates.", + "markdown": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSXUnresolvedComponent", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLabelOnBreakStatementJS", + "shortDescription": { + "text": "Unnecessary label on 'break' statement" + }, + "fullDescription": { + "text": "Reports a labeled 'break' statement whose labels may be removed without changing the flow of control.", + "markdown": "Reports a labeled `break` statement whose labels may be removed without changing the flow of control." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLabelOnBreakStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DivideByZeroJS", + "shortDescription": { + "text": "Division by zero" + }, + "fullDescription": { + "text": "Reports division by zero or a remainder by zero.", + "markdown": "Reports division by zero or a remainder by zero." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DivideByZeroJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChainedEqualityJS", + "shortDescription": { + "text": "Chained equality" + }, + "fullDescription": { + "text": "Reports a chained equality comparison (i.e. 'a==b==c'). Such comparisons are confusing.", + "markdown": "Reports a chained equality comparison (i.e. `a==b==c`). Such comparisons are confusing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainedEqualityComparisonsJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSRedundantSwitchStatement", + "shortDescription": { + "text": "'switch' statement is redundant and can be replaced" + }, + "fullDescription": { + "text": "Reports a 'switch' statement with an empty body, or with only one 'case' branch, or with a 'default' branch only.", + "markdown": "Reports a `switch` statement with an empty body, or with only one `case` branch, or with a `default` branch only." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSRedundantSwitchStatement", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BlockStatementJS", + "shortDescription": { + "text": "Unnecessary block statement" + }, + "fullDescription": { + "text": "Reports a block statement that is not used as the body of 'if', 'for', 'while', 'do', 'with', or 'try' statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for 'let' and 'const' variables, but still free-standing block statements may be confusing and result in subtle bugs when used with 'var' variables.", + "markdown": "Reports a block statement that is not used as the body of `if`, `for`, `while`, `do`, `with`, or `try` statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for `let` and `const` variables, but still free-standing block statements may be confusing and result in subtle bugs when used with `var` variables." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BlockStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TextLabelInSwitchStatementJS", + "shortDescription": { + "text": "Text label in 'switch' statement" + }, + "fullDescription": { + "text": "Reports a labeled statement inside a 'switch' statement, which often results from a typo. Example: 'switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }'", + "markdown": "Reports a labeled statement inside a `switch` statement, which often results from a typo.\n\nExample:\n\n\n switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TextLabelInSwitchStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSOctalInteger", + "shortDescription": { + "text": "Octal integer" + }, + "fullDescription": { + "text": "Reports a deprecated octal integer literal prefixed with '0' instead of '0o'. Such literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. To force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below.", + "markdown": "Reports a deprecated octal integer literal prefixed with `0` instead of `0o`. \nSuch literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. \nTo force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JSOctalInteger", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyTryBlockJS", + "shortDescription": { + "text": "Empty 'try' block" + }, + "fullDescription": { + "text": "Reports an empty 'try' block, which usually indicates an error.", + "markdown": "Reports an empty `try` block, which usually indicates an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyTryBlockJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Try statement issues", + "index": 97, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSIgnoredPromiseFromCall", + "shortDescription": { + "text": "Result of method call returning a promise is ignored" + }, + "fullDescription": { + "text": "Reports a function call that returns a 'Promise' that is not used later. Such calls are usually unintended and indicate an error.", + "markdown": "Reports a function call that returns a `Promise` that is not used later. Such calls are usually unintended and indicate an error." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSIgnoredPromiseFromCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Async code and promises", + "index": 103, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringLiteralBreaksHTMLJS", + "shortDescription": { + "text": "String literal which breaks HTML parsing" + }, + "fullDescription": { + "text": "Reports a string literal that contains a ' for the complete list." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NodeCoreCodingAssistance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Node.js", + "index": 172, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSPrimitiveTypeWrapperUsage", + "shortDescription": { + "text": "Primitive type object wrapper used" + }, + "fullDescription": { + "text": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost.", + "markdown": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSPrimitiveTypeWrapperUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSLastCommaInArrayLiteral", + "shortDescription": { + "text": "Unneeded last comma in array literal" + }, + "fullDescription": { + "text": "Reports a usage of a trailing comma in an array literal. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Although trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", + "markdown": "Reports a usage of a trailing comma in an array literal.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nAlthough trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSLastCommaInArrayLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedConditionalExpressionJS", + "shortDescription": { + "text": "Negated conditional expression" + }, + "fullDescription": { + "text": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: '!condition ? 2 : 1'", + "markdown": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: `!condition ? 2 : 1`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NegatedConditionalExpressionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LabeledStatementJS", + "shortDescription": { + "text": "Labeled statement" + }, + "fullDescription": { + "text": "Reports a labeled statement.", + "markdown": "Reports a labeled statement." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LabeledStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WithStatementJS", + "shortDescription": { + "text": "'with' statement" + }, + "fullDescription": { + "text": "Reports a 'with' statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables.", + "markdown": "Reports a `with` statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WithStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially undesirable code constructs", + "index": 31, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSConstantReassignment", + "shortDescription": { + "text": "Attempt to assign to const or readonly variable" + }, + "fullDescription": { + "text": "Reports reassigning a value to a constant or a readonly variable.", + "markdown": "Reports reassigning a value to a constant or a readonly variable." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JSConstantReassignment", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Validity issues", + "index": 22, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MagicNumberJS", + "shortDescription": { + "text": "Magic number" + }, + "fullDescription": { + "text": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored.", + "markdown": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MagicNumberJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptLibrary", + "shortDescription": { + "text": "Missing global library" + }, + "fullDescription": { + "text": "Reports a TypeScript library file that is required for a symbol but is not listed under the 'lib' compiler option in 'tsconfig.json'.", + "markdown": "Reports a TypeScript library file that is required for a symbol but is not listed under the `lib` compiler option in `tsconfig.json`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "TypeScriptLibrary", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptMissingAugmentationImport", + "shortDescription": { + "text": "Missing augmentation import" + }, + "fullDescription": { + "text": "Reports a usage from augmentation module without an explicit import.", + "markdown": "Reports a usage from [augmentation module](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) without an explicit import." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TypeScriptMissingAugmentationImport", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Eslint", + "shortDescription": { + "text": "ESLint" + }, + "fullDescription": { + "text": "Reports a discrepancy detected by the ESLint linter. The highlighting is based on the rule severity specified in the ESLint configuration file for each individual rule. Clear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules.", + "markdown": "Reports a discrepancy detected by the [ESLint](https://eslint.org) linter. \n\nThe highlighting is based on the rule severity specified in the [ESLint configuration file](https://eslint.org/docs/user-guide/configuring) for each individual rule. \n\nClear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Eslint", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code quality tools", + "index": 69, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSEqualityComparisonWithCoercion.TS", + "shortDescription": { + "text": "Equality operator may cause type coercion" + }, + "fullDescription": { + "text": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing '==' or '!=' equality operators with type-safe '===' or '!==' operators. Depending on the option selected, one of the following cases will be reported: All usages of '==' and '!=' operators. All usages except comparison with null. Some code styles allow using 'x == null' as a replacement for 'x === null || x === undefined'. Only suspicious expressions, such as: '==' or '!=' comparisons with '0', '''', 'null', 'true', 'false', or 'undefined'.", + "markdown": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing `==` or `!=` equality operators with type-safe `===` or `!==` operators.\n\nDepending on the option selected, one of the following cases will be reported:\n\n* All usages of `==` and `!=` operators.\n* All usages except comparison with null. Some code styles allow using `x == null` as a replacement for `x === null || x === undefined`.\n* Only suspicious expressions, such as: `==` or `!=` comparisons with `0`, `''`, `null`, `true`, `false`, or `undefined`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EqualityComparisonWithCoercionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageJsonMismatchedDependency", + "shortDescription": { + "text": "Mismatched dependencies in package.json" + }, + "fullDescription": { + "text": "Reports a dependency from package.json that is not installed or doesn't match the specified version range.", + "markdown": "Reports a dependency from package.json that is not installed or doesn't match the specified [version range](https://docs.npmjs.com/about-semantic-versioning)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageJsonMismatchedDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Imports and dependencies", + "index": 120, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InfiniteLoopJS", + "shortDescription": { + "text": "Infinite loop statement" + }, + "fullDescription": { + "text": "Reports a 'for', 'while', or 'do' statement which can only exit by throwing an exception. Such statements often indicate coding errors.", + "markdown": "Reports a `for`, `while`, or `do` statement which can only exit by throwing an exception. Such statements often indicate coding errors." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InfiniteLoopJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Probable bugs", + "index": 86, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSArrowFunctionBracesCanBeRemoved", + "shortDescription": { + "text": "Redundant braces around arrow function body" + }, + "fullDescription": { + "text": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces. 'let incrementer = (x) => {return x + 1};' After the quick-fix is applied, the code fragment looks as follows: 'let incrementer = (x) => x + 1;'", + "markdown": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces.\n\n\n let incrementer = (x) => {return x + 1};\n\nAfter the quick-fix is applied, the code fragment looks as follows:\n\n\n let incrementer = (x) => x + 1;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSArrowFunctionBracesCanBeRemoved", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSClassNamingConvention", + "shortDescription": { + "text": "Class naming convention" + }, + "fullDescription": { + "text": "Reports a class or a function that is annotated with a JSDoc '@constructor' or '@class' tag whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for classes names. Use the standard 'java.util.regex' format for regular expressions.", + "markdown": "Reports a class or a function that is annotated with a JSDoc `@constructor` or `@class` tag whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for classes names. Use the standard `java.util.regex` format for regular expressions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSClassNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Naming conventions", + "index": 104, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUndefinedPropertyAssignment", + "shortDescription": { + "text": "Undefined property assignment" + }, + "fullDescription": { + "text": "Reports an assignment to a property that is not defined in the type of a variable. Example: '/**\n * @type {{ property1: string, property2: number }}\n */\nlet myVariable = create();\n\nmyVariable.newProperty = 3; // bad'", + "markdown": "Reports an assignment to a property that is not defined in the type of a variable.\n\nExample:\n\n\n /**\n * @type {{ property1: string, property2: number }}\n */\n let myVariable = create();\n\n myVariable.newProperty = 3; // bad\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSUndefinedPropertyAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code style issues", + "index": 79, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSDeprecatedSymbols", + "shortDescription": { + "text": "Deprecated symbol used" + }, + "fullDescription": { + "text": "Reports a usage of a deprecated function variable.", + "markdown": "Reports a usage of a deprecated function variable." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSDeprecatedSymbols", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalVariableNamingConventionJS", + "shortDescription": { + "text": "Local variable naming convention" + }, + "fullDescription": { + "text": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", + "markdown": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LocalVariableNamingConventionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Naming conventions", + "index": 104, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnresolvedExtXType", + "shortDescription": { + "text": "Unresolved Ext JS xtype" + }, + "fullDescription": { + "text": "Reports an Ext JS 'xtype' reference that doesn't have a corresponding class.", + "markdown": "Reports an Ext JS `xtype` reference that doesn't have a corresponding class." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnresolvedExtXType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ES6RedundantNestingInTemplateLiteral", + "shortDescription": { + "text": "Redundant nesting in template literal" + }, + "fullDescription": { + "text": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string. Example: 'let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`' After applying the quick-fix the code looks as follows: 'let a = `Hello, Brave New World!`'", + "markdown": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string.\n\nExample:\n\n\n let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`\n\nAfter applying the quick-fix the code looks as follows:\n\n\n let a = `Hello, Brave New World!`\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ES6RedundantNestingInTemplateLiteral", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestingDepthJS", + "shortDescription": { + "text": "Overly nested function" + }, + "fullDescription": { + "text": "Reports a function whose body contains statements that are too deeply nested within other statements. Such functions may be confusing and indicate that refactoring may be necessary. Use the field provided below to specify the maximum acceptable nesting depth allowed in a function.", + "markdown": "Reports a function whose body contains statements that are too deeply nested within other statements. Such functions may be confusing and indicate that refactoring may be necessary.\n\n\nUse the field provided below to specify the maximum acceptable nesting depth allowed in a function." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyNestedFunctionJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Function metrics", + "index": 76, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeScriptSuspiciousConstructorParameterAssignment", + "shortDescription": { + "text": "Assigned constructor field parameter" + }, + "fullDescription": { + "text": "Reports a common mistake in TypeScript code, when a class field is declared as a constructor parameter, and then this parameter is assigned. In this case, the corresponding field won't be assigned, only the local parameter value is modified. 'class Foo {\n constructor(private p: number) {\n p = 1; //must be this.p = 1;\n }\n}'", + "markdown": "Reports a common mistake in TypeScript code, when a class field is declared as a constructor parameter, and then this parameter is assigned. \nIn this case, the corresponding field *won't* be assigned, only the local parameter value is modified.\n\n\n class Foo {\n constructor(private p: number) {\n p = 1; //must be this.p = 1;\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeScriptSuspiciousConstructorParameterAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/TypeScript", + "index": 55, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedSwitchStatementJS", + "shortDescription": { + "text": "Nested 'switch' statement" + }, + "fullDescription": { + "text": "Reports a 'switch' statement that is nested in another 'switch' statement. Nested 'switch' statements may be very confusing, particularly if indenting is inconsistent.", + "markdown": "Reports a `switch` statement that is nested in another `switch` statement. Nested `switch` statements may be very confusing, particularly if indenting is inconsistent." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedSwitchStatementJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSMissingSwitchBranches", + "shortDescription": { + "text": "'switch' statement has missing branches" + }, + "fullDescription": { + "text": "Reports a 'switch' statement on a variable of the type 'enum' or 'union' when the statement doesn't cover some value options from the type.", + "markdown": "Reports a `switch` statement on a variable of the type `enum` or `union` when the statement doesn't cover some value options from the type." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JSMissingSwitchBranches", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Switch statement issues", + "index": 109, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSJQueryEfficiency", + "shortDescription": { + "text": "JQuery selector can be optimized" + }, + "fullDescription": { + "text": "Reports a duplicated jQuery selector that can be cached or a usage of an attribute or a pseudo-selector (optional).", + "markdown": "Reports a duplicated jQuery selector that can be cached or a usage of an attribute or a pseudo-selector (optional)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSJQueryEfficiency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnreachableCodeJS", + "shortDescription": { + "text": "Unreachable code" + }, + "fullDescription": { + "text": "Reports code that can never be executed, which almost certainly indicates an error", + "markdown": "Reports code that can never be executed, which almost certainly indicates an error" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnreachableCodeJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Control flow issues", + "index": 65, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyStatementBodyJS", + "shortDescription": { + "text": "Statement with empty body" + }, + "fullDescription": { + "text": "Reports an 'if', 'while', 'for', or 'with' statement with an empty body. Such statements often result from typos, and may cause confusion. Use the checkbox below to specify whether the statements with empty block statements as bodies should be reported.", + "markdown": "Reports an `if`, `while`, `for`, or `with` statement with an empty body. Such statements often result from typos, and may cause confusion.\n\n\nUse the checkbox below to specify whether the statements with empty block statements as bodies\nshould be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StatementWithEmptyBodyJS", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Potentially confusing code constructs", + "index": 61, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSUnusedLocalSymbols", + "shortDescription": { + "text": "Unused local symbol" + }, + "fullDescription": { + "text": "Reports an unused locally accessible parameter, local variable, function, class, or private member declaration.", + "markdown": "Reports an unused locally accessible parameter, local variable, function, class, or private member declaration." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JSUnusedLocalSymbols", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Unused symbols", + "index": 117, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.jetbrains.restClient", + "version": "243.24609", + "rules": [ + { + "id": "HttpClientRunRequestNameInspection", + "shortDescription": { + "text": "Possible request name" + }, + "fullDescription": { + "text": "Highlights request name in run block which has no specified import file. Suggests adding import for the file which contains this named request.", + "markdown": "Highlights request name in run block which has no specified import file. Suggests adding import for the file which contains this named request." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpClientRunRequestNameInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpClientUnresolvedAuthId", + "shortDescription": { + "text": "Unresolved Auth identifier" + }, + "fullDescription": { + "text": "Highlights references to non-existent Auth configurations. Suggests creating a new one in the current environment.", + "markdown": "Highlights references to non-existent Auth configurations. Suggests creating a new one in the current environment." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "HttpClientUnresolvedAuthId", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestRequestSeparatorJsonBodyInspection", + "shortDescription": { + "text": "Missing request separator in JSON body" + }, + "fullDescription": { + "text": "Reports possible requests in injected JSON body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", + "markdown": "Reports possible requests in injected JSON body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpRequestRequestSeparatorJsonBodyInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestContentLengthIsIgnored", + "shortDescription": { + "text": "Redundant 'Content-Length'" + }, + "fullDescription": { + "text": "Reports an explicitly set 'Content-Length' header. The header is redundant because HTTP Client uses the actual request body length.", + "markdown": "Reports an explicitly set `Content-Length` header. The header is redundant because HTTP Client uses the actual request body length." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpRequestContentLengthIsIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestRequestSeparatorXmlBodyInspection", + "shortDescription": { + "text": "Missing request separator in HTML/XML body" + }, + "fullDescription": { + "text": "Reports possible requests in injected XML/HTML body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", + "markdown": "Reports possible requests in injected XML/HTML body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpRequestRequestSeparatorXmlBodyInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestJsonBodyInspection", + "shortDescription": { + "text": "Variable should be double-quoted" + }, + "fullDescription": { + "text": "Reports variables which should be double-quoted in json body. The quick fix suggests wrap variable with double quotes '\"{{variable}}\"'.", + "markdown": "Reports variables which should be double-quoted in json body. The quick fix suggests wrap variable with double quotes `\"{{variable}}\"`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpRequestJsonBodyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestCustomHttpMethodInspection", + "shortDescription": { + "text": "Unknown HTTP method" + }, + "fullDescription": { + "text": "Reports possible custom HTTP methods. The quick fix suggests adding the custom HTTP method to project settings.", + "markdown": "Reports possible custom HTTP methods. The quick fix suggests adding the custom HTTP method to project settings." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpRequestCustomHttpMethodInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpClientUnresolvedVariable", + "shortDescription": { + "text": "Unresolved environment variable" + }, + "fullDescription": { + "text": "Reports variables undeclared in the current environment HTTP Client. Executing requests with undeclared variables probably fail. Consider adding a variable to the environment or selecting an environment with this variable. Inspection doesn't report variables in request bodies, because it can be a valid syntax of the body. Some variables may be not reported as unresolved, because they are declared in response or pre-request handler scripts via 'client.global.set' or 'request.variables.set' functions call.", + "markdown": "Reports variables undeclared in the current environment HTTP Client.\n\n\nExecuting requests with undeclared variables probably fail.\nConsider adding a variable to the environment or selecting an environment with this variable.\n\nInspection doesn't report variables in request bodies, because it can be a valid syntax of the body.\n\n\nSome variables may be not reported as unresolved, because they are declared in response or pre-request handler scripts via\n`client.global.set` or `request.variables.set` functions call." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpClientUnresolvedVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectHttpHeaderInspection", + "shortDescription": { + "text": "Incorrect HTTP header" + }, + "fullDescription": { + "text": "Reports unknown HTTP headers that do not match any publicly known headers. The quick fix suggests adding the header to the list of custom headers when the Use custom HTTP headers option is enabled. HTTP headers from the list of custom headers will not trigger the inspection.", + "markdown": "Reports unknown HTTP headers that do not match any [publicly\nknown headers](https://www.iana.org/assignments/message-headers/message-headers.xml). The quick fix suggests adding the header to the list of custom headers when the **Use custom HTTP headers** option\nis enabled. HTTP headers from the list of custom headers will not trigger the inspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IncorrectHttpHeaderInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestEnvironmentAuthConfigurationValidationInspection", + "shortDescription": { + "text": "Auth configuration validation" + }, + "fullDescription": { + "text": "Reports Auth configuration the following problems in HTTP Client environment files: Missing properties in Auth configuration Auth/Security configuration placed in private environment file", + "markdown": "Reports Auth configuration the following problems in HTTP Client environment files:\n\n* Missing properties in Auth configuration\n* Auth/Security configuration placed in private environment file" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpRequestEnvironmentAuthConfigurationValidationInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpUrlsUsage", + "shortDescription": { + "text": "Link with unencrypted protocol" + }, + "fullDescription": { + "text": "Reports the links that use unencrypted protocols (such as HTTP), which can expose your data to man-in-the-middle attacks. These attacks are dangerous in general and may be especially harmful for artifact repositories. Use protocols with encryption, such as HTTPS, instead. See HTTPS: Difference from HTTP (wikipedia.org).", + "markdown": "Reports the links that use unencrypted protocols (such as HTTP), which can expose your data to man-in-the-middle attacks. These attacks\nare dangerous in general and may be especially harmful for artifact repositories. Use protocols with encryption, such as HTTPS,\ninstead.\n\nSee [HTTPS: Difference from HTTP (wikipedia.org)](https://en.wikipedia.org/wiki/HTTPS#Difference_from_HTTP)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpUrlsUsage", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Security", + "index": 131, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestPlaceholder", + "shortDescription": { + "text": "'$placeholder' in HTTP Request" + }, + "fullDescription": { + "text": "Reports a '$placeholder' inside a request. A '$placeholder' to be replaced by the user is created automatically when a tool cannot recognize a part of a request. For example, a request mapping '/aaaa/*/bbb' will be generated as 'GET localhost/aaaa/{{$placeholder}}/bbb'.", + "markdown": "Reports a `$placeholder` inside a request.\n\nA `$placeholder` to be replaced by the user is created automatically when a tool cannot recognize a part of a request. For example, a request mapping `/aaaa/*/bbb` will be generated as `GET localhost/aaaa/{{$placeholder}}/bbb`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HttpRequestPlaceholder", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestWhitespaceInsideRequestTargetPath", + "shortDescription": { + "text": "Whitespace in URL in request" + }, + "fullDescription": { + "text": "Highlights spaces inside URL path segments. HTTP Client will ignore them. For better composing use Split Lines action.", + "markdown": "Highlights spaces inside URL path segments. HTTP Client will ignore them. For better composing use Split Lines action." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpRequestWhitespaceInsideRequestTargetPath", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpClientInappropriateProtocolUsageInspection", + "shortDescription": { + "text": "Inappropriate HTTP Protocol usage" + }, + "fullDescription": { + "text": "Reports inappropriate usage of HTTP protocol keyword, e.g. 'HTTP/2', with non-HTTP method requests. Such a usage will be ignored.", + "markdown": "Reports inappropriate usage of HTTP protocol keyword, e.g. `HTTP/2`, with non-HTTP method requests. Such a usage will be ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpClientInappropriateProtocolUsageInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HttpRequestRequestSeparatorYamlBodyInspection", + "shortDescription": { + "text": "Missing request separator in YAML body" + }, + "fullDescription": { + "text": "Reports possible requests in injected YAML body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", + "markdown": "Reports possible requests in injected YAML body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HttpRequestRequestSeparatorYamlBodyInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTTP Client", + "index": 19, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.editorconfig.editorconfigjetbrains", + "version": "243.24609", + "rules": [ + { + "id": "EditorConfigNumerousWildcards", + "shortDescription": { + "text": "Too many wildcards" + }, + "fullDescription": { + "text": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues.", + "markdown": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigNumerousWildcards", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigKeyCorrectness", + "shortDescription": { + "text": "Unknown property" + }, + "fullDescription": { + "text": "Reports properties that are not supported by the IDE. Note: some “ij” domain properties may require specific language plugins.", + "markdown": "Reports properties that are not supported by the IDE. Note: some \"ij\" domain properties may require specific language plugins." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigKeyCorrectness", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEncoding", + "shortDescription": { + "text": "File encoding doesn't match EditorConfig charset" + }, + "fullDescription": { + "text": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file.", + "markdown": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigEncoding", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEmptyHeader", + "shortDescription": { + "text": "Empty header" + }, + "fullDescription": { + "text": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by 'gitignore'.", + "markdown": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by `gitignore`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigEmptyHeader", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigSpaceInHeader", + "shortDescription": { + "text": "Space in file pattern" + }, + "fullDescription": { + "text": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed.", + "markdown": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigSpaceInHeader", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigOptionRedundancy", + "shortDescription": { + "text": "Redundant property" + }, + "fullDescription": { + "text": "Reports properties that are redundant when another applicable section already contains the same property and value. For example: '[*]\nindent_size=4\n[*.java]\nindent_size=4' are both applicable to '*.java' files and define the same 'indent_size' value.", + "markdown": "Reports properties that are redundant when another applicable section already contains the same property and value.\n\n\nFor example:\n\n\n [*]\n indent_size=4\n [*.java]\n indent_size=4\n\nare both applicable to `*.java` files and define the same `indent_size` value." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigOptionRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigWildcardRedundancy", + "shortDescription": { + "text": "Redundant wildcard" + }, + "fullDescription": { + "text": "Reports wildcards that become redundant when the “**” wildcard is used in the same section. The “**” wildcard defines a broader set of files than any other wildcard. That is why, any other wildcard used in the same section has no affect and can be removed.", + "markdown": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigWildcardRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigUnusedDeclaration", + "shortDescription": { + "text": "Unused declaration" + }, + "fullDescription": { + "text": "Reports unused declarations. Such declarations can be removed.", + "markdown": "Reports unused declarations. Such declarations can be removed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigUnusedDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigRootDeclarationUniqueness", + "shortDescription": { + "text": "Extra top-level declaration" + }, + "fullDescription": { + "text": "Reports multiple top-level declarations. There can be only one optional “root=true” top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed.", + "markdown": "Reports multiple top-level declarations. There can be only one optional \"root=true\" top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigRootDeclarationUniqueness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigShadowedOption", + "shortDescription": { + "text": "Overridden property" + }, + "fullDescription": { + "text": "Reports properties that are already defined in other sections. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes all '*.java' files too but it also redefines indent_size. As a result the value 2 will be used for files matching '*.java'.", + "markdown": "Reports properties that are already defined in other sections.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes all `*.java` files too but it also redefines indent_size. As a result the value 2 will be used for files matching `*.java`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigShadowedOption", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigValueUniqueness", + "shortDescription": { + "text": "Non-unique list value" + }, + "fullDescription": { + "text": "Reports duplicates in lists of values.", + "markdown": "Reports duplicates in lists of values." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigValueUniqueness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigUnexpectedComma", + "shortDescription": { + "text": "Unexpected comma" + }, + "fullDescription": { + "text": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists.", + "markdown": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigUnexpectedComma", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigShadowingOption", + "shortDescription": { + "text": "Overriding property" + }, + "fullDescription": { + "text": "Reports properties that override the same properties defined earlier in the file. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes the same files as '[*.java]' but also sets indent_size to value 2. Thus the first declaration 'indent_size=4'will be ignored.", + "markdown": "Reports properties that override the same properties defined earlier in the file.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes the same files as `[*.java]` but also sets indent_size to value 2. Thus the first declaration `indent_size=4`will be ignored." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigShadowingOption", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigReferenceCorrectness", + "shortDescription": { + "text": "Invalid reference" + }, + "fullDescription": { + "text": "Reports identifiers that are either unknown or have a wrong type.", + "markdown": "Reports identifiers that are either unknown or have a wrong type." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigReferenceCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigCharClassLetterRedundancy", + "shortDescription": { + "text": "Duplicate character class letter" + }, + "fullDescription": { + "text": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example '[aa]'.", + "markdown": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigCharClassLetterRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigMissingRequiredDeclaration", + "shortDescription": { + "text": "Required declarations are missing" + }, + "fullDescription": { + "text": "Reports properties that miss the required declarations. Refer to the documentation for more information.", + "markdown": "Reports properties that miss the required declarations. Refer to the documentation for more information." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigMissingRequiredDeclaration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPartialOverride", + "shortDescription": { + "text": "Overlapping sections" + }, + "fullDescription": { + "text": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: '[{foo,bar}]' and '[{foo,bas}]' both contain “foo”.", + "markdown": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: `[{foo,bar}]` and `[{foo,bas}]` both contain \"foo\"." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigPartialOverride", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigListAcceptability", + "shortDescription": { + "text": "Unexpected value list" + }, + "fullDescription": { + "text": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified.", + "markdown": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigListAcceptability", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPatternEnumerationRedundancy", + "shortDescription": { + "text": "Unnecessary braces" + }, + "fullDescription": { + "text": "Reports pattern lists that are either empty '{}' or contain just one pattern, for example '{foo}' in contrast to a list containing multiple patterns, for example '{foo,bar}'. In this case braces are handled as a part of the name. For example, the pattern '*.{a}' will match the file 'my.{a}' but not 'my.a'.", + "markdown": "Reports pattern lists that are either empty `{}` or contain just one pattern, for example `{foo}` in contrast to a list containing multiple patterns, for example `{foo,bar}`. In this case braces are handled as a part of the name. For example, the pattern `*.{a}` will match the file `my.{a}` but not `my.a`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigPatternEnumerationRedundancy", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPairAcceptability", + "shortDescription": { + "text": "Unexpected key-value pair" + }, + "fullDescription": { + "text": "Reports key-value pairs that are not allowed in the current context.", + "markdown": "Reports key-value pairs that are not allowed in the current context." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigPairAcceptability", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigNoMatchingFiles", + "shortDescription": { + "text": "No matching files" + }, + "fullDescription": { + "text": "Reports sections with wildcard patterns that do not match any files under the directory in which the '.editorconfig' file is located.", + "markdown": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located." + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigNoMatchingFiles", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigHeaderUniqueness", + "shortDescription": { + "text": "EditorConfig section is not unique" + }, + "fullDescription": { + "text": "Reports sections that define the same file pattern as other sections.", + "markdown": "Reports sections that define the same file pattern as other sections." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigHeaderUniqueness", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigValueCorrectness", + "shortDescription": { + "text": "Invalid property value" + }, + "fullDescription": { + "text": "Reports property values that do not meet value restrictions. For example, some properties may be only “true” or “false”, others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them.", + "markdown": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigValueCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigRootDeclarationCorrectness", + "shortDescription": { + "text": "Unexpected top-level declaration" + }, + "fullDescription": { + "text": "Reports unexpected top-level declarations. Top-level declarations other than “root=true” are not allowed in the EditorConfig file.", + "markdown": "Reports unexpected top-level declarations. Top-level declarations other than \"root=true\" are not allowed in the EditorConfig file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigRootDeclarationCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPatternRedundancy", + "shortDescription": { + "text": "Duplicate or redundant pattern" + }, + "fullDescription": { + "text": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in '[{*.java,*}]' the first '*.java' pattern defines a narrower scope compared to '*'. That is why it is redundant and can be removed.", + "markdown": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in `[{*.java,*}]` the first `*.java` pattern defines a narrower scope compared to `*`. That is why it is redundant and can be removed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigPatternRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigDeprecatedDescriptor", + "shortDescription": { + "text": "Deprecated property" + }, + "fullDescription": { + "text": "Reports EditorConfig properties that are no longer supported.", + "markdown": "Reports EditorConfig properties that are no longer supported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigDeprecatedDescriptor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigCharClassRedundancy", + "shortDescription": { + "text": "Unnecessary character class" + }, + "fullDescription": { + "text": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example '[a]'→'a'.", + "markdown": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example `[a]`→`a`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigCharClassRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEmptySection", + "shortDescription": { + "text": "Empty section" + }, + "fullDescription": { + "text": "Reports sections that do not contain any EditorConfig properties.", + "markdown": "Reports sections that do not contain any EditorConfig properties." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigEmptySection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigVerifyByCore", + "shortDescription": { + "text": "Invalid .editorconfig file" + }, + "fullDescription": { + "text": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied.", + "markdown": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigVerifyByCore", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 20, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.database", + "version": "243.24609", + "rules": [ + { + "id": "SqlMissingReturnInspection", + "shortDescription": { + "text": "Missing return statement" + }, + "fullDescription": { + "text": "Reports functions that have no RETURN statements. Example (Oracle): 'CREATE FUNCTION foo RETURN int AS\nBEGIN\nEND;' The 'foo' function must return the integer value but the function body returns nothing. To fix the error, add a RETURN statement (for example, 'return 1;'). 'CREATE FUNCTION foo RETURN int AS\nBEGIN\n RETURN 1;\nEND;'", + "markdown": "Reports functions that have no RETURN statements.\n\nExample (Oracle):\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n END;\n\nThe `foo` function must return the integer value but the function body returns nothing. To fix the error,\nadd a RETURN statement (for example, `return 1;`).\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n RETURN 1;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SqlMissingReturn", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlCaseVsIfInspection", + "shortDescription": { + "text": "Using CASE instead of conditional function and vice versa" + }, + "fullDescription": { + "text": "Reports situations when CASE and IF are interchangeable. Example (MySQL): 'SELECT CASE\nWHEN C1 IS NULL THEN 1\nELSE 0\nEND\nFROM dual;' To keep your code short, you can replace the CASE structure with IF. You can do that by applying the Replace with 'IF' call intention action. The example code will look as follows: 'SELECT IF(C1 IS NULL, 1, 0)\nFROM dual;' To revert IF to CASE, click IF and apply the Replace with CASE expression intention action.", + "markdown": "Reports situations when CASE and IF are interchangeable.\n\nExample (MySQL):\n\n SELECT CASE\n WHEN C1 IS NULL THEN 1\n ELSE 0\n END\n FROM dual;\n\nTo keep your code short, you can replace the CASE structure with IF. You can do that by applying the **Replace with 'IF' call**\nintention action. The example code will look as follows:\n\n SELECT IF(C1 IS NULL, 1, 0)\n FROM dual;\n\nTo revert IF to CASE, click IF and apply the **Replace with CASE expression** intention action." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlCaseVsIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlShouldBeInGroupByInspection", + "shortDescription": { + "text": "Column should be in group by clause" + }, + "fullDescription": { + "text": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call. Example (Microsoft SQL Server): 'CREATE TABLE t1 (a INT, b INT);\nSELECT a, b FROM t1 GROUP BY a;' If you run the SELECT query, you will receive an error because Microsoft SQL Server expects the 'b' column in GROUP BY or used inside an aggregate function. The following two examples will fix the error. 'SELECT a, b FROM t1 GROUP BY a, b;\nSELECT a, max(b) max_b FROM t1 GROUP BY a;'", + "markdown": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t1 (a INT, b INT);\n SELECT a, b FROM t1 GROUP BY a;\n\nIf you run the SELECT query, you will receive an error because Microsoft SQL Server expects the `b` column in GROUP BY or used\ninside an aggregate function. The following two examples will fix the error.\n\n SELECT a, b FROM t1 GROUP BY a, b;\n SELECT a, max(b) max_b FROM t1 GROUP BY a;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlShouldBeInGroupBy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlMisleadingReferenceInspection", + "shortDescription": { + "text": "Misleading references" + }, + "fullDescription": { + "text": "Reports ambiguous references in SQL code. For example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected results due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority. Example (PostgreSQL): 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\nDECLARE\n b INT;\nBEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;' In PostgreSQL, you can use the '#variable_conflict' directives to explicitly specify a correct reference. For example, use '#variable_conflict use_column' to refer to a column name, or '#variable_conflict use_variable' to refer to a parameter. 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\n #variable_conflict use_column\nDECLARE\n b INT;\nBEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;'", + "markdown": "Reports ambiguous references in SQL code.\n\nFor example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected\nresults due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n DECLARE\n b INT;\n BEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n\nIn PostgreSQL, you can use the `#variable_conflict` directives to explicitly specify a correct reference. For example,\nuse `#variable_conflict use_column` to refer to a column name, or `#variable_conflict use_variable` to refer to a\nparameter.\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n #variable_conflict use_column\n DECLARE\n b INT;\n BEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlMisleadingReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlRedundantAliasInspection", + "shortDescription": { + "text": "Redundant alias expressions" + }, + "fullDescription": { + "text": "Reports alias expressions that duplicate names of columns in tables and might be redundant. Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT * FROM foo foo(a, b);\nSELECT * FROM foo foo(a);\nSELECT * FROM foo foo(x);\nSELECT * FROM foo foo(x, y);' The first two aliases use the same column names as in the 'foo' table. They are considered redundant because they column names are identical.", + "markdown": "Reports alias expressions that duplicate names of columns in tables and might be redundant.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT * FROM foo foo(a, b);\n SELECT * FROM foo foo(a);\n SELECT * FROM foo foo(x);\n SELECT * FROM foo foo(x, y);\n\nThe first two aliases use the same column names as in the `foo` table. They are considered redundant because they\ncolumn names are identical." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlRedundantAlias", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlUnusedCteInspection", + "shortDescription": { + "text": "Unused common table expression" + }, + "fullDescription": { + "text": "Reports unused common table expressions (CTE) inside the query. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nWITH a AS (SELECT 1 AS x FROM foo)\nSELECT 1 + 2 FROM foo;' By using WITH, we create a temporary named result set with the name 'a', also known as a common table expression (CTE). But we do not use this CTE later in the code. The unused CTE is greyed out.", + "markdown": "Reports unused common table expressions (CTE) inside the query.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n WITH a AS (SELECT 1 AS x FROM foo)\n SELECT 1 + 2 FROM foo;\n\nBy using WITH, we create a temporary named result set with the name `a`, also known as a common table expression (CTE). But\nwe do not use this CTE later in the code. The unused CTE is greyed out." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlUnusedCte", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSResolveInspection", + "shortDescription": { + "text": "Resolution problems" + }, + "fullDescription": { + "text": "Reports unresolved references in MongoDB and JavaScript code. Example: 'db\nuse foo\n -- a reference to a non-existing collection\ndb.non_existing_collection\ndb['non_existing_collection']\ndb['non_existing_collection'].find().hasNext()' The 'non_existing_collection' collection does not exist in the database and will be reported.", + "markdown": "Reports unresolved references in MongoDB and JavaScript code.\n\nExample:\n\n db\n use foo\n -- a reference to a non-existing collection\n db.non_existing_collection\n db['non_existing_collection']\n db['non_existing_collection'].find().hasNext()\n\nThe `non_existing_collection` collection does not exist in the database and will be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSResolve", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDialectInspection", + "shortDescription": { + "text": "SQL dialect detection" + }, + "fullDescription": { + "text": "Reports situations when a dialect is not assigned to an SQL file. For example, when you open a new SQL file without assigning a dialect to it, you see a notification where the best matching dialect is advised. Click the Use link to use the advised dialect. Alternatively, click the Change dialect to link to select the other dialect.", + "markdown": "Reports situations when a dialect is not assigned to an SQL file.\n\nFor example, when you open a new SQL file without assigning a dialect\nto it, you see a notification where the best matching dialect is advised. Click the **Use \\** link to use the advised\ndialect. Alternatively, click the **Change dialect to** link to select the other dialect." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDialectInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSExtDeprecationInspection", + "shortDescription": { + "text": "Deprecated element" + }, + "fullDescription": { + "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", + "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n\n db.my_collection.insertOne()\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSDeprecation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSDeprecationInspection", + "shortDescription": { + "text": "Deprecated element" + }, + "fullDescription": { + "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", + "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n db.my_collection.insertOne()\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSDeprecation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MsBuiltinInspection", + "shortDescription": { + "text": "Builtin functions" + }, + "fullDescription": { + "text": "Reports truncations of string arguments in ISNULL functions. The ISNULL syntax is 'ISNULL(check_expression, replacement_value)'. According to ISNULL at docs.microsoft.com, 'replacement_value' will be truncated if 'replacement_value' is longer than 'check_expression'. Example (Microsoft SQL Server): 'DECLARE @name1 VARCHAR(2) = NULL;\nDECLARE @name2 VARCHAR(10) = 'Example';\nDECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\nSELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\nSELECT ISNULL(@name1, @name3);'", + "markdown": "Reports truncations of string arguments in ISNULL functions.\n\nThe ISNULL syntax is `ISNULL(check_expression, replacement_value)`.\n\nAccording to [ISNULL at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/functions/isnull-transact-sql), `replacement_value` will be truncated if `replacement_value` is longer than\n`check_expression`.\n\nExample (Microsoft SQL Server):\n\n DECLARE @name1 VARCHAR(2) = NULL;\n DECLARE @name2 VARCHAR(10) = 'Example';\n DECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\n SELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\n SELECT ISNULL(@name1, @name3);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MssqlBuiltin", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL server", + "index": 102, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlMultipleLimitClausesInspection", + "shortDescription": { + "text": "Multiple row limiting/offset clauses in queries" + }, + "fullDescription": { + "text": "Reports usages of multiple row limiting clauses in a single query. Example (Microsoft SQL Server): 'create table foo(a int);\nselect top 1 * from foo order by a offset 10 rows fetch next 20 rows only;' The SELECT TOP clause is used to specify that only 1 record must be returned. The FETCH clause specifies the number of rows to return after the OFFSET clause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant.", + "markdown": "Reports usages of multiple row limiting clauses in a single query.\n\nExample (Microsoft SQL Server):\n\n create table foo(a int);\n select top 1 * from foo order by a offset 10 rows fetch next 20 rows only;\n\nThe SELECT TOP clause is used to specify that only 1 record must be\nreturned. The FETCH clause specifies the number of rows to return after the OFFSET\nclause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlMultipleLimitClauses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlAmbiguousColumnInspection", + "shortDescription": { + "text": "Ambiguous reference" + }, + "fullDescription": { + "text": "Reports columns that have identical names but belong to different tables. Example (MySQL): 'CREATE TABLE foo(id INT PRIMARY KEY);\nCREATE TABLE bar(id INT PRIMARY KEY);\n\nSELECT foo.id, bar.id FROM foo, bar WHERE id > 0;' The 'id' column appears in 'foo' and 'bar' tables. You need to qualify the column name to make the query correct. 'SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;'", + "markdown": "Reports columns that have identical names but belong to different tables.\n\nExample (MySQL):\n\n CREATE TABLE foo(id INT PRIMARY KEY);\n CREATE TABLE bar(id INT PRIMARY KEY);\n\n SELECT foo.id, bar.id FROM foo, bar WHERE id > 0;\n\nThe `id` column appears in `foo` and `bar` tables. You need to qualify the column name to\nmake the query correct.\n\n SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlAmbiguousColumn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlInsertValuesInspection", + "shortDescription": { + "text": "VALUES clause cardinality" + }, + "fullDescription": { + "text": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\n\nINSERT INTO foo VALUES (1,2,3,4)' The 'foo' table has three columns but in the INSERT INTO statement we pass four.", + "markdown": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n\n INSERT INTO foo VALUES (1,2,3,4)\n\nThe `foo` table has three columns but in the INSERT INTO statement we pass four." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlInsertValues", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlRedundantElseNullInspection", + "shortDescription": { + "text": "Redundant ELSE NULL clause" + }, + "fullDescription": { + "text": "Reports redundant ELSE NULL clauses. Example (MySQL): 'SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;' The 'ELSE NULL' part will never be executed and may be omitted.", + "markdown": "Reports redundant ELSE NULL clauses.\n\nExample (MySQL):\n\n SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;\n\nThe `ELSE NULL` part will never be executed and may be omitted." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlRedundantElseNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlCurrentSchemaInspection", + "shortDescription": { + "text": "Current console schema introspected" + }, + "fullDescription": { + "text": "Reports schemas and databases in the current session that are not introspected. For example, this warning might occur when you try to create a table in the schema that is not introspected. Introspection is a method of inspecting a data source. When you perform introspection, structural information in the data source is inspected to detect tables, columns, functions, and other elements with their attributes.", + "markdown": "Reports schemas and databases in the current session that are not introspected.\n\nFor example, this warning might occur when you try to create a table in the schema that is not introspected.\n\nIntrospection is a method of inspecting a data source. When you perform introspection, structural information in the data source is\ninspected to detect tables, columns, functions, and other elements with their attributes." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlCurrentSchemaInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlInsertNullIntoNotNullInspection", + "shortDescription": { + "text": "Insert NULL into NOT NULL column" + }, + "fullDescription": { + "text": "Reports cases when you insert NULL values into columns that accept only NOT NULL values. Example (Microsoft SQL Server): 'CREATE TABLE br2 (\nid INT NOT NULL,\ncol1 NVARCHAR (20) NOT NULL,\ncol2 NVARCHAR (20) NOT NULL,\n);\n--\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, NULL, NULL);' You cannot insert NULL values in 'col1' and 'col2' because they are defined as NOT NULL. If you run the script as is, you will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, '42' and ''bird''). INSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');", + "markdown": "Reports cases when you insert NULL values into columns that accept only NOT NULL values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE br2 (\n id INT NOT NULL,\n col1 NVARCHAR (20) NOT NULL,\n col2 NVARCHAR (20) NOT NULL,\n );\n --\n INSERT INTO br2 (id, col1, col2)\n VALUES (1, NULL, NULL);\n\nYou cannot insert NULL values in `col1` and `col2` because they are defined as NOT NULL. If you run the script as\nis,\nyou will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, `42` and\n`'bird'`).\n\n```\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');\n```" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlInsertNullIntoNotNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlTriggerTransitionInspection", + "shortDescription": { + "text": "Suspicious code in triggers" + }, + "fullDescription": { + "text": "Reports incorrect usages of transition table variables in triggers. Example (HSQLDB): 'CREATE TABLE foo(a INT);\n\nCREATE TRIGGER trg\n AFTER DELETE ON foo\nBEGIN\n SELECT * FROM NEW;\nEND;\n\nCREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)' In HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous example, NEW in 'SELECT * FROM NEW;' will be highlighted as well as OLD in 'REFERENCING OLD ROW AS newrow'.", + "markdown": "Reports incorrect usages of transition table variables in triggers.\n\nExample (HSQLDB):\n\n CREATE TABLE foo(a INT);\n\n CREATE TRIGGER trg\n AFTER DELETE ON foo\n BEGIN\n SELECT * FROM NEW;\n END;\n\n CREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)\n\nIn HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous\nexample, NEW in `SELECT * FROM NEW;` will be highlighted as well as OLD in `REFERENCING OLD ROW AS newrow`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlTriggerTransition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlNamedArgumentsInspection", + "shortDescription": { + "text": "Named arguments should be used" + }, + "fullDescription": { + "text": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled. For more information about the difference between named and unnamed parameters, see Binding Parameters by Name (Named Parameters) at docs.microsoft.com . Example (Microsoft SQL Server): 'CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\nBEGIN\n RETURN n + m;\nEND;\n\nCREATE PROCEDURE test AS\nBEGIN\n foo n = 1, m = 2;\n\n--- The following call misses parameter names and will be highlighted\n foo 1, 2;\nEND;' Parameters '1, 2' in the 'foo 1, 2;' call are highlighted because they miss names.", + "markdown": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled.\n\nFor more information about the difference between named and unnamed parameters, see [Binding Parameters by Name (Named Parameters) at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/binding-parameters-by-name-named-parameters).\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\n BEGIN\n RETURN n + m;\n END;\n\n CREATE PROCEDURE test AS\n BEGIN\n foo n = 1, m = 2;\n\n --- The following call misses parameter names and will be highlighted\n foo 1, 2;\n END;\n\nParameters `1, 2` in the `foo 1, 2;` call are highlighted because they miss names." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlNamedArguments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlTransactionStatementInTriggerInspection", + "shortDescription": { + "text": "Use of transaction management statements in triggers" + }, + "fullDescription": { + "text": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies. With COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile. The fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As COMMIT terminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception. Changes that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger. Example (Oracle): 'CREATE TABLE employee_audit\n(\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n);\n\nCREATE TABLE employees\n(\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n);\n\nCREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\nEND;\n\nCREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\nEND;'", + "markdown": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies.\n\nWith COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile.\nThe fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As\nCOMMIT\nterminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception.\nChanges that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger.\n\nExample (Oracle):\n\n CREATE TABLE employee_audit\n (\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n );\n\n CREATE TABLE employees\n (\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n );\n\n CREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\n END;\n\n CREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlTransactionStatementInTrigger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OraMissingBodyInspection", + "shortDescription": { + "text": "Missing body for package/object type specification" + }, + "fullDescription": { + "text": "Reports package and object type specifications that are missing body declarations. Package specifications and object types that declare routines as well as package specifications with cursors must have body declarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are invoked in program code. Example (Oracle): 'CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\nEND;'", + "markdown": "Reports package and object type specifications that are missing body declarations.\n\nPackage specifications and object types that declare routines as well as package specifications with cursors must have body\ndeclarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are\ninvoked in program code.\n\nExample (Oracle):\n\n CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlMissingBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Oracle", + "index": 123, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlCheckUsingColumnsInspection", + "shortDescription": { + "text": "Check using clause columns" + }, + "fullDescription": { + "text": "Reports columns in the USING clause that does not exist in both tables. Example (MySQL): 'CREATE TABLE t1 (i INT, j INT);\nCREATE TABLE t2 (k INT, l INT);\nSELECT * FROM t1 JOIN t2 USING (j);' In USING clauses, a column name must be present in both tables, and the SELECT query will automatically join those tables by using the given column name. As we do not have the 'j' column in 't2', we can rewrite the query using ON. The ON clause can join tables where the column names do not match in both tables. 'SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;'", + "markdown": "Reports columns in the USING clause that does not exist in both tables.\n\nExample (MySQL):\n\n CREATE TABLE t1 (i INT, j INT);\n CREATE TABLE t2 (k INT, l INT);\n SELECT * FROM t1 JOIN t2 USING (j);\n\nIn USING clauses, a column name must be present in both tables, and the SELECT query will automatically join\nthose tables by using the given column name. As we do not have the `j` column in `t2`, we can\nrewrite the query using ON. The ON clause can join tables where the column names do not match in both tables.\n\n SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlCheckUsingColumns", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlInsertIntoGeneratedColumnInspection", + "shortDescription": { + "text": "Insertion into generated columns" + }, + "fullDescription": { + "text": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written. Example (PostgreSQL): 'CREATE TABLE foo\n(\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n);\nINSERT INTO foo(col1, col2) VALUES (1, 2);'\n You cannot insert '2' into the 'col2' column because this column is generated. For this script to work, you can change '2' to DEFAULT. 'INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);'", + "markdown": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n );\n INSERT INTO foo(col1, col2) VALUES (1, 2);\n\nYou cannot insert `2` into the `col2` column because this column is generated.\nFor this script to work, you can change `2` to DEFAULT.\n`INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);`" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlInsertIntoGeneratedColumn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MsOrderByInspection", + "shortDescription": { + "text": "ORDER BY in queries" + }, + "fullDescription": { + "text": "Reports usages when the 'ORDER BY' clause is used without 'TOP', 'OFFSET', or 'FOR XML' in views, inline functions, derived tables, subqueries, and common table expressions. For more information about usages of 'ORDER BY', see SELECT - ORDER BY Clause (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL server): 'CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\nSELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89\nORDER BY b) ALIAS;' In a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery. Alternatively, use the Delete element quick-fix to delete the ORDER BY section. After the quick-fix is applied: 'SELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89) ALIAS;'", + "markdown": "Reports usages when the `ORDER BY` clause is used without `TOP`, `OFFSET`, or `FOR XML` in views, inline functions, derived tables, subqueries, and common table expressions.\n\nFor more information about usages of `ORDER BY`, see [SELECT - ORDER BY Clause (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql).\n\nExample (Microsoft SQL server):\n\n CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89\n ORDER BY b) ALIAS;\n\nIn a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery.\nAlternatively, use the **Delete element** quick-fix to delete the ORDER BY section.\n\nAfter the quick-fix is applied:\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89) ALIAS;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MsOrderBy", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL server", + "index": 102, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDeprecateTypeInspection", + "shortDescription": { + "text": "Deprecated type" + }, + "fullDescription": { + "text": "Reports usages of types that are deprecated and might disappear in future versions of DBMS. Reported types: LONG in Oracle (see Deprecated and Desupported Features at docs.oracle.com). TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com). Example (Oracle): 'CREATE TABLE ot.foo(\na NUMBER GENERATED BY DEFAULT AS IDENTITY,\nb LONG NOT NULL\n);'", + "markdown": "Reports usages of types that are deprecated and might disappear in future versions of DBMS.\n\nReported types:\n\n* LONG in Oracle (see [Deprecated\n and Desupported Features at docs.oracle.com](https://docs.oracle.com/cd/A91202_01/901_doc/server.901/a90120/ch4_dep.htm#6690)).\n* TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see [Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/database-engine/deprecated-database-engine-features-in-sql-server-2016?view=sql-server-ver15)).\n\nExample (Oracle):\n\n CREATE TABLE ot.foo(\n a NUMBER GENERATED BY DEFAULT AS IDENTITY,\n b LONG NOT NULL\n );\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDeprecateType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlGotoInspection", + "shortDescription": { + "text": "Usages of GOTO statements" + }, + "fullDescription": { + "text": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop. The extensive use of GOTO statements is generally not recommended. For details, see GOTO statement in SQL procedures at ibm.com. Instead of jumping back to a previous statement using GOTO, consider using a loop. Instead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK). Example (Oracle): 'CREATE PROCEDURE test(n INT) AS\nDECLARE\n x INT;\nBEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\nEND;'", + "markdown": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop.\n\nThe extensive use of GOTO statements is generally\nnot recommended. For details, see [GOTO statement in\nSQL\nprocedures at ibm.com](https://www.ibm.com/docs/no/db2/11.5?topic=procedures-goto-statement-in-sql).\n\nInstead of jumping back to a previous statement using GOTO, consider using a loop.\n\nInstead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK).\n\nExample (Oracle):\n\n CREATE PROCEDURE test(n INT) AS\n DECLARE\n x INT;\n BEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlGoto", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MysqlLoadDataPathInspection", + "shortDescription": { + "text": "LOAD statement path" + }, + "fullDescription": { + "text": "Reports paths that start with the tilde character in LOAD statements. Example (MySQL): 'CREATE TABLE table_name (id int);\nLOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\nINTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\nIGNORE 1 LINES;' Instead of the tilde character, use a full path to the file.", + "markdown": "Reports paths that start with the tilde character in LOAD statements.\n\nExample (MySQL):\n\n CREATE TABLE table_name (id int);\n LOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\n INTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\n IGNORE 1 LINES;\n\nInstead of the tilde character, use a full path to the file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MysqlLoadDataPath", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "MySQL", + "index": 142, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDtInspection", + "shortDescription": { + "text": "Ill-formed date/time literals" + }, + "fullDescription": { + "text": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2. Example (MySQL): 'SELECT TIME '10 -12:13:14' FROM dual;\nSELECT TIME ' 12 : 13 : 14 ' FROM dual;\nSELECT TIME '12 13 14' FROM dual;\nSELECT TIME '12-13-14' FROM dual;\nSELECT TIME '12.13.14' FROM dual;\nSELECT TIME '12:13:' FROM dual;\nSELECT TIME '12:13' FROM dual;\nSELECT TIME '12:' FROM dual;' In this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted. For more information about date and time literals in MySQL, see Date and Time Literals at dev.mysql.com. The following date and type literals are valid for MySQL. 'SELECT TIME '12:13:14' FROM dual;\nSELECT TIME '12:13:14.555' FROM dual;\nSELECT TIME '12:13:14.' FROM dual;\nSELECT TIME '-12:13:14' FROM dual;\nSELECT TIME '10 12:13:14' FROM dual;\nSELECT TIME '-10 12:13:14' FROM dual;'", + "markdown": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2.\n\nExample (MySQL):\n\n SELECT TIME '10 -12:13:14' FROM dual;\n SELECT TIME ' 12 : 13 : 14 ' FROM dual;\n SELECT TIME '12 13 14' FROM dual;\n SELECT TIME '12-13-14' FROM dual;\n SELECT TIME '12.13.14' FROM dual;\n SELECT TIME '12:13:' FROM dual;\n SELECT TIME '12:13' FROM dual;\n SELECT TIME '12:' FROM dual;\n\nIn this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted.\nFor more information about date and time literals in MySQL, see [Date and Time Literals at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html).\n\nThe following date and type literals are valid for MySQL.\n\n SELECT TIME '12:13:14' FROM dual;\n SELECT TIME '12:13:14.555' FROM dual;\n SELECT TIME '12:13:14.' FROM dual;\n SELECT TIME '-12:13:14' FROM dual;\n SELECT TIME '10 12:13:14' FROM dual;\n SELECT TIME '-10 12:13:14' FROM dual;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDateTime", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlNoDataSourceInspection", + "shortDescription": { + "text": "No data sources configured" + }, + "fullDescription": { + "text": "Reports the absence of data sources in the Database tool window (View | Tool Windows | Database).", + "markdown": "Reports the absence of data sources in the **Database** tool window (**View \\| Tool Windows \\| Database**)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlNoDataSourceInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlConstantExpressionInspection", + "shortDescription": { + "text": "Constant expression" + }, + "fullDescription": { + "text": "Reports conditions and expressions that are always true, false or null. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nSELECT a FROM t1 WHERE 'Cat' = 'Cat';\nSELECT a FROM t1 WHERE 'Cat' = null;' The ''Cat' = 'Cat'' is always true and will be reported. The ''Cat' = null' is always null and will be reported.", + "markdown": "Reports conditions and expressions that are always true, false or null.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n SELECT a FROM t1 WHERE 'Cat' = 'Cat';\n SELECT a FROM t1 WHERE 'Cat' = null;\n\nThe `'Cat' = 'Cat'` is always true and will be reported.\n\nThe `'Cat' = null` is always null and will be reported." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlConstantExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OraUnmatchedForwardDeclarationInspection", + "shortDescription": { + "text": "Forward declaration without definition" + }, + "fullDescription": { + "text": "Reports declarations of procedures and functions that are missing their implementation in code. In Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names of such procedures or functions that are left without implementation. Example (Oracle): 'DECLARE PROCEDURE foo(a int, b varchar2);\nBEGIN\n NULL;\nEND;' The 'foo' procedure is declared but is missing implementation. We can add the implementation to get rid of the error. 'DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\nBEGIN\n NULL;\nEND;\nBEGIN\n NULL;\nEND;'", + "markdown": "Reports declarations of procedures and functions that are missing their implementation in code.\n\nIn Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names\nof such procedures or functions that are left without implementation.\n\nExample (Oracle):\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n BEGIN\n NULL;\n END;\n\nThe `foo` procedure is declared but is missing implementation. We can add the implementation to get rid of the error.\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\n BEGIN\n NULL;\n END;\n BEGIN\n NULL;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SqlUnmatchedForwardDeclaration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Oracle", + "index": 123, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlWithoutWhereInspection", + "shortDescription": { + "text": "Delete or update statement without where clauses" + }, + "fullDescription": { + "text": "Reports usages of DELETE or UPDATE statements without WHERE clauses. Without WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nupdate t1 set a = 'Smith';\ndelete from t1;'", + "markdown": "Reports usages of DELETE or UPDATE statements without WHERE clauses.\n\nWithout WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n update t1 set a = 'Smith';\n delete from t1;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlWithoutWhere", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSSideEffectsInspection", + "shortDescription": { + "text": "Statement with side effects" + }, + "fullDescription": { + "text": "Reports statements that can cause side effects while the data source is in read-only mode. For more information about enabling read-only mode, see Enable read-only mode for a connection in the IDE documentation. The Disable read-only mode quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", + "markdown": "Reports statements that can cause side effects while the data source is in read-only mode.\n\nFor more information about enabling read-only mode, see\n[Enable\nread-only mode for a connection in the IDE documentation](https://www.jetbrains.com/help/datagrip/configuring-database-connections.html#enable-read-only-mode-for-a-connection).\n\nThe **Disable read-only mode** quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSSideEffects", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSExtSideEffectsInspection", + "shortDescription": { + "text": "Statement with side effects" + }, + "fullDescription": { + "text": "Reports statements that may cause side effects while the data source is in read-only mode. The quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", + "markdown": "Reports statements that may cause side effects while the data source is in read-only mode.\n\nThe quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSSideEffects", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlUnusedSubqueryItemInspection", + "shortDescription": { + "text": "Unused subquery item" + }, + "fullDescription": { + "text": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression. Example (PostgreSQL): 'CREATE TABLE for_subquery(id INT);\nSELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;' We reference 'a' and 'q' aliases from a subquery. But the 'b' alias and the 'id' column are not referenced in the outer SELECT statement. Therefore, 'b' and 'id' are grayed out.", + "markdown": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression.\n\nExample (PostgreSQL):\n\n CREATE TABLE for_subquery(id INT);\n SELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;\n\nWe reference `a` and `q` aliases from a subquery. But the `b` alias and the `id` column are\nnot referenced in the outer SELECT statement. Therefore, `b` and `id` are grayed out." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlUnused", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlSideEffectsInspection", + "shortDescription": { + "text": "Statement with side effects" + }, + "fullDescription": { + "text": "Reports statements that might lead to modification of a database during a read-only connection. To enable read-only mode for a connection, right-click a data source in the Database tool window (View | Tool Windows | Database) and select Properties. In the Data Sources and Drivers dialog, click the Options tab and select the Read-only checkbox. Example (MySQL): 'CREATE TABLE foo(a INT);\nINSERT INTO foo VALUES (1);' As 'CREATE TABLE' and 'INSERT INTO' statements lead to a database modification, these statements will be highlighted in read-only connection mode.", + "markdown": "Reports statements that might lead to modification of a database during a read-only connection.\n\nTo enable read-only mode for a\nconnection,\nright-click a data source in the **Database** tool window (**View \\| Tool Windows \\| Database** ) and select **Properties** .\nIn the **Data Sources and Drivers** dialog, click the **Options** tab and select the **Read-only** checkbox.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT);\n INSERT INTO foo VALUES (1);\n\nAs `CREATE TABLE` and `INSERT INTO` statements lead to a database modification, these statements will be highlighted\nin read-only connection mode." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlSideEffects", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlJoinWithoutOnInspection", + "shortDescription": { + "text": "Unsafe 'join' clause in 'delete' statement" + }, + "fullDescription": { + "text": "Reports missing conditional checks for statements that might modify the whole database. For example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops contents of the entire table. Example (MySQL): 'CREATE TABLE foo (a INT,b INT,c INT);\nCREATE TABLE bar (a INT,b INT,c INT);\n\nDELETE table1 FROM foo table1 INNER JOIN bar table2;'", + "markdown": "Reports missing conditional checks for statements that might modify the whole database.\n\nFor example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops\ncontents of the entire table.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT,b INT,c INT);\n CREATE TABLE bar (a INT,b INT,c INT);\n\n DELETE table1 FROM foo table1 INNER JOIN bar table2;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlJoinWithoutOn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDropIndexedColumnInspection", + "shortDescription": { + "text": "Index is dependent on column" + }, + "fullDescription": { + "text": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE. Example (Microsoft SQL Server): 'CREATE TABLE test_index\n(\ncol INT NOT NULL,\ncol2 INT NOT NULL,\ncol3 INT NOT NULL UNIQUE,\ncol4 VARCHAR(200)\n);\n\nCREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\nALTER TABLE test_index\nDROP COLUMN col;' You cannot delete the 'col' column because it is in the indexed table. To delete the column, you need to delete the 'aaaa' index first (for example, DROP INDEX aaaa).", + "markdown": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE test_index\n (\n col INT NOT NULL,\n col2 INT NOT NULL,\n col3 INT NOT NULL UNIQUE,\n col4 VARCHAR(200)\n );\n\n CREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\n ALTER TABLE test_index\n DROP COLUMN col;\n\nYou cannot delete the `col` column because it is in the indexed table. To delete the column, you need to delete the\n`aaaa` index first (for example, DROP INDEX aaaa)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDropIndexedColumn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlTypeInspection", + "shortDescription": { + "text": "Types compatibility" + }, + "fullDescription": { + "text": "Reports type-related errors.", + "markdown": "Reports type-related errors." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlUnicodeStringLiteralInspection", + "shortDescription": { + "text": "Unicode usage in SQL" + }, + "fullDescription": { + "text": "Reports string literals that use national characters without the 'N' prefix. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters. For more information, see nchar and nvarchar (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL Server): 'SELECT 'abcde' AS a;\nSELECT N'abcde' AS b;\nSELECT 'абвгд' AS c;\nSELECT N'абвгд' AS d;' The 'SELECT 'абвгд' AS c;' does not have the 'N' prefix, the ''абвгд'' part will be highlighted.", + "markdown": "Reports string literals that use national characters without the `N` prefix.\n\nWithout the N prefix, the string is converted to the default\ncode page of the database. This default code page may not recognize certain characters. For more information, see\n[nchar and nvarchar\n(Transact-SQL)\nat docs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql).\n\nExample (Microsoft SQL Server):\n\n SELECT 'abcde' AS a;\n SELECT N'abcde' AS b;\n SELECT 'абвгд' AS c;\n SELECT N'абвгд' AS d;\n\nThe `SELECT 'абвгд' AS c;` does not have the `N` prefix, the `'абвгд'` part will be highlighted." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlUnicodeStringLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlUnusedVariableInspection", + "shortDescription": { + "text": "Unused variable" + }, + "fullDescription": { + "text": "Reports unused arguments, variables, or parameters. Example (PostgreSQL): 'CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n$$\nBEGIN\n RETURN PARAMUSED;\nEND\n$$ LANGUAGE plpgsql;' The 'PARAMUNUSED' parameter is not used in the function and might be deleted.", + "markdown": "Reports unused arguments, variables, or parameters.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n $$\n BEGIN\n RETURN PARAMUSED;\n END\n $$ LANGUAGE plpgsql;\n\nThe `PARAMUNUSED` parameter is not used in the function and might be deleted." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlUnused", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PgSelectFromProcedureInspection", + "shortDescription": { + "text": "Postgres: Select from procedure call" + }, + "fullDescription": { + "text": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, 'AS t1(s VARCHAR)'). This requirement does not apply to scalar functions. Example (PostgreSQL): 'CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\nSELECT 1;\n$$ LANGUAGE sql;\nSELECT * FROM produce_a_table() AS s (c1 INT);\nSELECT * FROM produce_a_table() AS s (c1);\nSELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;' The 'AS s (c1 INT)' has a typed alias, while 'AS s (c1)' and 'AS t1' do not. In this case, the second call of 'produce_a_table()' and 'DBLINK()' will be highlighted.", + "markdown": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, `AS t1(s VARCHAR)`).\n\nThis requirement does not apply to scalar functions.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\n SELECT 1;\n $$ LANGUAGE sql;\n SELECT * FROM produce_a_table() AS s (c1 INT);\n SELECT * FROM produce_a_table() AS s (c1);\n SELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;\n\nThe `AS s (c1 INT)` has a typed alias, while `AS s (c1)` and `AS t1` do not.\nIn this case, the second call of `produce_a_table()` and `DBLINK()` will be highlighted." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PgSelectFromProcedure", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "PostgreSQL", + "index": 152, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlStorageInspection", + "shortDescription": { + "text": "SQL source modification detection" + }, + "fullDescription": { + "text": "Reports situations when source code of a database object has been changed. The inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an object, run statements, and perform code refactoring. Also, you can run introspection by right-clicking an object and selecting Refresh. The inspection covers the following situations: Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE. You changed the object source code, introspected the database, but source code has been already changed by someone else. The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version.", + "markdown": "Reports situations when source code of a database object has been changed.\n\nThe inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an\nobject, run statements, and perform code refactoring.\nAlso, you can run introspection by right-clicking an object and selecting **Refresh**.\n\nThe inspection covers the following situations:\n\n* Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE.\n* You changed the object source code, introspected the database, but source code has been already changed by someone else.\n* The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlStorageInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlSignatureInspection", + "shortDescription": { + "text": "Function signature" + }, + "fullDescription": { + "text": "Reports signature issues for built-in functions. The inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT)\n\nSELECT IFNULL() FROM foo; -- error\nSELECT IFNULL(a) FROM foo; -- error\nSELECT IFNULL(a, b) FROM foo; -- OK\nSELECT IFNULL(a, b, c) FROM foo; -- error' In MySQL, the 'IFNULL()' function accepts strictly two arguments. So, only the 'SELECT IFNULL(a, b) FROM foo;' query is correct.", + "markdown": "Reports signature issues for built-in functions.\n\nThe inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT)\n\n SELECT IFNULL() FROM foo; -- error\n SELECT IFNULL(a) FROM foo; -- error\n SELECT IFNULL(a, b) FROM foo; -- OK\n SELECT IFNULL(a, b, c) FROM foo; -- error\n\nIn MySQL, the `IFNULL()` function accepts strictly two arguments. So, only the `SELECT IFNULL(a, b) FROM foo;`\nquery is correct." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlRedundantOrderingDirectionInspection", + "shortDescription": { + "text": "Redundant ordering direction" + }, + "fullDescription": { + "text": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\nSELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;' The ORDER BY keyword sorts the records in the ascending order by default. So, the 'ASC' keyword for 'a' and 'c' columns is redundant.", + "markdown": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n SELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;\n\nThe ORDER BY keyword sorts the records in the ascending order by default. So, the `ASC` keyword for `a` and\n`c` columns is redundant." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlRedundantOrderingDirection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OraOverloadInspection", + "shortDescription": { + "text": "Overloading errors" + }, + "fullDescription": { + "text": "Reports invalid cases of subprogram overloading in Oracle. Example (Oracle): 'DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\nBEGIN\n NULL;\nEND;' You cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a BINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading, see Restrictions on Overloading at docs.oracle.com.", + "markdown": "Reports invalid cases of subprogram overloading in Oracle.\n\nExample (Oracle):\n\n DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\n BEGIN\n NULL;\n END;\n\nYou cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a\nBINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading,\nsee [Restrictions on Overloading at docs.oracle.com](https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/subprograms.htm)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlOverload", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Oracle", + "index": 123, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MysqlSpaceAfterFunctionNameInspection", + "shortDescription": { + "text": "Whitespace between the function name and the open parenthesis" + }, + "fullDescription": { + "text": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default. Example (MySQL): 'SELECT MAX (qty) FROM orders;'", + "markdown": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default.\n\nExample (MySQL):\n\n SELECT MAX (qty) FROM orders;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MysqlSpaceAfterFunctionName", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "MySQL", + "index": 142, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlAutoIncrementDuplicateInspection", + "shortDescription": { + "text": "Auto-increment duplicate" + }, + "fullDescription": { + "text": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key. Example (MySQL): 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n);' The AUTO_INCREMENT constraint for 'c2' will be highlighted as 'c1' already has this constraint. To fix the warning, you can make 'id' a primary key and delete AUTO_INCREMENT for 'c2'. 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n);'", + "markdown": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key.\n\nExample (MySQL):\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n );\n\nThe AUTO_INCREMENT constraint for `c2` will be highlighted as `c1` already has this constraint. To fix the warning,\nyou can make `id` a primary key and delete AUTO_INCREMENT for `c2`.\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n );\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlAutoIncrementDuplicate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlStringLengthExceededInspection", + "shortDescription": { + "text": "Implicit string truncation" + }, + "fullDescription": { + "text": "Reports variables that exceed the defined length in characters. Example (Microsoft SQL Server): 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;' The 'myVarExceeded' variable is defined as 'VARCHAR(5)' but both assigned values (''abcde12345'' and ''123456789'') exceed this limitation. You can truncate assigned values or increase the defined length. To increase the length, use the Increase type length quick-fix. After the quick-fix is applied: 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;'", + "markdown": "Reports variables that exceed the defined length in characters.\n\nExample (Microsoft SQL Server):\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n\nThe `myVarExceeded` variable is defined as `VARCHAR(5)` but both assigned values (`'abcde12345'` and\n`'123456789'`) exceed this limitation. You can truncate assigned values or increase the defined length.\nTo increase the length, use the **Increase type length** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlStringLengthExceeded", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MysqlParsingInspection", + "shortDescription": { + "text": "Unsupported syntax in pre-8.0 versions" + }, + "fullDescription": { + "text": "Reports invalid usages of UNION in queries. The inspection works in MySQL versions that are earlier than 8.0. Example (MySQL): 'SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;'", + "markdown": "Reports invalid usages of UNION in queries.\n\nThe inspection works in MySQL versions that are earlier than 8.0.\n\nExample (MySQL):\n\n\n SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MysqlParsing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "MySQL", + "index": 142, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlCallNotationInspection", + "shortDescription": { + "text": "Using of named and positional arguments" + }, + "fullDescription": { + "text": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2. Example (In PostgreSQL): 'CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n$$\nBEGIN\n RETURN a + b + c;\nEND\n$$;\nSELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\nSELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\nSELECT foo(b => 2, 1, 3);'", + "markdown": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2.\n\nExample (In PostgreSQL):\n\n CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n $$\n BEGIN\n RETURN a + b + c;\n END\n $$;\n SELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\n SELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\n SELECT foo(b => 2, 1, 3);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SqlCallNotation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlShadowingAliasInspection", + "shortDescription": { + "text": "Column is shadowed by alias" + }, + "fullDescription": { + "text": "Reports SELECT aliases with names that match column names in the FROM clause. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT);\nSELECT a b, c FROM foo;' The 'a' column uses the 'b' alias but the 'b' name is also used by the column from the 'foo' table.", + "markdown": "Reports SELECT aliases with names that match column names in the FROM clause.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT);\n SELECT a b, c FROM foo;\n\nThe `a` column uses the `b` alias but the `b` name is also used by the column from the `foo`\ntable." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlShadowingAlias", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlUnreachableCodeInspection", + "shortDescription": { + "text": "Unreachable code" + }, + "fullDescription": { + "text": "Reports unreachable statements inside SQL routines. Example (Microsoft SQL Server): 'CREATE FUNCTION foo() RETURNS INT AS\nBEGIN\n THROW;\n RETURN 1;\nEND;' In Microsoft SQL Server, the 'THROW' statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH construct. Therefore, the 'RETURN 1;' part will never be executed.", + "markdown": "Reports unreachable statements inside SQL routines.\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo() RETURNS INT AS\n BEGIN\n THROW;\n RETURN 1;\n END;\n\nIn Microsoft SQL Server, the `THROW` statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH\nconstruct. Therefore, the `RETURN 1;` part will never be executed." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlUnreachable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlResolveInspection", + "shortDescription": { + "text": "Unresolved reference" + }, + "fullDescription": { + "text": "Reports unresolved SQL references. Example (MySQL): 'CREATE TABLE users(id INT, name VARCHAR(40));\nCREATE TABLE admins(id INT, col1 INT);\n\nSELECT users.id, admins.id FROM admins WHERE admins.id > 1;' The 'users.id' column is unresolved because the 'users' table is missing in the FROM clause.", + "markdown": "Reports unresolved SQL references.\n\nExample (MySQL):\n\n CREATE TABLE users(id INT, name VARCHAR(40));\n CREATE TABLE admins(id INT, col1 INT);\n\n SELECT users.id, admins.id FROM admins WHERE admins.id > 1;\n\nThe `users.id` column is unresolved because the `users` table is missing in the FROM clause." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SqlResolve", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlRedundantLimitInspection", + "shortDescription": { + "text": "Redundant row limiting in queries" + }, + "fullDescription": { + "text": "Reports redundant row limiting clauses like FETCH and LIMIT in queries. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);' To fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because the usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first 'N' rows and this will influence the output. 'SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);'", + "markdown": "Reports redundant row limiting clauses like FETCH and LIMIT in queries.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);\n\nTo fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because\nthe usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first `N` rows and this will\ninfluence the output.\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlRedundantLimit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDerivedTableAliasInspection", + "shortDescription": { + "text": "Each derived table should have alias" + }, + "fullDescription": { + "text": "Reports derived tables without aliases. Example (MySQL): 'CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\nCREATE TABLE table2 (id INT, age INTEGER);\n\nSELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);' According to Derived Tables at dev.mysql.com, an alias is mandatory. You can add the alias by using the Introduce alias quick-fix. After the quick-fix is applied: 'SELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);'", + "markdown": "Reports derived tables without aliases.\n\nExample (MySQL):\n\n CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\n CREATE TABLE table2 (id INT, age INTEGER);\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n\nAccording to [Derived Tables at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/derived-tables.html), an alias is\nmandatory. You can add the alias by using the **Introduce alias** quick-fix.\n\nAfter the quick-fix is applied:\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDerivedTableAlias", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlCaseVsCoalesceInspection", + "shortDescription": { + "text": "Using CASE instead of COALESCE function and vice versa" + }, + "fullDescription": { + "text": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: Replace with 'COALESCE' call and the opposite one Replace with CASE expression. Example (MySQL): 'SELECT\n -- this CASE may be replaced by COALESCE\n\tCASE\n\t\tWHEN C1 IS NOT NULL THEN C1\n\t\tELSE 0\n\t\tEND\nFROM dual;' In the example, the CASE statement can be replaced with 'SELECT COALESCE(C1, 0)' that produces the same output. If you prefer using CASE expressions, select the Prefer CASE expressions over COALESCE function option on the inspection page.", + "markdown": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: **Replace\nwith 'COALESCE' call** and the opposite one **Replace with CASE expression** .\n\nExample (MySQL):\n\n SELECT\n -- this CASE may be replaced by COALESCE\n \tCASE\n \t\tWHEN C1 IS NOT NULL THEN C1\n \t\tELSE 0\n \t\tEND\n FROM dual;\n\nIn the example, the CASE statement can be replaced with `SELECT COALESCE(C1, 0)` that produces the same output.\n\nIf you prefer using CASE expressions, select the **Prefer CASE expressions over COALESCE function** option on\nthe inspection page." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlCaseVsCoalesce", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlRedundantCodeInCoalesceInspection", + "shortDescription": { + "text": "Redundant code in COALESCE call" + }, + "fullDescription": { + "text": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions. Example (MySQL): 'SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;' The first NOT NULL argument is '42', all other arguments will be grayed out.", + "markdown": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions.\n\nExample (MySQL):\n\n SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;\n\nThe first NOT NULL argument is `42`, all other arguments will be grayed out." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlRedundantCodeInCoalesce", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlAggregatesInspection", + "shortDescription": { + "text": "Aggregate-related problems" + }, + "fullDescription": { + "text": "Reports invalid usages of SQL aggregate functions. The following situations are considered: Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses. 'CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\nSELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\nSELECT * FROM foo GROUP BY a ORDER BY b;' This rule does not apply when grouping is made by the primary key. 'SELECT * FROM foo GROUP BY id ORDER BY b;' Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error. 'SELECT a FROM foo WHERE MAX(b) > 0;\nSELECT a FROM foo GROUP BY MAX(a);' Nested calls of aggregate functions. 'SELECT MAX(SUM(a)) FROM foo GROUP BY a;' This rule does not apply to analytic functions. The following query is valid and correct. 'SELECT MAX(SUM(a) OVER ()) FROM foo;' Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section. 'SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;'", + "markdown": "Reports invalid usages of SQL aggregate functions.\n\nThe following situations are considered:\n\n* Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses.\n\n CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\n SELECT * FROM foo GROUP BY a ORDER BY b;\n\n This rule does not apply when grouping is made by the primary key.\n\n SELECT * FROM foo GROUP BY id ORDER BY b;\n\n* Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in\n SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error.\n\n SELECT a FROM foo WHERE MAX(b) > 0;\n SELECT a FROM foo GROUP BY MAX(a);\n\n* Nested calls of aggregate functions.\n\n SELECT MAX(SUM(a)) FROM foo GROUP BY a;\n\n This rule does not apply to analytic functions. The following query is valid and correct.\n\n SELECT MAX(SUM(a) OVER ()) FROM foo;\n\n* Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section.\n\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlAggregates", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlMissingColumnAliasesInspection", + "shortDescription": { + "text": "Missing column aliases" + }, + "fullDescription": { + "text": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement). Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT 1, a + 1 AS A2, MAX(b) AS M\nFROM foo;'", + "markdown": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement).\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT 1, a + 1 AS A2, MAX(b) AS M\n FROM foo;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlMissingColumnAliases", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlAddNotNullColumnInspection", + "shortDescription": { + "text": "Adding not null column without default value" + }, + "fullDescription": { + "text": "Reports attempts to create NOT NULL columns without DEFAULT values. Example (Microsoft SQL Server): 'CREATE TABLE foo (a INT, b INT)\n\nALTER TABLE foo ADD c INT NOT NULL;' By default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values. If we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record. 'ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;' You can quickly add the DEFAULT value by using the Add DEFAULT value quick-fix.", + "markdown": "Reports attempts to create NOT NULL columns without DEFAULT values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE foo (a INT, b INT)\n\n ALTER TABLE foo ADD c INT NOT NULL;\n\nBy default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values.\nIf we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record.\n\n ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;\n\nYou can quickly add the DEFAULT value by using the **Add DEFAULT value** quick-fix." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlAddNotNullColumn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MongoJSExtResolveInspection", + "shortDescription": { + "text": "Resolution problems" + }, + "fullDescription": { + "text": "Reports unresolved references in MongoDB and JavaScript code.", + "markdown": "Reports unresolved references in MongoDB and JavaScript code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MongoJSResolve", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "MongoJS", + "index": 89, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlJoinCountInspection", + "shortDescription": { + "text": "Excessive JOIN count" + }, + "fullDescription": { + "text": "Reports queries with excessive number of JOINS. Using too many joins is generally not recommended for performance reasons. 'SELECT * FROM a inner join b using(id) inner join c using (id) inner join d using (id) inner join e using (id)'", + "markdown": "Reports queries with excessive number of JOINS.\n\nUsing too many joins is generally\nnot recommended for performance reasons.\n\n SELECT * FROM a inner join b using(id) inner join c using (id) inner join d using (id) inner join e using (id)\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlJoinCount", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlIllegalCursorStateInspection", + "shortDescription": { + "text": "Illegal cursor state" + }, + "fullDescription": { + "text": "Reports illegal cursor states inside SQL routines. A routine has CLOSE or FETCH statements but a cursor might be closed. A routine has the OPEN statement but a cursor might be opened. Example (Microsoft SQL Server): 'CREATE TABLE t(col INT);\n\nCREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;' According to CLOSE (Transact-SQL) at docs.microsoft.com, CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are already closed. So, we need to open the cursor to fix the warning. 'CREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nOPEN my_cursor;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;'", + "markdown": "Reports illegal cursor states inside SQL routines.\n\n* A routine has CLOSE or FETCH statements but a cursor might be closed.\n* A routine has the OPEN statement but a cursor might be opened.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t(col INT);\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n\nAccording to [CLOSE (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/close-transact-sql), CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are\nalready closed. So, we need to open the cursor to fix the warning.\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n OPEN my_cursor;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlIllegalCursorState", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlDuplicateColumnInspection", + "shortDescription": { + "text": "Duplicating column name in SELECT" + }, + "fullDescription": { + "text": "Reports duplicated names of column aliases in SELECT lists. Example (Sybase ASE): 'CREATE TABLE t1 (a TEXT, b INT, c INT);\n\nSELECT a AS x, b AS x FROM t1;' The 'x' alias name is used for 'a' and 'b' columns. These assignments are highlighted as errors because you cannot use identical alias names for columns in Sybase ASE.", + "markdown": "Reports duplicated names of column aliases in SELECT lists.\n\nExample (Sybase ASE):\n\n CREATE TABLE t1 (a TEXT, b INT, c INT);\n\n SELECT a AS x, b AS x FROM t1;\n\nThe `x` alias name is used for `a` and `b` columns. These assignments are highlighted as errors because\nyou cannot use identical alias names for columns in Sybase ASE." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlDuplicateColumn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SqlIdentifierInspection", + "shortDescription": { + "text": "Identifier should be quoted" + }, + "fullDescription": { + "text": "Reports situations when you use SQL reserved keywords as identifier names in your query. Example (Microsoft SQL Server): 'CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);' We use 'select', 'identity', and 'order' as table and column names. But they are also reserved keywords in Microsoft SQL Server. Therefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the Quote identifier quick-fix. After the quick-fix is applied: 'CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);'", + "markdown": "Reports situations when you use SQL reserved keywords as identifier names in your query.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);\n\nWe use `select`, `identity`, and `order` as table and column names.\nBut they are also reserved keywords in Microsoft SQL Server.\nTherefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the\n**Quote identifier** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SqlIdentifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "SQL", + "index": 25, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.css", + "version": "243.24609", + "rules": [ + { + "id": "CssInvalidFunction", + "shortDescription": { + "text": "Invalid function" + }, + "fullDescription": { + "text": "Reports an unknown CSS function or an incorrect function parameter.", + "markdown": "Reports an unknown [CSS function](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions) or an incorrect function parameter." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidFunction", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssConvertColorToRgbInspection", + "shortDescription": { + "text": "Color could be replaced with rgb()" + }, + "fullDescription": { + "text": "Reports an 'hsl()' or 'hwb()' color function or a hexadecimal color notation. Suggests replacing such color value with an equivalent 'rgb()' or 'rgba()' color function. Example: '#0c0fff' After the quick-fix is applied: 'rgb(12, 15, 255)'.", + "markdown": "Reports an `hsl()` or `hwb()` color function or a hexadecimal color notation.\n\nSuggests replacing such color value with an equivalent `rgb()` or `rgba()` color function.\n\n**Example:**\n\n #0c0fff\n\nAfter the quick-fix is applied:\n\n rgb(12, 15, 255).\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssConvertColorToRgbInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssOverwrittenProperties", + "shortDescription": { + "text": "Overwritten property" + }, + "fullDescription": { + "text": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties. Example: '.foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n}'", + "markdown": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties.\n\n**Example:**\n\n\n .foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssOverwrittenProperties", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidNestedSelector", + "shortDescription": { + "text": "Invalid nested selector" + }, + "fullDescription": { + "text": "Reports a nested selector starting with an identifier or a functional notation.", + "markdown": "Reports a nested selector starting with an identifier or a functional notation." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssInvalidNestedSelector", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidHtmlTagReference", + "shortDescription": { + "text": "Invalid type selector" + }, + "fullDescription": { + "text": "Reports a CSS type selector that matches an unknown HTML element.", + "markdown": "Reports a CSS [type selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors) that matches an unknown HTML element." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssInvalidHtmlTagReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssMissingSemicolon", + "shortDescription": { + "text": "Missing semicolon" + }, + "fullDescription": { + "text": "Reports a missing semicolon at the end of a declaration.", + "markdown": "Reports a missing semicolon at the end of a declaration." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssMissingSemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Code style issues", + "index": 114, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidCustomPropertyAtRuleName", + "shortDescription": { + "text": "Invalid @property name" + }, + "fullDescription": { + "text": "Reports an invalid custom property name. Custom property name should be prefixed with two dashes. Example: '@property invalid-property-name {\n ...\n}\n\n@property --valid-property-name {\n ...\n}'", + "markdown": "Reports an invalid custom property name. Custom property name should be prefixed with two dashes.\n\n**Example:**\n\n\n @property invalid-property-name {\n ...\n }\n\n @property --valid-property-name {\n ...\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidCustomPropertyAtRuleName", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnknownTarget", + "shortDescription": { + "text": "Unresolved file reference" + }, + "fullDescription": { + "text": "Reports an unresolved file reference, for example, an incorrect path in an '@import' statement.", + "markdown": "Reports an unresolved file reference, for example, an incorrect path in an `@import` statement." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssUnknownTarget", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidCharsetRule", + "shortDescription": { + "text": "Misplaced or incorrect @charset" + }, + "fullDescription": { + "text": "Reports a misplaced '@charset' at-rule or an incorrect charset value.", + "markdown": "Reports a misplaced `@charset` at-rule or an incorrect charset value." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssInvalidCharsetRule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidPseudoSelector", + "shortDescription": { + "text": "Invalid pseudo-selector" + }, + "fullDescription": { + "text": "Reports an incorrect CSS pseudo-class pseudo-element.", + "markdown": "Reports an incorrect CSS [pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidPseudoSelector", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidCustomPropertyAtRuleDeclaration", + "shortDescription": { + "text": "Invalid @property declaration" + }, + "fullDescription": { + "text": "Reports a missing required syntax, inherits, or initial-value property in a declaration of a custom property.", + "markdown": "Reports a missing required [syntax](https://developer.mozilla.org/en-US/docs/web/css/@property/syntax), [inherits](https://developer.mozilla.org/en-US/docs/web/css/@property/inherits), or [initial-value](https://developer.mozilla.org/en-US/docs/web/css/@property/initial-value) property in a declaration of a custom property." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidCustomPropertyAtRuleDeclaration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssBrowserCompatibilityForProperties", + "shortDescription": { + "text": "Property is incompatible with selected browsers" + }, + "fullDescription": { + "text": "Reports a CSS property that is not supported by the specified browsers. Based on the MDN Compatibility Data.", + "markdown": "Reports a CSS property that is not supported by the specified browsers. Based on the [MDN Compatibility Data](https://github.com/mdn/browser-compat-data)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssBrowserCompatibilityForProperties", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidMediaFeature", + "shortDescription": { + "text": "Invalid media feature" + }, + "fullDescription": { + "text": "Reports an unknown CSS media feature or an incorrect media feature value.", + "markdown": "Reports an unknown [CSS media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) or an incorrect media feature value." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidMediaFeature", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnresolvedCustomProperty", + "shortDescription": { + "text": "Unresolved custom property" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a custom property among the arguments of the 'var()' function.", + "markdown": "Reports an unresolved reference to a [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) among the arguments of the `var()` function." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssUnresolvedCustomProperty", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnknownProperty", + "shortDescription": { + "text": "Unknown property" + }, + "fullDescription": { + "text": "Reports an unknown CSS property or a property used in a wrong context. Add the unknown property to the 'Custom CSS properties' list to skip validation.", + "markdown": "Reports an unknown CSS property or a property used in a wrong context.\n\nAdd the unknown property to the 'Custom CSS properties' list to skip validation." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssUnknownProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssMissingComma", + "shortDescription": { + "text": "Missing comma in selector list" + }, + "fullDescription": { + "text": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines. Example: 'input /* comma has probably been forgotten */\n.button {\n margin: 1px;\n}'", + "markdown": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines.\n\n**Example:**\n\n\n input /* comma has probably been forgotten */\n .button {\n margin: 1px;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssMissingComma", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Probable bugs", + "index": 146, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnusedSymbol", + "shortDescription": { + "text": "Unused selector" + }, + "fullDescription": { + "text": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML. Note that complete inspection results are available only when running it via Code | Inspect Code or Code | Analyze Code | Run Inspection by Name. Due to performance reasons, style sheet files are not inspected on the fly.", + "markdown": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML.\n\n\nNote that complete inspection results are available only when running it via **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name**.\nDue to performance reasons, style sheet files are not inspected on the fly." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssUnusedSymbol", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssDeprecatedValue", + "shortDescription": { + "text": "Deprecated value" + }, + "fullDescription": { + "text": "Reports a deprecated CSS value. Suggests replacing the deprecated value with its valid equivalent.", + "markdown": "Reports a deprecated CSS value. Suggests replacing the deprecated value with its valid equivalent." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssDeprecatedValue", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssNonIntegerLengthInPixels", + "shortDescription": { + "text": "Non-integer length in pixels" + }, + "fullDescription": { + "text": "Reports a non-integer length in pixels. Example: 'width: 3.14px'", + "markdown": "Reports a non-integer length in pixels.\n\n**Example:**\n\n width: 3.14px\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CssNonIntegerLengthInPixels", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Probable bugs", + "index": 146, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssConvertColorToHexInspection", + "shortDescription": { + "text": "Color could be replaced with #-hex" + }, + "fullDescription": { + "text": "Reports an 'rgb()', 'hsl()', or other color function. Suggests replacing a color function with an equivalent hexadecimal notation. Example: 'rgb(12, 15, 255)' After the quick-fix is applied: '#0c0fff'.", + "markdown": "Reports an `rgb()`, `hsl()`, or other color function.\n\nSuggests replacing a color function with an equivalent hexadecimal notation.\n\n**Example:**\n\n rgb(12, 15, 255)\n\nAfter the quick-fix is applied:\n\n #0c0fff.\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssConvertColorToHexInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidAtRule", + "shortDescription": { + "text": "Unknown at-rule" + }, + "fullDescription": { + "text": "Reports an unknown CSS at-rule.", + "markdown": "Reports an unknown [CSS at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidAtRule", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssNegativeValue", + "shortDescription": { + "text": "Negative property value" + }, + "fullDescription": { + "text": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height.", + "markdown": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssNegativeValue", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssNoGenericFontName", + "shortDescription": { + "text": "Missing generic font family name" + }, + "fullDescription": { + "text": "Verifies that the 'font-family' property contains a generic font family name as a fallback alternative. Generic font family names are: 'serif', 'sans-serif', 'cursive', 'fantasy', and 'monospace'.", + "markdown": "Verifies that the [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) property contains a generic font family name as a fallback alternative.\n\n\nGeneric font family names are: `serif`, `sans-serif`, `cursive`, `fantasy`,\nand `monospace`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssNoGenericFontName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Probable bugs", + "index": 146, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssRedundantUnit", + "shortDescription": { + "text": "Redundant measure unit" + }, + "fullDescription": { + "text": "Reports a measure unit of a zero value where units are not required by the specification. Example: 'width: 0px'", + "markdown": "Reports a measure unit of a zero value where units are not required by the specification.\n\n**Example:**\n\n width: 0px\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssRedundantUnit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Code style issues", + "index": 114, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidPropertyValue", + "shortDescription": { + "text": "Invalid property value" + }, + "fullDescription": { + "text": "Reports an incorrect CSS property value.", + "markdown": "Reports an incorrect CSS property value." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssInvalidPropertyValue", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssReplaceWithShorthandUnsafely", + "shortDescription": { + "text": "Properties may probably be replaced with a shorthand" + }, + "fullDescription": { + "text": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case. For example, 2 properties: 'outline-color' and 'outline-style' may be replaced with a single 'outline'. Such replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states. In this example, switching to the 'outline' shorthand means that 'outline-width' is also set to its initial value, which is 'medium'. This inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe). For such cases see the 'Properties may be safely replaced with a shorthand' inspection instead.", + "markdown": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case.\n\n\nFor example, 2 properties: `outline-color` and `outline-style` may be replaced with a single `outline`.\nSuch replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states.\nIn this example, switching to the `outline` shorthand means that `outline-width` is also set to its initial value,\nwhich is `medium`.\n\n\nThis inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe).\nFor such cases see the 'Properties may be safely replaced with a shorthand' inspection instead." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CssReplaceWithShorthandUnsafely", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnknownUnit", + "shortDescription": { + "text": "Unknown unit" + }, + "fullDescription": { + "text": "Reports an unknown unit.", + "markdown": "Reports an unknown unit." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssUnknownUnit", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssInvalidImport", + "shortDescription": { + "text": "Misplaced @import" + }, + "fullDescription": { + "text": "Reports a misplaced '@import' statement. According to the specification, '@import' rules must precede all other types of rules, except '@charset' rules.", + "markdown": "Reports a misplaced `@import` statement.\n\n\nAccording to the [specification](https://developer.mozilla.org/en-US/docs/Web/CSS/@import),\n`@import` rules must precede all other types of rules, except `@charset` rules." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CssInvalidImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssUnresolvedClassInComposesRule", + "shortDescription": { + "text": "Unresolved class in 'composes' rule" + }, + "fullDescription": { + "text": "Reports a CSS class reference in the 'composes' rule that cannot be resolved to any valid target. Example: '.className {/* ... */}\n\n .otherClassName {\n composes: className;\n }'", + "markdown": "Reports a CSS class reference in the ['composes'](https://github.com/css-modules/css-modules#composition) rule that cannot be resolved to any valid target.\n\n**Example:**\n\n\n .className {/* ... */}\n\n .otherClassName {\n composes: className;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CssUnresolvedClassInComposesRule", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Invalid elements", + "index": 30, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CssReplaceWithShorthandSafely", + "shortDescription": { + "text": "Properties may be safely replaced with a shorthand" + }, + "fullDescription": { + "text": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form. For example, 4 properties: 'padding-top', 'padding-right', 'padding-bottom', and 'padding-left' can be safely replaced with a single 'padding' property. Note that this inspection doesn't show up if the set of longhand properties is incomplete (e.g. only 3 'padding-xxx' properties in a ruleset) because switching to a shorthand may change the result. For such cases consider the 'Properties may probably be replaced with a shorthand' inspection.", + "markdown": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form.\n\n\nFor example, 4 properties: `padding-top`, `padding-right`, `padding-bottom`, and\n`padding-left`\ncan be safely replaced with a single `padding` property.\n\n\nNote that this inspection doesn't show up if the set of longhand properties is incomplete\n(e.g. only 3 `padding-xxx` properties in a ruleset)\nbecause switching to a shorthand may change the result.\nFor such cases consider the 'Properties may probably be replaced with a shorthand'\ninspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CssReplaceWithShorthandSafely", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS", + "index": 29, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.kubernetes", + "version": "243.24609", + "rules": [ + { + "id": "KubernetesDeprecatedResources", + "shortDescription": { + "text": "Deprecated Kubernetes resources" + }, + "fullDescription": { + "text": "Report deprecated Kubernetes resource types.", + "markdown": "Report deprecated Kubernetes resource types. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KubernetesDeprecatedResources", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesNonEditableResources", + "shortDescription": { + "text": "Non-editable Kubernetes resources" + }, + "fullDescription": { + "text": "Reports non-editable (read-only) Kubernetes resource types.", + "markdown": "Reports non-editable (read-only) Kubernetes resource types. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KubernetesNonEditableResources", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesDeprecatedKeys", + "shortDescription": { + "text": "Deprecated Kubernetes resource properties" + }, + "fullDescription": { + "text": "Reports deprecated keys in Kubernetes resource files.", + "markdown": "Reports deprecated keys in Kubernetes resource files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KubernetesDeprecatedKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesNonEditableKeys", + "shortDescription": { + "text": "Non-editable Kubernetes resource properties" + }, + "fullDescription": { + "text": "Reports non-editable (read-only) keys in Kubernetes resource files.", + "markdown": "Reports non-editable (read-only) keys in Kubernetes resource files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KubernetesNonEditableKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HelmChartMissingKeys", + "shortDescription": { + "text": "Missing Chart.yaml keys" + }, + "fullDescription": { + "text": "Reports missing required keys in Chart.yaml.", + "markdown": "Reports missing required keys in Chart.yaml. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "HelmChartMissingKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesUnknownValues", + "shortDescription": { + "text": "Unknown Kubernetes YAML values" + }, + "fullDescription": { + "text": "Reports invalid values in Kubernetes resource files.", + "markdown": "Reports invalid values in Kubernetes resource files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KubernetesUnknownValues", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesUnknownKeys", + "shortDescription": { + "text": "Unknown Kubernetes YAML keys" + }, + "fullDescription": { + "text": "Reports unrecognized keys in Kubernetes resource files.", + "markdown": "Reports unrecognized keys in Kubernetes resource files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KubernetesUnknownKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HelmChartUnknownValues", + "shortDescription": { + "text": "Invalid Chart.yaml values" + }, + "fullDescription": { + "text": "Reports unrecognized values in Chart.yaml and requirements.yaml.", + "markdown": "Reports unrecognized values in Chart.yaml and requirements.yaml. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "HelmChartUnknownValues", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesMissingKeys", + "shortDescription": { + "text": "Missing Kubernetes YAML keys" + }, + "fullDescription": { + "text": "Reports missing required keys in Kubernetes resource files.", + "markdown": "Reports missing required keys in Kubernetes resource files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KubernetesMissingKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesUnknownResourcesInspection", + "shortDescription": { + "text": "Unknown Kubernetes resources" + }, + "fullDescription": { + "text": "Reports unrecognized Kubernetes resource types.", + "markdown": "Reports unrecognized Kubernetes resource types. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KubernetesUnknownResourcesInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HelmChartUnknownKeys", + "shortDescription": { + "text": "Unknown Chart.yaml keys" + }, + "fullDescription": { + "text": "Reports unrecognized keys in Chart.yaml.", + "markdown": "Reports unrecognized keys in Chart.yaml. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HelmChartUnknownKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KubernetesDuplicatedEnvVars", + "shortDescription": { + "text": "Duplicated EnvVar definitions" + }, + "fullDescription": { + "text": "Reports duplicate EnvVars in Kubernetes container definitions.", + "markdown": "Reports duplicate EnvVars in Kubernetes container definitions. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KubernetesDuplicatedEnvVars", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kubernetes", + "index": 33, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.properties", + "version": "243.24609", + "rules": [ + { + "id": "UseEllipsisInPropertyInspection", + "shortDescription": { + "text": "Three dot characters instead of the ellipsis" + }, + "fullDescription": { + "text": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files.", + "markdown": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseEllipsisInPropertyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AlphaUnsortedPropertiesFile", + "shortDescription": { + "text": "Properties file or resource bundle is alphabetically unsorted" + }, + "fullDescription": { + "text": "Reports alphabetically unsorted resource bundles or .properties files.", + "markdown": "Reports alphabetically unsorted resource bundles or .properties files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AlphaUnsortedPropertiesFile", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedProperty", + "shortDescription": { + "text": "Unused property" + }, + "fullDescription": { + "text": "Reports properties that are not referenced outside of the .properties file they are contained in.", + "markdown": "Reports properties that are not referenced outside of the .properties file they are contained in." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrailingSpacesInProperty", + "shortDescription": { + "text": "Trailing spaces in property" + }, + "fullDescription": { + "text": "Reports properties whose keys or values end with a whitespace.", + "markdown": "Reports properties whose keys or values end with a whitespace." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TrailingSpacesInProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WrongPropertyKeyValueDelimiter", + "shortDescription": { + "text": "Property key/value delimiter doesn't match code style settings" + }, + "fullDescription": { + "text": "Reports properties in which key or value delimiters do not match code style settings.", + "markdown": "Reports properties in which key or value delimiters do not match code style settings." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "WrongPropertyKeyValueDelimiter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicatePropertyInspection", + "shortDescription": { + "text": "Duplicate property" + }, + "fullDescription": { + "text": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values. Example: 'property1=value;\nproperty2=value;' The Options list allows selecting the area in which the inspection should search for duplicates.", + "markdown": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicatePropertyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 38, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "XPathView", + "version": "243.24609", + "rules": [ + { + "id": "XsltUnusedDeclaration", + "shortDescription": { + "text": "Unused variable or parameter" + }, + "fullDescription": { + "text": "Reports local variables and parameters that are never used.", + "markdown": "Reports local variables and parameters that are never used." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XsltUnusedDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XSLT", + "index": 43, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantTypeConversion", + "shortDescription": { + "text": "Redundant type conversion" + }, + "fullDescription": { + "text": "Reports unnecessary type conversions. Type conversions are unnecessary when the argument type of a 'string()', 'number()', or 'boolean()' function is already the same as the function's return type or if the expected expression type is 'any'. Suggests removing the unnecessary conversion.", + "markdown": "Reports unnecessary type conversions. Type conversions are unnecessary when the argument type of a `string()`, `number()`, or `boolean()` function is already the same as the function's return type or if the expected expression type is `any`. Suggests removing the unnecessary conversion." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantTypeConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "XPath", + "index": 85, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckNodeTest", + "shortDescription": { + "text": "Unknown element or attribute name" + }, + "fullDescription": { + "text": "Reports names of elements or attributes that are used in an XPath-expression but are missing in the associated XML files and are not defined in the referenced schemas. Such names are often the result of typos and would otherwise probably only be discovered at runtime. Example: '' If the 'h' is bound to the XHTML namespace, the inspection will report this part of the 'match' expression as an unknown element name because the correct name of the element is \"textarea\".", + "markdown": "Reports names of elements or attributes that are used in an XPath-expression but are missing in the associated XML files and are not defined in the referenced schemas. Such names are often the result of typos and would otherwise probably only be discovered at runtime.\n\n**Example:**\n\n\n \n\n\nIf the `h` is bound to the XHTML namespace, the inspection will report this part of the `match` expression as an\nunknown element name because the correct name of the element is \"textarea\"." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckNodeTest", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XPath", + "index": 85, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XsltDeclarations", + "shortDescription": { + "text": "Incorrect declaration" + }, + "fullDescription": { + "text": "Reports duplicate declarations and illegal identifiers in XSLT variables, parameters, and named templates:", + "markdown": "Reports duplicate declarations and illegal identifiers in XSLT variables, parameters, and named templates:" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XsltDeclarations", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XSLT", + "index": 43, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardwiredNamespacePrefix", + "shortDescription": { + "text": "Hardcoded namespace prefix" + }, + "fullDescription": { + "text": "Reports comparisons of the 'name()' function with a string that contains a colon (':'). Such usages usually indicate a hardcoded namespace prefix in the comparison. As a result, the code will break when run against XML that uses another prefix for the same namespace. Example: '...'", + "markdown": "Reports comparisons of the `name()` function with a string that contains a colon (`:`). Such usages usually indicate a hardcoded namespace prefix in the comparison. As a result, the code will break when run against XML that uses another prefix for the same namespace.\n\n**Example:**\n\n\n ...\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HardwiredNamespacePrefix", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XPath", + "index": 85, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitTypeConversion", + "shortDescription": { + "text": "Implicit type conversion" + }, + "fullDescription": { + "text": "Reports implicit conversions between the predefined XPath-types 'STRING', 'NUMBER', 'BOOLEAN', and 'NODESET'. Helps to write XSLT scripts that are more expressive about types and prevents subtle bugs: Example: '' is not the same as '' The first test checks whether the element \"foo\" exists ('count(foo) > 0)'; the latter one however is only true if the element actually contains any text ('string-length(foo) > 0'). Suggests making the type conversion more explicit. Use the following options to configure the inspection: Enable or disable implicit conversions between certain types Always report explicit conversions that do not result in the actually expected type, for example, '' Ignore conversion from 'NODESET' to 'BOOLEAN' by using the 'string()' function as a shortcut for writing 'string-length() > 0'.", + "markdown": "Reports implicit conversions between the predefined XPath-types `STRING`, `NUMBER`, `BOOLEAN`, and `NODESET`. Helps to write XSLT scripts that are more expressive about types and prevents subtle bugs:\n\n**Example:**\n\n\n \n\nis not the same as\n\n\n \n\n\nThe first test checks whether the element \"foo\" exists (`count(foo) > 0)`; the latter one however is only\ntrue if the element actually contains any text (`string-length(foo) > 0`). Suggests making\nthe type conversion more explicit.\n\n\nUse the following options to configure the inspection:\n\n* Enable or disable implicit conversions between certain types\n* Always report explicit conversions that do not result in the actually expected type, for example, ``\n* Ignore conversion from `NODESET` to `BOOLEAN` by using the `string()` function as a shortcut for writing `string-length() > 0`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ImplicitTypeConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XPath", + "index": 85, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IndexZeroUsage", + "shortDescription": { + "text": "XPath predicate with index 0" + }, + "fullDescription": { + "text": "Reports usages of '0' in a predicate index or in a comparison with the function 'position()'. Such usage is almost always a bug because in XPath, the index starts at '1', not at '0'. Example: '//someelement[position() = 0]' or '//something[0]'", + "markdown": "Reports usages of `0` in a predicate index or in a comparison with the function `position()`. Such usage is almost always a bug because in XPath, the index starts at `1`, *not* at `0`.\n\n**Example:**\n\n\n //someelement[position() = 0] or //something[0]\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IndexZeroUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XPath", + "index": 85, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XsltTemplateInvocation", + "shortDescription": { + "text": "Incorrect template invocation" + }, + "fullDescription": { + "text": "Reports missing arguments, passing arguments that are not declared, and passing arguments for parameters more than once in named XSLT template invocations. Parameters declared with a default value are optional and will not be reported as missing.", + "markdown": "Reports missing arguments, passing arguments that are not declared, and passing arguments for parameters more than once in named XSLT template invocations.\n\n\nParameters declared with a default value are optional and will not be reported as missing." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XsltTemplateInvocation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "XSLT", + "index": 43, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XsltVariableShadowing", + "shortDescription": { + "text": "Shadowed variable" + }, + "fullDescription": { + "text": "Reports shadowed XSLT variables.", + "markdown": "Reports shadowed XSLT variables." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XsltVariableShadowing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "XSLT", + "index": 43, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "Docker", + "version": "243.24609", + "rules": [ + { + "id": "DockerFileRunCommandMissingContinuation", + "shortDescription": { + "text": "Missing continuation character for ''RUN'' command" + }, + "fullDescription": { + "text": "Reports missing continuation characters in 'RUN' command. In the shell form of 'RUN' command you should use a '\\' (backslash) to continue a single 'RUN' instruction onto the next line. Otherwise, Docker build will fail. Examples: '# the command below will fail\n RUN /bin/bash -c 'source $HOME/.bashrc;\n echo $HOME'' After the quick-fix is applied: 'RUN /bin/bash -c 'source $HOME/.bashrc; \\\n echo $HOME''", + "markdown": "Reports missing continuation characters in `RUN` command.\n\n\nIn the *shell* form of `RUN` command you should use a '\\\\' (backslash)\nto continue a single `RUN` instruction onto the next line.\nOtherwise, Docker build will fail.\n\n**Examples:**\n\n\n # the command below will fail\n RUN /bin/bash -c 'source $HOME/.bashrc;\n echo $HOME'\n\nAfter the quick-fix is applied:\n\n\n RUN /bin/bash -c 'source $HOME/.bashrc; \\\n echo $HOME'\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "DockerFileRunCommandMissingContinuation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dockerfile", + "index": 44, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DockerJsonFormStringLiterals", + "shortDescription": { + "text": "A single quoted string in JSON array format" + }, + "fullDescription": { + "text": "Reports a single quoted string in JSON array format. JSON array form, must use double-quotes (\") around words not single-quotes ('). Otherwise, Docker build will fail. Examples: '# all the commands below will fail\n RUN ['/bin/bash', '-c', 'echo hello']\n ADD ['binaryA.jar', 'binary2.jar', 'destination/']\n COPY ['binaryA.jar', 'binary2.jar', 'destination/']' After the quick-fix is applied: 'RUN [\"/bin/bash\", \"-c\", \"echo hello\"]\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]\n COPY [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]'", + "markdown": "Reports a single quoted string in JSON array format.\n\n\nJSON array form, must use double-quotes (\") around words not single-quotes ('). Otherwise, Docker build will fail.\n\n**Examples:**\n\n\n # all the commands below will fail\n RUN ['/bin/bash', '-c', 'echo hello']\n ADD ['binaryA.jar', 'binary2.jar', 'destination/']\n COPY ['binaryA.jar', 'binary2.jar', 'destination/']\n\nAfter the quick-fix is applied:\n\n\n RUN [\"/bin/bash\", \"-c\", \"echo hello\"]\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]\n COPY [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DockerJsonFormStringLiterals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dockerfile", + "index": 44, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DockerFileArgumentCount", + "shortDescription": { + "text": "Wrong number of arguments" + }, + "fullDescription": { + "text": "Reports invalid number of arguments for the Dockerfile commands. Docker build will fail after reaching the instruction with an invalid number of arguments.", + "markdown": "Reports invalid number of arguments for the Dockerfile commands.\n\n\nDocker build will fail after reaching the instruction with an invalid number of arguments." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "DockerFileArgumentCount", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dockerfile", + "index": 44, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComposeUnknownValues", + "shortDescription": { + "text": "Unknown docker-compose YAML values" + }, + "fullDescription": { + "text": "Reports unrecognized values in Docker Compose files.", + "markdown": "Reports unrecognized values in Docker Compose files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ComposeUnknownValues", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Docker-compose", + "index": 135, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DockerFileAddOrCopyPaths", + "shortDescription": { + "text": "Invalid destination for ''ADD''/''COPY'' commands" + }, + "fullDescription": { + "text": "Reports invalid destination directories in 'ADD' and 'COPY' commands. According to the Dockerfile specification, if multiple sources are specified, then the destination must be a directory, and it must end with a slash '/'. Otherwise, Docker build will fail. Examples: '# all the commands below will fail\n ADD textA.txt textB.txt relativeDir\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination\"]\n COPY text3.txt text4.txt /absolute/path' After the quick-fix is applied: 'ADD textA.txt textB.txt relativeDir/\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]\n COPY text3.txt text4.txt /absolute/path/'", + "markdown": "Reports invalid destination directories in `ADD` and `COPY` commands.\n\n\nAccording to the [Dockerfile specification](https://docs.docker.com/engine/reference/builder/#add),\nif multiple sources are specified, then the destination must be a directory, and it must end with a slash '/'.\nOtherwise, Docker build will fail.\n\n**Examples:**\n\n\n # all the commands below will fail\n ADD textA.txt textB.txt relativeDir\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination\"]\n COPY text3.txt text4.txt /absolute/path\n\nAfter the quick-fix is applied:\n\n\n ADD textA.txt textB.txt relativeDir/\n ADD [\"binaryA.jar\", \"binary2.jar\", \"destination/\"]\n COPY text3.txt text4.txt /absolute/path/\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DockerFileAddOrCopyPaths", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dockerfile", + "index": 44, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComposeMissingKeys", + "shortDescription": { + "text": "Missing docker-compose YAML keys" + }, + "fullDescription": { + "text": "Reports missing required keys in Docker Compose files.", + "markdown": "Reports missing required keys in Docker Compose files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ComposeMissingKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Docker-compose", + "index": 135, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComposeUnquotedPorts", + "shortDescription": { + "text": "Unquoted port mappings" + }, + "fullDescription": { + "text": "Reports unquoted port mappings in Docker Compose files. According to the Compose file specification, mapping ports in the 'HOST:CONTAINER' format may lead to erroneous results when using a container port lower than 60, because YAML parses numbers in the format 'xx:yy' as a base-60 value. For this reason, we recommend always explicitly specifying the port mappings as strings. Examples: 'ports:\n - 3000\n - 3000-3005\n - 22:22\n - 8080:8080' After the quick-fix is applied: 'ports:\n - \"3000\"\n - \"3000-3005\"\n - \"22:22\"\n - \"8080:8080\"'", + "markdown": "Reports unquoted port mappings in Docker Compose files.\n\n\nAccording to the [Compose file specification](https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-1),\nmapping ports in the `HOST:CONTAINER` format may lead to erroneous results when using a container port lower than 60,\nbecause YAML parses numbers in the format `xx:yy` as a base-60 value.\nFor this reason, we recommend always explicitly specifying the port mappings as strings.\n\n**Examples:**\n\n\n ports:\n - 3000\n - 3000-3005\n - 22:22\n - 8080:8080\n\nAfter the quick-fix is applied:\n\n\n ports:\n - \"3000\"\n - \"3000-3005\"\n - \"22:22\"\n - \"8080:8080\"\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ComposeUnquotedPorts", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Docker-compose", + "index": 135, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComposeUnknownKeys", + "shortDescription": { + "text": "Unknown docker-compose YAML keys" + }, + "fullDescription": { + "text": "Reports unrecognized keys in Docker Compose files.", + "markdown": "Reports unrecognized keys in Docker Compose files. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ComposeUnknownKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Docker-compose", + "index": 135, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DockerFileAssignments", + "shortDescription": { + "text": "Invalid spaces in ''key=value'' pair" + }, + "fullDescription": { + "text": "Reports incorrect spacing for key-value pairs in 'ARG', 'ENV', and 'LABEL' commands. While it is not explicitly specified in the Dockerfile specification, some combinations of spacing for key-value pairs are not allowed. Docker build will fail after reaching the problem instruction. Examples: The 'ARG' command does not allow any spaces around '=' 'ENV' and 'LABEL' do not allow spaces after '=' '# all the commands below will fail\n ARG answer = 42\n ARG version= \"1.0.0\"\n LABEL \"maintained.by\"= someone@gmail.com\n ENV JAVA_HOME= \"/docker-java-home\"' After the quick-fix is applied: 'ARG answer=2\n ARG version=\"1.0.0\"\n LABEL \"maintained.by\"=someone@gmail.com\n ENV JAVA_HOME=\"/docker-java-home\"'", + "markdown": "Reports incorrect spacing for key-value pairs in `ARG`, `ENV`, and `LABEL` commands.\n\n\nWhile it is not explicitly specified in the [Dockerfile specification](https://docs.docker.com/engine/reference/builder/#arg),\nsome combinations of spacing for key-value pairs are not allowed.\nDocker build will fail after reaching the problem instruction.\n\n**Examples:**\n\n* The `ARG` command does not allow any spaces around '='\n* `ENV` and `LABEL` do not allow spaces after '='\n\n\n # all the commands below will fail\n ARG answer = 42\n ARG version= \"1.0.0\"\n LABEL \"maintained.by\"= someone@gmail.com\n ENV JAVA_HOME= \"/docker-java-home\"\n\nAfter the quick-fix is applied:\n\n\n ARG answer=2\n ARG version=\"1.0.0\"\n LABEL \"maintained.by\"=someone@gmail.com\n ENV JAVA_HOME=\"/docker-java-home\"\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "DockerFileAssignments", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dockerfile", + "index": 44, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.qodana", + "version": "243.24609", + "rules": [ + { + "id": "JsCoverageInspection", + "shortDescription": { + "text": "Check JavaScript and TypeScript source code coverage" + }, + "fullDescription": { + "text": "Reports methods, classes and files whose coverage is below a certain threshold.", + "markdown": "Reports methods, classes and files whose coverage is below a certain threshold." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsCoverageInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Code Coverage", + "index": 53, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclomaticComplexityInspection", + "shortDescription": { + "text": "Code metrics" + }, + "fullDescription": { + "text": "Calculates cyclomatic complexity.", + "markdown": "Calculates cyclomatic complexity." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CyclomaticComplexityInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Qodana", + "index": 174, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "AngularJS", + "version": "243.24609", + "rules": [ + { + "id": "AngularInvalidImportedOrDeclaredSymbol", + "shortDescription": { + "text": "Invalid imported or declared symbol" + }, + "fullDescription": { + "text": "Reports any symbol that is declared, imported or exported by an Angular module or standalone component that is not a module, component, directive, or pipe or can’t be used in the context of the property.", + "markdown": "Reports any symbol that is declared, imported or exported by an Angular module or standalone component that is not a module, component, directive, or pipe or can't be used in the context of the property." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInvalidImportedOrDeclaredSymbol", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularRecursiveModuleImportExport", + "shortDescription": { + "text": "Recursive import or export of an Angular module or a standalone component" + }, + "fullDescription": { + "text": "Reports a cyclic dependency between Angular modules or standalone components.", + "markdown": "Reports a cyclic dependency between Angular modules or standalone components." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularRecursiveModuleImportExport", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularNgOptimizedImage", + "shortDescription": { + "text": "Issues with ngSrc usage in img tags" + }, + "fullDescription": { + "text": "Reports issues related to usage of 'ngSrc' (NgOptimizedDirective) on 'img' tags. Following issues are reported: 'img' tags, which use 'src' instead of 'ngSrc' lack of 'width' and 'height', or 'fill' attributes when 'ngSrc' is used 'width' or 'height', and 'fill' attributes being present on the same element when 'ngSrc' is used", + "markdown": "Reports issues related to usage of `ngSrc` ([NgOptimizedDirective](https://angular.io/guide/image-directive)) on `img` tags.\n\n\nFollowing issues are reported:\n\n* `img` tags, which use `src` instead of `ngSrc`\n* lack of `width` and `height`, or `fill` attributes when `ngSrc` is used\n* `width` or `height`, and `fill` attributes being present on the same element when `ngSrc` is used" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AngularNgOptimizedImage", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInvalidTemplateReferenceVariable", + "shortDescription": { + "text": "Unbound or ambiguous template reference variable" + }, + "fullDescription": { + "text": "Reports a template reference variable that is not assigned to a directive when using 'exportAs' or is assigned to multiple directives.", + "markdown": "Reports a template reference variable that is not assigned to a directive when using `exportAs` or is assigned to multiple directives." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInvalidTemplateReferenceVariable", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularMultipleStructuralDirectives", + "shortDescription": { + "text": "Multiple structural directives on one element" + }, + "fullDescription": { + "text": "Reports multiple structural directives ('*ngIf', '*ngFor', etc.) on one element.", + "markdown": "Reports multiple structural directives (`*ngIf`, `*ngFor`, etc.) on one element." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularMultipleStructuralDirectives", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUnsupportedSyntax", + "shortDescription": { + "text": "Unsupported Angular expression syntax" + }, + "fullDescription": { + "text": "Reports problems with Angular expression syntax, which is not supported in an older version of Angular.", + "markdown": "Reports problems with Angular expression syntax, which is not supported in an older version of Angular." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUnsupportedSyntax", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularNonStandaloneComponentImports", + "shortDescription": { + "text": "Invalid usage of imports in non-standalone components" + }, + "fullDescription": { + "text": "Reports usages of imports property in non-standalone component decorators. Imports can be used only in standalone components.", + "markdown": "Reports usages of imports property in non-standalone component decorators. Imports can be used only in standalone components." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularNonStandaloneComponentImports", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInvalidSelector", + "shortDescription": { + "text": "Missing or invalid selector" + }, + "fullDescription": { + "text": "Reports an invalid 'selector' property of a component or directive.", + "markdown": "Reports an invalid `selector` property of a component or directive." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInvalidSelector", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularNonEmptyNgContent", + "shortDescription": { + "text": "Content inside tag" + }, + "fullDescription": { + "text": "Reports a text or tag occurrence inside a '' tag used for content projection.", + "markdown": "Reports a text or tag occurrence inside a `` tag used for content projection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularNonEmptyNgContent", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInsecureBindingToEvent", + "shortDescription": { + "text": "Insecure binding to event" + }, + "fullDescription": { + "text": "Reports a binding to an event property or attribute, for example, '[onclick]' or '[attr.onclick]' instead of '(click)'.", + "markdown": "Reports a binding to an event property or attribute, for example, `[onclick]` or `[attr.onclick]` instead of `(click)`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AngularInsecureBindingToEvent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularDeferBlockOnTrigger", + "shortDescription": { + "text": "Problems with @defer `on` triggers" + }, + "fullDescription": { + "text": "Reports issues with triggers in `on` parameters in `@defer` block.", + "markdown": "Reports issues with triggers in \\`on\\` parameters in \\`@defer\\` block." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularDeferBlockOnTrigger", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularMissingEventHandler", + "shortDescription": { + "text": "Missing event handler" + }, + "fullDescription": { + "text": "Reports a missing event handler statement for an event binding.", + "markdown": "Reports a missing event handler statement for an event binding." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularMissingEventHandler", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUndefinedBinding", + "shortDescription": { + "text": "Undefined binding" + }, + "fullDescription": { + "text": "Reports an undefined property, event, or structural directive bindings on elements.", + "markdown": "Reports an undefined property, event, or structural directive bindings on elements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUndefinedBinding", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularForBlockNonIterableVar", + "shortDescription": { + "text": "Non-iterable type in @for block" + }, + "fullDescription": { + "text": "Reports that the type of variable to iterate over does not have '[Symbol.iterator]()' method, which returns an iterator.", + "markdown": "Reports that the type of variable to iterate over does not have `[Symbol.iterator]()` method, which returns an iterator." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularForBlockNonIterableVar", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularBindingTypeMismatch", + "shortDescription": { + "text": "Invalid binding type" + }, + "fullDescription": { + "text": "Reports a mismatch between actual and expected directive binding type.", + "markdown": "Reports a mismatch between actual and expected directive binding type." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularBindingTypeMismatch", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUndefinedTag", + "shortDescription": { + "text": "Undefined tag" + }, + "fullDescription": { + "text": "Reports a tag defined by a component or directive out of the current scope.", + "markdown": "Reports a tag defined by a component or directive out of the current scope." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUndefinedTag", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularAmbiguousComponentTag", + "shortDescription": { + "text": "Ambiguous component tag" + }, + "fullDescription": { + "text": "Reports a component that is matched on an embedded template element '' or multiple components matched on any other element.", + "markdown": "Reports a component that is matched on an embedded template element `` or multiple components matched on any other element." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularAmbiguousComponentTag", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUndefinedModuleExport", + "shortDescription": { + "text": "Undefined export from Angular module" + }, + "fullDescription": { + "text": "Reports an export of an undeclared or unimported component, directive, or pipes from an Angular module.", + "markdown": "Reports an export of an undeclared or unimported component, directive, or pipes from an Angular module." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUndefinedModuleExport", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInvalidI18nAttribute", + "shortDescription": { + "text": "Invalid i18n attribute" + }, + "fullDescription": { + "text": "Reports a problem with a 'i18n-*' attribute.", + "markdown": "Reports a problem with a `i18n-*` attribute." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AngularInvalidI18nAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularIncorrectLetUsage", + "shortDescription": { + "text": "Incorrect usage of @let declaration" + }, + "fullDescription": { + "text": "Reports problems with @let declaration usages.", + "markdown": "Reports problems with @let declaration usages." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularIncorrectLetUsage", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInvalidAnimationTriggerAssignment", + "shortDescription": { + "text": "Invalid animation trigger assignment" + }, + "fullDescription": { + "text": "Reports an invalid assignment of an animation trigger. To attach an animation to an element, use '[@triggerName]=\"expression\"' or an attribute without a value '@triggerName'.", + "markdown": "Reports an invalid assignment of an animation trigger. To attach an animation to an element, use `[@triggerName]=\"expression\"` or an attribute without a value `@triggerName`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInvalidAnimationTriggerAssignment", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUnresolvedPipe", + "shortDescription": { + "text": "Unresolved pipe" + }, + "fullDescription": { + "text": "Reports an unresolved pipe.", + "markdown": "Reports an unresolved pipe." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUnresolvedPipe", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularUnusedComponentImport", + "shortDescription": { + "text": "Unused import in an Angular component declaration" + }, + "fullDescription": { + "text": "Reports unused imports in Angular components.", + "markdown": "Reports unused imports in Angular components." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularUnusedComponentImport", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularIncorrectBlockUsage", + "shortDescription": { + "text": "Incorrect usage of Angular block" + }, + "fullDescription": { + "text": "Reports problems with Angular blocks.", + "markdown": "Reports problems with Angular blocks." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularIncorrectBlockUsage", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularCliAddDependency", + "shortDescription": { + "text": "Angular CLI add dependency" + }, + "fullDescription": { + "text": "Suggests using the 'ng add' command to install the dependency. 'ng add' will use the package manager to download it and invoke a schematic which can update your project with configuration changes, add additional dependencies (e.g. polyfills), or scaffold package-specific initialization code.", + "markdown": "Suggests using the `ng add` command to install the dependency.\n\n`ng add` will use the package manager to download it and invoke a schematic\nwhich can update your project with configuration changes, add additional dependencies (e.g. polyfills),\nor scaffold package-specific initialization code." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AngularCliAddDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInaccessibleSymbol", + "shortDescription": { + "text": "Inaccessible component member or directive input" + }, + "fullDescription": { + "text": "Reports access to invisible (private or protected) component member or directive input from an Angular template.", + "markdown": "Reports access to invisible (private or protected) component member or directive input from an Angular template." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInaccessibleSymbol", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularIncorrectTemplateDefinition", + "shortDescription": { + "text": "Incorrect component template definition" + }, + "fullDescription": { + "text": "Reports a component that doesn’t have an associated template or uses both 'template' and 'templateUrl' properties.", + "markdown": "Reports a component that doesn't have an associated template or uses both `template` and `templateUrl` properties." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularIncorrectTemplateDefinition", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularMissingRequiredDirectiveInputBinding", + "shortDescription": { + "text": "Missing required directive input" + }, + "fullDescription": { + "text": "Reports a missing binding for a required directive input.", + "markdown": "Reports a missing binding for a required directive input." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularMissingRequiredDirectiveInputBinding", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularMissingOrInvalidDeclarationInModule", + "shortDescription": { + "text": "Missing or invalid component, directive or pipe declaration in a module" + }, + "fullDescription": { + "text": "Reports a non-standalone Angular component, directive, or pipe that is not declared in any module or is declared in multiple modules.", + "markdown": "Reports a non-standalone Angular component, directive, or pipe that is not declared in any module or is declared in multiple modules." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularMissingOrInvalidDeclarationInModule", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AngularInvalidEntryComponent", + "shortDescription": { + "text": "Invalid entry component" + }, + "fullDescription": { + "text": "Reports an invalid Angular component specified in the module’s 'bootstrap' or 'entryComponents' property.", + "markdown": "Reports an invalid Angular component specified in the module's `bootstrap` or `entryComponents` property." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "AngularInvalidEntryComponent", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Angular", + "index": 59, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.swagger", + "version": "243.24609", + "rules": [ + { + "id": "SwYamlMaybeSpecificationInspection", + "shortDescription": { + "text": "Possible OpenAPI/Swagger specification candidate" + }, + "fullDescription": { + "text": "Detects YAML files that can be interpreted as a part of OpenAPI/Swagger specification. Such files do not contain explicit specification attributes, but they are referenced from primary specification files located nearby. The following example contains two files located in the same directory. First one is a plain primary specification file. Second is referenced from the first one and thus is suggested to be considered a specification too. Primary specification file 'openapi.yaml': 'openapi: 3.1.0\ncomponents:\n schemas:\n CustomSchema:\n description: Custom schema object\n properties:\n foo:\n $ref: 'common.components.yaml#/components/schemas/CommonSchema'' Specification file candidate 'common.components.yaml': 'components: # 'Mark file as OpenAPI specification' highlighting\n schemas:\n CommonSchema:\n description: Common schema object reused in several specifications'", + "markdown": "Detects YAML files that can be interpreted as a part of OpenAPI/Swagger specification.\n\n\nSuch files do not contain explicit specification attributes, but they are referenced from primary specification files located nearby.\n\n\nThe following example contains two files located in the same directory. First one is a plain primary specification file.\nSecond is referenced from the first one and thus is suggested to be considered a specification too.\n\n**Primary specification file `openapi.yaml`:**\n\n\n openapi: 3.1.0\n components:\n schemas:\n CustomSchema:\n description: Custom schema object\n properties:\n foo:\n $ref: 'common.components.yaml#/components/schemas/CommonSchema'\n\n**Specification file candidate `common.components.yaml`:**\n\n\n components: # 'Mark file as OpenAPI specification' highlighting\n schemas:\n CommonSchema:\n description: Common schema object reused in several specifications\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwYamlMaybeSpecificationInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "OpenAPI specifications", + "index": 66, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwJsonUnresolvedReferencesInspection", + "shortDescription": { + "text": "Unresolved reference" + }, + "fullDescription": { + "text": "Detects unresolved references in JSON specification files.", + "markdown": "Detects unresolved references in JSON specification files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SwJsonUnresolvedReferencesInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "OpenAPI specifications", + "index": 66, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwJsonMaybeSpecificationInspection", + "shortDescription": { + "text": "Possible OpenAPI/Swagger specification candidate" + }, + "fullDescription": { + "text": "Detects JSON files that can be interpreted as a part of OpenAPI/Swagger specification. Such files do not contain explicit specification attributes, but they are referenced from primary specification files located nearby. The following example contains two files located in the same directory. First one is a plain primary specification file. Second is referenced from the first one and thus is suggested to be considered a specification too. Primary specification file 'openapi.yaml': 'openapi: 3.1.0\ncomponents:\n schemas:\n CustomSchema:\n description: Custom schema object\n properties:\n foo:\n $ref: 'common.components.json#/components/schemas/CommonSchema'' Specification file candidate 'common.components.json': '{\n \"components\": { // 'Mark file as OpenAPI specification' highlighting\n \"schemas\": {\n \"CommonSchema\": {\n \"description\": \"Common schema object reused in several specifications\"\n }\n }\n }\n}'", + "markdown": "Detects JSON files that can be interpreted as a part of OpenAPI/Swagger specification.\n\n\nSuch files do not contain explicit specification attributes, but they are referenced from primary specification files located nearby.\n\n\nThe following example contains two files located in the same directory. First one is a plain primary specification file.\nSecond is referenced from the first one and thus is suggested to be considered a specification too.\n\n**Primary specification file `openapi.yaml`:**\n\n\n openapi: 3.1.0\n components:\n schemas:\n CustomSchema:\n description: Custom schema object\n properties:\n foo:\n $ref: 'common.components.json#/components/schemas/CommonSchema'\n\n**Specification file candidate `common.components.json`:**\n\n\n {\n \"components\": { // 'Mark file as OpenAPI specification' highlighting\n \"schemas\": {\n \"CommonSchema\": {\n \"description\": \"Common schema object reused in several specifications\"\n }\n }\n }\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwJsonMaybeSpecificationInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "OpenAPI specifications", + "index": 66, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwYamlUnresolvedReferencesInspection", + "shortDescription": { + "text": "Unresolved reference" + }, + "fullDescription": { + "text": "Detects unresolved references in YAML specification files.", + "markdown": "Detects unresolved references in YAML specification files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SwYamlUnresolvedReferencesInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "OpenAPI specifications", + "index": 66, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.github", + "version": "243.24609-ultimate", + "rules": [ + { + "id": "CyclicJobDependency", + "shortDescription": { + "text": "Cyclic job dependency" + }, + "fullDescription": { + "text": "Detects cyclic dependencies for jobs in GitHub workflow YML file. See the GitHub Actions documentation for more information on workflow syntax.", + "markdown": "Detects cyclic dependencies for jobs in GitHub workflow YML file.\n\n\nSee the [GitHub Actions documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds) for more information on workflow syntax." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CyclicJobDependency", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MandatoryParamsAbsent", + "shortDescription": { + "text": "Invalid parameters" + }, + "fullDescription": { + "text": "Reports the absence of mandatory parameters that do not have a default value for an action. It also provides a Quick Fix by adding the missing parameters with an empty value. For more information on action params, see the GitHub documentation.", + "markdown": "Reports the absence of mandatory parameters that do not have a default value for an action. It also provides a Quick Fix by adding the missing parameters with an empty value.\n\n\nFor more information on action params, see the [GitHub documentation](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MandatoryParamsAbsent", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IllegalJobDependency", + "shortDescription": { + "text": "Undefined job dependency" + }, + "fullDescription": { + "text": "Detects dependencies to undefined Jobs in GitHub workflow YML file. See the GitHub Actions documentation for more information on workflow syntax.", + "markdown": "Detects dependencies to undefined Jobs in GitHub workflow YML file.\n\n\nSee the [GitHub Actions documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds) for more information on workflow syntax." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IllegalJobDependency", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UndefinedAction", + "shortDescription": { + "text": "Undefined action/file reference" + }, + "fullDescription": { + "text": "Detects unresolved action references in GitHub action and workflow files. For more information on action references, see the GitHub documentation.", + "markdown": "Detects unresolved action references in GitHub action and workflow files.\n\n\nFor more information on action references, see the [GitHub documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UndefinedAction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UndefinedParamsPresent", + "shortDescription": { + "text": "Undefined parameters" + }, + "fullDescription": { + "text": "Reports the presence of parameters which are not defined in an action. It also provides a Quick Fix by removing the undefined parameters. For more information on action params, see the GitHub documentation.", + "markdown": "Reports the presence of parameters which are not defined in an action. It also provides a Quick Fix by removing the undefined parameters.\n\n\nFor more information on action params, see the [GitHub documentation](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepswith)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UndefinedParamsPresent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GithubFunctionSignatureValidation", + "shortDescription": { + "text": "Standard library functions validation" + }, + "fullDescription": { + "text": "Reports invalid GitHub Actions Expression language standard library function calls For more information on GitHub Actions Expression language, see the GitHub documentation.", + "markdown": "Reports invalid GitHub Actions Expression language standard library function calls\n\n\nFor more information on GitHub Actions Expression language, see the [GitHub documentation](https://docs.github.com/en/actions/learn-github-actions/expressions)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GithubFunctionSignatureValidation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "GitHub actions", + "index": 70, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.jetbrains.plugins.jade", + "version": "243.24609", + "rules": [ + { + "id": "JadeTabsAndSpaces", + "shortDescription": { + "text": "Tabs and spaces both used" + }, + "fullDescription": { + "text": "Reports use of spaces and tabs for indentation in a Pug file.", + "markdown": "Reports use of spaces and tabs for indentation in a Pug file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JadeTabsAndSpaces", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Pug_Jade", + "index": 71, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.jsonpath", + "version": "243.24609", + "rules": [ + { + "id": "JsonPathUnknownFunction", + "shortDescription": { + "text": "Unknown JSONPath function" + }, + "fullDescription": { + "text": "Reports an unknown name in a JSONPath function call instead of known standard function names: 'concat', 'keys', 'length', 'min', 'max', 'avg', 'stddev', 'sum'.", + "markdown": "Reports an unknown name in a JSONPath function call instead of known standard function names: `concat`, `keys`, `length`, `min`, `max`, `avg`, `stddev`, `sum`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonPathUnknownFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JSONPath", + "index": 78, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonPathUnknownOperator", + "shortDescription": { + "text": "Unknown JSONPath operator" + }, + "fullDescription": { + "text": "Reports an unknown operator on a JSONPath expression instead of one of the standard ones: 'in', 'nin', 'subsetof', 'anyof', 'noneof', 'size', 'empty', 'contains'.", + "markdown": "Reports an unknown operator on a JSONPath expression instead of one of the standard ones: `in`, `nin`, `subsetof`, `anyof`, `noneof`, `size`, `empty`, `contains`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonPathUnknownOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JSONPath", + "index": 78, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonPathEvaluateUnknownKey", + "shortDescription": { + "text": "Unknown property key used for JSONPath evaluate expression" + }, + "fullDescription": { + "text": "Reports a key in a JSONPath expression that is missing in the source JSON document to evaluate.", + "markdown": "Reports a key in a JSONPath expression that is missing in the source JSON document to evaluate." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonPathEvaluateUnknownKey", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JSONPath", + "index": 78, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "HtmlTools", + "version": "243.24609", + "rules": [ + { + "id": "HtmlRequiredSummaryAttribute", + "shortDescription": { + "text": "Missing required 'summary' attribute" + }, + "fullDescription": { + "text": "Reports a missing 'summary' attribute in a 'table' tag. Suggests adding a'summary' attribute. Based on WCAG 2.0: H73.", + "markdown": "Reports a missing `summary` attribute in a `table` tag. Suggests adding a`summary` attribute. Based on WCAG 2.0: [H73](https://www.w3.org/TR/WCAG20-TECHS/H73.html)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HtmlRequiredSummaryAttribute", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlNonExistentInternetResource", + "shortDescription": { + "text": "Unresolved web link" + }, + "fullDescription": { + "text": "Reports an unresolved web link. Works by making network requests in the background.", + "markdown": "Reports an unresolved web link. Works by making network requests in the background." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlNonExistentInternetResource", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlRequiredTitleAttribute", + "shortDescription": { + "text": "Missing required 'title' attribute" + }, + "fullDescription": { + "text": "Reports a missing title attribute 'frame', 'iframe', 'dl', and 'a' tags. Suggests adding a title attribute. Based on WCAG 2.0: H33, H40, and H64.", + "markdown": "Reports a missing title attribute `frame`, `iframe`, `dl`, and `a` tags. Suggests adding a title attribute. Based on WCAG 2.0: [H33](https://www.w3.org/TR/WCAG20-TECHS/H33.html), [H40](https://www.w3.org/TR/WCAG20-TECHS/H40.html), and [H64](https://www.w3.org/TR/WCAG20-TECHS/H64.html)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HtmlRequiredTitleAttribute", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlRequiredAltAttribute", + "shortDescription": { + "text": "Missing required 'alt' attribute" + }, + "fullDescription": { + "text": "Reports a missing 'alt' attribute in a 'img' or 'applet' tag or in a 'area' element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: H24, H35, H36, H37.", + "markdown": "Reports a missing `alt` attribute in a `img` or `applet` tag or in a `area` element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: [H24](https://www.w3.org/TR/WCAG20-TECHS/H24.html), [H35](https://www.w3.org/TR/WCAG20-TECHS/H35.html), [H36](https://www.w3.org/TR/WCAG20-TECHS/H36.html), [H37](https://www.w3.org/TR/WCAG20-TECHS/H37.html)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlRequiredAltAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlPresentationalElement", + "shortDescription": { + "text": "Presentational tag" + }, + "fullDescription": { + "text": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag.", + "markdown": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HtmlPresentationalElement", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlDeprecatedTag", + "shortDescription": { + "text": "Obsolete tag" + }, + "fullDescription": { + "text": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag.", + "markdown": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlDeprecatedTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlFormInputWithoutLabel", + "shortDescription": { + "text": "Missing associated label" + }, + "fullDescription": { + "text": "Reports a form element ('input', 'textarea', or 'select') without an associated label. Suggests creating a new label. Based on WCAG 2.0: H44.", + "markdown": "Reports a form element (`input`, `textarea`, or `select`) without an associated label. Suggests creating a new label. Based on WCAG 2.0: [H44](https://www.w3.org/TR/WCAG20-TECHS/H44.html). " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlFormInputWithoutLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlRequiredTitleElement", + "shortDescription": { + "text": "Missing required 'title' element" + }, + "fullDescription": { + "text": "Reports a missing 'title' element inside a 'head' section. Suggests adding a 'title' element. The title should describe the document. Based on WCAG 2.0: H25.", + "markdown": "Reports a missing `title` element inside a `head` section. Suggests adding a `title` element. The title should describe the document. Based on WCAG 2.0: [H25](https://www.w3.org/TR/WCAG20-TECHS/H25.html)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlRequiredTitleElement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlDeprecatedAttribute", + "shortDescription": { + "text": "Obsolete attribute" + }, + "fullDescription": { + "text": "Reports an obsolete HTML5 attribute.", + "markdown": "Reports an obsolete HTML5 attribute." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlDeprecatedAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckImageSize", + "shortDescription": { + "text": "Mismatched image size" + }, + "fullDescription": { + "text": "Reports a 'width' and 'height' attribute value of a 'img' tag that is different from the actual width and height of the referenced image.", + "markdown": "Reports a `width` and `height` attribute value of a `img` tag that is different from the actual width and height of the referenced image." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckImageSize", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 11, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlRequiredLangAttribute", + "shortDescription": { + "text": "Missing required 'lang' attribute" + }, + "fullDescription": { + "text": "Reports a missing 'lang' (or 'xml:lang') attribute in a 'html' tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: H57.", + "markdown": "Reports a missing `lang` (or `xml:lang`) attribute in a `html` tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: [H57](https://www.w3.org/TR/WCAG20-TECHS/H57.html)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlRequiredLangAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "HTML/Accessibility", + "index": 83, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.modules.json", + "version": "243.24609", + "rules": [ + { + "id": "JsonSchemaCompliance", + "shortDescription": { + "text": "Compliance with JSON schema" + }, + "fullDescription": { + "text": "Reports inconsistence between a JSON file and the JSON schema that is assigned to it.", + "markdown": "Reports inconsistence between a JSON file and the [JSON schema](https://json-schema.org) that is assigned to it. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonSchemaCompliance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonSchemaDeprecation", + "shortDescription": { + "text": "Deprecated JSON property" + }, + "fullDescription": { + "text": "Reports a deprecated property in a JSON file. Note that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'.", + "markdown": "Reports a deprecated property in a JSON file. \nNote that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JsonSchemaDeprecation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonStandardCompliance", + "shortDescription": { + "text": "Compliance with JSON standard" + }, + "fullDescription": { + "text": "Reports the following discrepancies of a JSON file with the language specification: A line or block comment (configurable). Multiple top-level values (expect for JSON Lines files, configurable for others). A trailing comma in an object or array (configurable). A single quoted string. A property key is a not a double quoted strings. A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable).", + "markdown": "Reports the following discrepancies of a JSON file with [the language specification](https://tools.ietf.org/html/rfc7159):\n\n* A line or block comment (configurable).\n* Multiple top-level values (expect for JSON Lines files, configurable for others).\n* A trailing comma in an object or array (configurable).\n* A single quoted string.\n* A property key is a not a double quoted strings.\n* A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JsonStandardCompliance", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonSchemaRefReference", + "shortDescription": { + "text": "Unresolved '$ref' and '$schema' references" + }, + "fullDescription": { + "text": "Reports an unresolved '$ref' or '$schema' path in a JSON schema.", + "markdown": "Reports an unresolved `$ref` or `$schema` path in a JSON schema. " + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonSchemaRefReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Json5StandardCompliance", + "shortDescription": { + "text": "Compliance with JSON5 standard" + }, + "fullDescription": { + "text": "Reports inconsistency with the language specification in a JSON5 file.", + "markdown": "Reports inconsistency with [the language specification](http://json5.org) in a JSON5 file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Json5StandardCompliance", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonDuplicatePropertyKeys", + "shortDescription": { + "text": "Duplicate keys in object literals" + }, + "fullDescription": { + "text": "Reports a duplicate key in an object literal.", + "markdown": "Reports a duplicate key in an object literal." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonDuplicatePropertyKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 84, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.vue", + "version": "243.24609", + "rules": [ + { + "id": "VueMissingComponentImportInspection", + "shortDescription": { + "text": "Missing component import" + }, + "fullDescription": { + "text": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import.", + "markdown": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VueMissingComponentImportInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VueDeprecatedSymbol", + "shortDescription": { + "text": "Deprecated symbol" + }, + "fullDescription": { + "text": "Reports a deprecated Vue symbol.", + "markdown": "Reports a deprecated Vue symbol." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VueDeprecatedSymbol", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VueUnrecognizedDirective", + "shortDescription": { + "text": "Unrecognized directive" + }, + "fullDescription": { + "text": "Reports an unrecognized Vue directive.", + "markdown": "Reports an unrecognized Vue directive." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VueUnrecognizedDirective", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VueDuplicateTag", + "shortDescription": { + "text": "Duplicate template/script tag" + }, + "fullDescription": { + "text": "Reports multiple usages of the 'template' or 'script' tag in a Vue file. Vue Component specification indicates that each '*.vue' file can contain at most one 'template' or 'script' block at a time.", + "markdown": "Reports multiple usages of the `template` or `script` tag in a Vue file.\n\n[Vue Component specification](https://vue-loader.vuejs.org/spec.html) indicates that each `*.vue` file can contain at most one `template` or `script` block at a time." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VueDuplicateTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VueDataFunction", + "shortDescription": { + "text": "Data function" + }, + "fullDescription": { + "text": "Reports a Vue component data property that is not a function. Suggests wrapping an object literal with a function. When defining a component, 'data' must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for 'data', that very object will be shared by reference across all instances created! With a 'data' function, every time a new instance is created we can simply call it to return a fresh copy of the initial data.", + "markdown": "Reports a Vue component [data](https://vuejs.org/v2/api/#data) property that is not a function. Suggests wrapping an object literal with a function.\n\nWhen defining a component, `data` must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for `data`, that very object will be shared by reference across all instances created! With a `data` function, every time a new instance is created we can simply call it to return a fresh copy of the initial data." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VueDataFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VueUnrecognizedSlot", + "shortDescription": { + "text": "Unrecognized slot" + }, + "fullDescription": { + "text": "Reports an unrecognized Vue slot.", + "markdown": "Reports an unrecognized Vue slot." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VueUnrecognizedSlot", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Vue", + "index": 88, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.plugins.markdown", + "version": "243.24609", + "rules": [ + { + "id": "MarkdownOutdatedTableOfContents", + "shortDescription": { + "text": "Outdated table of contents section" + }, + "fullDescription": { + "text": "Checks if a particular table of contents section corresponds to the actual structure of the document.", + "markdown": "Checks if a particular table of contents section corresponds to the actual structure of the document." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownOutdatedTableOfContents", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownUnresolvedLinkLabel", + "shortDescription": { + "text": "Unresolved link label" + }, + "fullDescription": { + "text": "Reports unresolved link labels in Markdown files.", + "markdown": "Reports unresolved link labels in Markdown files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownUnresolvedLinkLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownNoTableBorders", + "shortDescription": { + "text": "Table doesn't have side borders" + }, + "fullDescription": { + "text": "Checks if table has correct side borders. For compatibility reasons all table rows should have borders (pipe symbols) at the start and at the end.", + "markdown": "Checks if table has correct side borders. For compatibility reasons all table rows should have borders (pipe symbols) at the start and at the end." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownNoTableBorders", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownIncorrectlyNumberedListItem", + "shortDescription": { + "text": "Incorrectly numbered list item" + }, + "fullDescription": { + "text": "Ordered list items are expected to have straight numeration starting from 1. The motivation behind this is that most of Markdown processors are ignoring the numbering of ordered lists. A processor will generate an '
      ' element for such list, that will number items continuously from 1.", + "markdown": "Ordered list items are expected to have straight numeration starting from 1.\n\nThe motivation behind this is that most of Markdown processors are ignoring the numbering of ordered lists. A processor will generate an `
        ` element for such list, that will number items continuously from 1." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownIncorrectlyNumberedListItem", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownUnresolvedHeaderReference", + "shortDescription": { + "text": "Unresolved header reference" + }, + "fullDescription": { + "text": "Reports unresolved header references in Markdown files.", + "markdown": "Reports unresolved header references in Markdown files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownUnresolvedHeaderReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownLinkDestinationWithSpaces", + "shortDescription": { + "text": "Links should not contain spaces" + }, + "fullDescription": { + "text": "To ensure consistency between different tools, file links should not contain spaces. Example: '[Some file link](some file.md)' A quick-fix replaces spaces with their url-encoded equivalent: '[Some file link](some%20file.md)'", + "markdown": "To ensure consistency between different tools, file links should not contain spaces.\n\n**Example:**\n\n\n [Some file link](some file.md)\n\nA quick-fix replaces spaces with their url-encoded equivalent:\n\n\n [Some file link](some%20file.md)\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownLinkDestinationWithSpaces", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownIncorrectTableFormatting", + "shortDescription": { + "text": "Incorrect table formatting" + }, + "fullDescription": { + "text": "Checks if table is correctly formatted.", + "markdown": "Checks if table is correctly formatted." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MarkdownIncorrectTableFormatting", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownUnresolvedFileReference", + "shortDescription": { + "text": "Unresolved file references" + }, + "fullDescription": { + "text": "Reports unresolved file references in Markdown files.", + "markdown": "Reports unresolved file references in Markdown files." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkdownUnresolvedFileReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Markdown", + "index": 90, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.yaml", + "version": "243.24609", + "rules": [ + { + "id": "YAMLIncompatibleTypes", + "shortDescription": { + "text": "Suspicious type mismatch" + }, + "fullDescription": { + "text": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions. Example: 'myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings'", + "markdown": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions.\n\n**Example:**\n\n\n myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "YAMLIncompatibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLUnresolvedAlias", + "shortDescription": { + "text": "Unresolved alias" + }, + "fullDescription": { + "text": "Reports unresolved aliases in YAML files. Example: 'some_key: *unknown_alias'", + "markdown": "Reports unresolved aliases in YAML files.\n\n**Example:**\n\n\n some_key: *unknown_alias\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "YAMLUnresolvedAlias", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLDuplicatedKeys", + "shortDescription": { + "text": "Duplicated YAML keys" + }, + "fullDescription": { + "text": "Reports duplicated keys in YAML files. Example: 'same_key: some value\n same_key: another value'", + "markdown": "Reports duplicated keys in YAML files.\n\n**Example:**\n\n\n same_key: some value\n same_key: another value\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "YAMLDuplicatedKeys", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLSchemaValidation", + "shortDescription": { + "text": "Validation by JSON Schema" + }, + "fullDescription": { + "text": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified. Scheme example: '{\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeNumberProperty: hello world'", + "markdown": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified.\n\n**Scheme example:**\n\n\n {\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeNumberProperty: hello world\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "YAMLSchemaValidation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLSchemaDeprecation", + "shortDescription": { + "text": "Deprecated YAML key" + }, + "fullDescription": { + "text": "Reports deprecated keys in YAML files. Deprecation is checked only if there exists a JSON schema associated with the corresponding YAML file. Note that the deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard 'deprecationMessage' extension. Scheme deprecation example: '{\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeDeprecatedProperty: some value'", + "markdown": "Reports deprecated keys in YAML files.\n\nDeprecation is checked only if there exists a JSON schema associated with the corresponding YAML file.\n\nNote that the deprecation mechanism is not defined in the JSON Schema specification yet,\nand this inspection uses a non-standard `deprecationMessage` extension.\n\n**Scheme deprecation example:**\n\n\n {\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeDeprecatedProperty: some value\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "YAMLSchemaDeprecation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLRecursiveAlias", + "shortDescription": { + "text": "Recursive alias" + }, + "fullDescription": { + "text": "Reports recursion in YAML aliases. Alias can't be recursive and be used inside the data referenced by a corresponding anchor. Example: 'some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor'", + "markdown": "Reports recursion in YAML aliases.\n\nAlias can't be recursive and be used inside the data referenced by a corresponding anchor.\n\n**Example:**\n\n\n some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "YAMLRecursiveAlias", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "YAMLUnusedAnchor", + "shortDescription": { + "text": "Unused anchor" + }, + "fullDescription": { + "text": "Reports unused anchors. Example: 'some_key: &some_anchor\n key1: value1'", + "markdown": "Reports unused anchors.\n\n**Example:**\n\n\n some_key: &some_anchor\n key1: value1\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "YAMLUnusedAnchor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "YAML", + "index": 95, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "intellij.webpack", + "version": "243.24609", + "rules": [ + { + "id": "WebpackConfigHighlighting", + "shortDescription": { + "text": "Webpack config compliance with JSON Schema" + }, + "fullDescription": { + "text": "Validates options in webpack config files (which name should start with `webpack`, e.g. `webpack.config.js`) against webpack options schema. Disable this inspection to turn off validation and code completion inside the configuration object.", + "markdown": "Validates options in webpack config files (which name should start with \\`webpack\\`, e.g. \\`webpack.config.js\\`) against [webpack options schema](https://github.com/webpack/webpack/blob/master/schemas/WebpackOptions.json). \n\nDisable this inspection to turn off validation and code completion inside the configuration object." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WebpackConfigHighlighting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/General", + "index": 17, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.plugins.dependencyAnalysis", + "version": "243.24609", + "rules": [ + { + "id": "CheckDependencyLicenses", + "shortDescription": { + "text": "Check dependency licenses" + }, + "fullDescription": { + "text": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues", + "markdown": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CheckDependencyLicenses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dependency analysis", + "index": 105, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckThirdPartySoftwareList", + "shortDescription": { + "text": "Check third party software list" + }, + "fullDescription": { + "text": "Check project for possible problems: user's third party software list does not match the collected project metadata", + "markdown": "Check project for possible problems: user's third party software list does not match the collected project metadata" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckThirdPartySoftwareList", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dependency analysis", + "index": 105, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckModuleLicenses", + "shortDescription": { + "text": "Check module licenses" + }, + "fullDescription": { + "text": "Check module licenses for possible problems: missing licenses or other compliance issues", + "markdown": "Check module licenses for possible problems: missing licenses or other compliance issues" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckModuleLicenses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dependency analysis", + "index": 105, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.grpc", + "version": "243.24609", + "rules": [ + { + "id": "GrpcSchemes", + "shortDescription": { + "text": "GRPC request schema can be substituted or omitted" + }, + "fullDescription": { + "text": "Reports unnecessary `grpc` or standard `http[s]` schemes usage in gRPC requests Example requests: '# `grpc` scheme may be omitted since insecure connection is assumed by default\nGRPC grpc://localhost/TestService/testRpc' '# `http` scheme may be omitted: prefer empty scheme for insecure connection and a dedicated `grpcs` scheme for a secure one\nGRPC http://localhost/TestService/testRpc' '# `https` scheme should be replaced by `grpcs`: prefer a dedicated `grpcs` scheme to indicate that transport layer security should be enabled to execute the request\nGRPC https://localhost/TestService/testRpc' To avoid confusion, it is recommended to use dedicated `grpcs` scheme in a gRPC request, when the request should use secure channel underneath. Otherwise, the scheme might be completely omitted", + "markdown": "Reports unnecessary \\`grpc\\` or standard \\`http\\[s\\]\\` schemes usage in gRPC requests\n\n\nExample requests:\n\n\n # `grpc` scheme may be omitted since insecure connection is assumed by default\n GRPC grpc://localhost/TestService/testRpc\n\n\n # `http` scheme may be omitted: prefer empty scheme for insecure connection and a dedicated `grpcs` scheme for a secure one\n GRPC http://localhost/TestService/testRpc\n\n\n # `https` scheme should be replaced by `grpcs`: prefer a dedicated `grpcs` scheme to indicate that transport layer security should be enabled to execute the request\n GRPC https://localhost/TestService/testRpc\n\n\nTo avoid confusion, it is recommended to use dedicated \\`grpcs\\` scheme in a gRPC request, when the request should use secure channel\nunderneath. Otherwise, the scheme might be completely omitted" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrpcSchemes", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Inappropriate gRPC request scheme", + "index": 106, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.jetbrains.sh", + "version": "243.24609", + "rules": [ + { + "id": "ShellCheck", + "shortDescription": { + "text": "ShellCheck" + }, + "fullDescription": { + "text": "Reports shell script bugs detected by the integrated ShellCheck static analysis tool.", + "markdown": "Reports shell script bugs detected by the integrated [ShellCheck](https://github.com/koalaman/shellcheck) static analysis tool." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ShellCheck", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Shell script", + "index": 111, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.less", + "version": "243.24609", + "rules": [ + { + "id": "LessResolvedByNameOnly", + "shortDescription": { + "text": "Missing import" + }, + "fullDescription": { + "text": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly imported in the current file. Example: '* {\n margin: @var-in-other-file;\n}'", + "markdown": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly [imported](http://lesscss.org/features/#import-atrules-feature) in the current file.\n\n**Example:**\n\n\n * {\n margin: @var-in-other-file;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LessResolvedByNameOnly", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Less", + "index": 121, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LessUnresolvedVariable", + "shortDescription": { + "text": "Unresolved variable" + }, + "fullDescription": { + "text": "Reports a reference to a Less variable that is not resolved. Example: '* {\n margin: @unknown-var;\n}'", + "markdown": "Reports a reference to a [Less variable](http://lesscss.org/features/#variables-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n margin: @unknown-var;\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LessUnresolvedVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Less", + "index": 121, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LessUnresolvedMixin", + "shortDescription": { + "text": "Unresolved mixin" + }, + "fullDescription": { + "text": "Reports a reference to a Less mixin that is not resolved. Example: '* {\n .unknown-mixin();\n}'", + "markdown": "Reports a reference to a [Less mixin](http://lesscss.org/features/#mixins-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n .unknown-mixin();\n }\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LessUnresolvedMixin", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Less", + "index": 121, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "tanvd.grazi", + "version": "243.24609", + "rules": [ + { + "id": "LanguageDetectionInspection", + "shortDescription": { + "text": "Natural language detection" + }, + "fullDescription": { + "text": "Detects natural languages and suggests enabling corresponding grammar and spelling checks.", + "markdown": "Detects natural languages and suggests enabling corresponding grammar and spelling checks." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LanguageDetectionInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Proofreading", + "index": 122, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrazieInspection", + "shortDescription": { + "text": "Grammar" + }, + "fullDescription": { + "text": "Reports grammar mistakes in your text. You can configure the inspection in Settings | Editor | Natural Languages | Grammar and Style.", + "markdown": "Reports grammar mistakes in your text. You can configure the inspection in [Settings \\| Editor \\| Natural Languages \\| Grammar and Style](settings://reference.settingsdialog.project.grazie)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrazieInspection", + "ideaSeverity": "GRAMMAR_ERROR", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Proofreading", + "index": 122, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.jetbrains.rider-cpp", + "version": "243.24609", + "rules": [ + { + "id": "UnrealJsonLocalInspectionTool", + "shortDescription": { + "text": "Unreal Engine json inspection" + }, + "fullDescription": { + "text": "RIDER-83134", + "markdown": "[RIDER-83134](https://youtrack.jetbrains.com/issue/RIDER-83134/)" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnrealJsonLocalInspectionTool", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Unreal Engine", + "index": 126, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.stylelint", + "version": "243.24609", + "rules": [ + { + "id": "Stylelint", + "shortDescription": { + "text": "Stylelint" + }, + "fullDescription": { + "text": "Reports a discrepancy detected by the Stylelint linter. The highlighting is based on the rule severity specified in the Stylelint configuration file for each individual rule.", + "markdown": "Reports a discrepancy detected by the [Stylelint](http://stylelint.io) linter. \n\nThe highlighting is based on the rule severity specified in the [Stylelint configuration file](https://stylelint.io/user-guide/configure) for each individual rule." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Stylelint", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Code quality tools", + "index": 129, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.hardcodedPasswords", + "version": "243.24609", + "rules": [ + { + "id": "HardcodedPasswords", + "shortDescription": { + "text": "Hardcoded passwords" + }, + "fullDescription": { + "text": "Detects potential security tokens or passwords in comments using entropy analysis and regular expressions. This inspection utilizes entropy analysis and regular expressions to scan the codebase for strings that resemble security tokens or passwords. It highlights these findings, helping developers identify and secure potential vulnerabilities. The inspection's effectiveness relies on the patterns defined in its configuration, making it adaptable to different coding environments and requirements. '// Example of a regular expression pattern used for detection:\n/[0-9]+:AA[0-9A-Za-z\\-_]{33}/' Text after this comment will only be shown in the settings of the inspection.", + "markdown": "Detects potential security tokens or passwords in comments using entropy analysis and regular expressions.\n\n\nThis inspection utilizes entropy analysis and regular expressions to scan the codebase for strings that resemble security tokens or\npasswords. It highlights these findings, helping developers identify and secure potential vulnerabilities. The inspection's effectiveness\nrelies on the patterns defined in its configuration, making it adaptable to different coding environments and requirements.\n\n\n // Example of a regular expression pattern used for detection:\n /[0-9]+:AA[0-9A-Za-z\\-_]{33}/\n\nText after this comment will only be shown in the settings of the inspection." + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "HardcodedPasswords", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Security", + "index": 131, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "Karma", + "version": "243.24609", + "rules": [ + { + "id": "KarmaConfigFile", + "shortDescription": { + "text": "Invalid Karma configuration file" + }, + "fullDescription": { + "text": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, 'karma.conf.js'.", + "markdown": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, `karma.conf.js`." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KarmaConfigFile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Unit testing", + "index": 140, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.jetbrains.plugins.ini4idea", + "version": "243.24609", + "rules": [ + { + "id": "DuplicateSectionInFile", + "shortDescription": { + "text": "Duplicate section in file" + }, + "fullDescription": { + "text": "Reports duplicate sections in the 'ini' file.", + "markdown": "Reports duplicate sections in the `ini` file." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateSectionInFile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Ini files", + "index": 147, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateKeyInSection", + "shortDescription": { + "text": "Duplicate directive in section" + }, + "fullDescription": { + "text": "Reports duplicate properties in the 'ini' file section.", + "markdown": "Reports duplicate properties in the `ini` file section." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateKeyInSection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Ini files", + "index": 147, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "tslint", + "version": "243.24609", + "rules": [ + { + "id": "TsLint", + "shortDescription": { + "text": "TSLint" + }, + "fullDescription": { + "text": "Reports a discrepancy detected by the TSLint linter. The highlighting is based on the rule severity specified in the TSLint configuration file for each individual rule. Clear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all TSLint rules.", + "markdown": "Reports a discrepancy detected by the [TSLint](https://github.com/palantir/tslint) linter. \n\nThe highlighting is based on the rule severity specified in the [TSLint configuration file](https://palantir.github.io/tslint/usage/configuration/) for each individual rule. \n\nClear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all TSLint rules." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TsLint", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JavaScript and TypeScript/Code quality tools", + "index": 69, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.intelliLang", + "version": "243.24609", + "rules": [ + { + "id": "InjectedReferences", + "shortDescription": { + "text": "Injected references" + }, + "fullDescription": { + "text": "Reports unresolved references injected by Language Injections. Example: '@Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist'", + "markdown": "Reports unresolved references injected by [Language Injections](https://www.jetbrains.com/help/idea/using-language-injections.html).\n\nExample:\n\n\n @Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist\n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InjectedReferences", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 46, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "W3Validators", + "version": "243.24609", + "rules": [ + { + "id": "W3CssValidation", + "shortDescription": { + "text": "W3C CSS validator" + }, + "fullDescription": { + "text": "Reports a discrepancy detected by the W3C CSS Validator.", + "markdown": "Reports a discrepancy detected by the [W3C CSS Validator](https://jigsaw.w3.org/css-validator/)." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "W3CssValidation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "CSS/Code quality tools", + "index": 129, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.docker.gateway", + "version": "243.24609", + "rules": [ + { + "id": "DevContainerIdeSettings", + "shortDescription": { + "text": "Validate IDE settings" + }, + "fullDescription": { + "text": "No description available", + "markdown": "No description available" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "DevContainerIdeSettings", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Dev Container", + "index": 153, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.plugins.watcher", + "version": "243.24609", + "rules": [ + { + "id": "TaskProblemsInspection", + "shortDescription": { + "text": "File watcher problems" + }, + "fullDescription": { + "text": "Reports an error detected by the output filters from a File Watcher. A File Watcher tracks changes in files and executes the configured command when a change is detected.", + "markdown": "Reports an error detected by the output filters from a File Watcher.\n\n\nA File Watcher tracks changes in files and executes the configured command when a change is detected." + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TaskProblemsInspection", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "File Watchers", + "index": 154, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "idea.plugin.protoeditor", + "version": "243.24609", + "rules": [ + { + "id": "PbDuplicatedImports", + "shortDescription": { + "text": "Duplicated import statements" + }, + "fullDescription": { + "text": "Reports effectively equivalent import statements.", + "markdown": "Reports effectively equivalent import statements." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PbDuplicatedImports", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Protocol Buffers", + "index": 164, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.dmarcotte.handlebars", + "version": "243.24609", + "rules": [ + { + "id": "HbEmptyBlock", + "shortDescription": { + "text": "Missing block helper argument" + }, + "fullDescription": { + "text": "Reports an 'if', 'each', or 'with' block helper without an argument.", + "markdown": "Reports an `if`, `each`, or `with` block helper without an argument." + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HbEmptyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Handlebars_Mustache", + "index": 170, + "toolComponent": { + "name": "QDNET" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + } + ] + }, + "invocations": [ + { + "startTimeUtc": "2025-04-24T18:33:18.94655429Z", + "exitCode": 0, + "executionSuccessful": true + } + ], + "language": "en-US", + "versionControlProvenance": [ + { + "repositoryUri": "https://github.com/GitTools/GitVersion.git", + "revisionId": "552cd5839f9b4ff25dac4f1f549e77668fc417ef", + "branch": "feature/qodana-fixes", + "properties": { + "repoUrl": "https://github.com/GitTools/GitVersion.git", + "lastAuthorName": "Artur Stolear", + "vcsType": "Git", + "lastAuthorEmail": "artur.stolear@gmail.com" + } + } + ], + "results": [ + { + "ruleId": "ChangeFieldTypeToSystemThreadingLock", + "kind": "fail", + "level": "note", + "message": { + "text": "Consider changing the type of 'LockObject' field to 'System.Threading.Lock' to express field intent", + "markdown": "Consider changing the type of 'LockObject' field to 'System.Threading.Lock' to express field intent" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Testing/Helpers/ProcessHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 29, + "charOffset": 210, + "charLength": 6, + "snippet": { + "text": "object" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 138, + "charLength": 202, + "snippet": { + "text": "public static partial class ProcessHelper\n{\n private static readonly object LockObject = new();\n\n // http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/f6069441-4ab1-4299-ad6a-b8bb9ed36be3" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "243d981fb6eb8384", + "equalIndicator/v1": "9ce8c7e55a736d0868c40b5038a5e84f48bbfca14180ebd2b27ecc4545156d01" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "ChangeFieldTypeToSystemThreadingLock", + "kind": "fail", + "level": "note", + "message": { + "text": "Consider changing the type of 'locker' field to 'System.Threading.Lock' to express field intent", + "markdown": "Consider changing the type of 'locker' field to 'System.Threading.Lock' to express field intent" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Logging/ConsoleAppender.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 5, + "startColumn": 22, + "charOffset": 100, + "charLength": 6, + "snippet": { + "text": "object" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 3, + "startColumn": 1, + "charOffset": 31, + "charLength": 192, + "snippet": { + "text": "internal class ConsoleAppender : ILogAppender\n{\n private readonly object locker = new();\n private readonly Dictionary palettes = CreatePalette();\n" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "8ce2b8bdd4789fd5", + "equalIndicator/v1": "fc85c07d08f54a93d98b43b199f1cfa9eaf5c4a71280a3912014a923b81d4232" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 9.0" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 173, + "startColumn": 1, + "charOffset": 6763, + "charLength": 56, + "snippet": { + "text": "resharper_unused_method_return_value_global_highlighting" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 171, + "startColumn": 1, + "charOffset": 6695, + "charLength": 131, + "snippet": { + "text": "resharper_unused_auto_property_accessor_global_highlighting = none\n\nresharper_unused_method_return_value_global_highlighting = none" + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f6fe51c359b54477", + "equalIndicator/v1": "8551ac8f1f5694db3b26e53bd40fcd09a79b4bbd2f22850569575210dd66333d" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 162, + "startColumn": 1, + "charOffset": 6452, + "charLength": 34, + "snippet": { + "text": "dotnet_diagnostic.RCS1037.severity" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 160, + "startColumn": 1, + "charOffset": 6411, + "charLength": 124, + "snippet": { + "text": "\n# RCS1037: Remove trailing white-space.\ndotnet_diagnostic.RCS1037.severity = error\n\n# RCS1036: Remove redundant empty line." + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "002dbf3d5be336ee", + "equalIndicator/v1": "88845b091d5e4987ce1aec8a2d940e7d27f9a2464a89ccaca2d0af10b55bfb0c" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 167, + "startColumn": 1, + "charOffset": 6580, + "charLength": 29, + "snippet": { + "text": "xml_space_before_self_closing" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 165, + "startColumn": 1, + "charOffset": 6536, + "charLength": 157, + "snippet": { + "text": "dotnet_diagnostic.RCS1036.severity = error\n\nxml_space_before_self_closing = true\n\nresharper_arrange_object_creation_when_type_not_evident_highlighting = none" + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1d2dff93b57079ac", + "equalIndicator/v1": "98c80a441f9ef5edf0b3cce3fe31ba0fca1fee2378ffe4035a40c1a7b30c70c5" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 159, + "startColumn": 1, + "charOffset": 6366, + "charLength": 34, + "snippet": { + "text": "dotnet_diagnostic.IDE0005.severity" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 157, + "startColumn": 1, + "charOffset": 6322, + "charLength": 129, + "snippet": { + "text": "\n# IDE0005: Using directive is unnecessary.\ndotnet_diagnostic.IDE0005.severity = warning\n\n# RCS1037: Remove trailing white-space." + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e19c8ddf75f7decc", + "equalIndicator/v1": "b44a286683a4904208a57ff03b1e0ab0f822c6daab929bdf2994a42050a7f98d" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 169, + "startColumn": 1, + "charOffset": 6618, + "charLength": 68, + "snippet": { + "text": "resharper_arrange_object_creation_when_type_not_evident_highlighting" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 167, + "startColumn": 1, + "charOffset": 6580, + "charLength": 181, + "snippet": { + "text": "xml_space_before_self_closing = true\n\nresharper_arrange_object_creation_when_type_not_evident_highlighting = none\n\nresharper_unused_auto_property_accessor_global_highlighting = none" + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "777afc2fdb959232", + "equalIndicator/v1": "baef58ab287e0df1579468dec06220869bb62969dad314e065aeb1d8b865605e" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 165, + "startColumn": 1, + "charOffset": 6536, + "charLength": 34, + "snippet": { + "text": "dotnet_diagnostic.RCS1036.severity" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 163, + "startColumn": 1, + "charOffset": 6495, + "charLength": 121, + "snippet": { + "text": "\n# RCS1036: Remove redundant empty line.\ndotnet_diagnostic.RCS1036.severity = error\n\nxml_space_before_self_closing = true" + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "36e32bd3acbfb8d3", + "equalIndicator/v1": "df48f45afbdbddbe9a7a8de2fa6dc2a40f9932e4ed4d629f5dfb15e4c353c702" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "EditorConfigKeyCorrectness", + "kind": "fail", + "level": "warning", + "message": { + "text": "The property is not supported", + "markdown": "The property is not supported" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "../.editorconfig", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 171, + "startColumn": 1, + "charOffset": 6695, + "charLength": 59, + "snippet": { + "text": "resharper_unused_auto_property_accessor_global_highlighting" + }, + "sourceLanguage": "EditorConfig" + }, + "contextRegion": { + "startLine": 169, + "startColumn": 1, + "charOffset": 6618, + "charLength": 208, + "snippet": { + "text": "resharper_arrange_object_creation_when_type_not_evident_highlighting = none\n\nresharper_unused_auto_property_accessor_global_highlighting = none\n\nresharper_unused_method_return_value_global_highlighting = none" + }, + "sourceLanguage": "EditorConfig" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "rider.module", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1b9f756ea618b3a1", + "equalIndicator/v1": "f4dedbf8e985341cdfaa2ad6304d0d02419a65ce14c2ad3426df8c33dee1d38d" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "EditorConfig" + ] + } + }, + { + "ruleId": "UnusedType.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Class 'IgnoreConfigurationBuilder' is never used (except inside its declaration)", + "markdown": "Class 'IgnoreConfigurationBuilder' is never used (except inside its declaration)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 3, + "startColumn": 23, + "charOffset": 59, + "charLength": 26, + "snippet": { + "text": "IgnoreConfigurationBuilder" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 146, + "snippet": { + "text": "namespace GitVersion.Configuration;\n\ninternal sealed class IgnoreConfigurationBuilder\n{\n public static IgnoreConfigurationBuilder New => new();" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "25a2ace762dfb00f", + "equalIndicator/v1": "15d42fca64552bc8aff310e634bee6a2b9146fc9dfb8eb5f3b15593287d2233b" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "UnusedType.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Class 'TaggedCommitVersionStrategy' is never used", + "markdown": "Class 'TaggedCommitVersionStrategy' is never used" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/VersionCalculation/VersionSearchStrategies/TaggedCommitVersionStrategy.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 13, + "startColumn": 23, + "charOffset": 409, + "charLength": 27, + "snippet": { + "text": "TaggedCommitVersionStrategy" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 11, + "startColumn": 1, + "charOffset": 319, + "charLength": 173, + "snippet": { + "text": "/// Increments if the tag is not the current commit.\n/// \ninternal sealed class TaggedCommitVersionStrategy(\n ILog log,\n Lazy contextLazy," + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d967b3fae2f6c018", + "equalIndicator/v1": "2df185ac94ad6c05efc2fb1b76cd20af362ffd450a47b703bb7dc4d31038aecf" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "UnusedType.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Class 'TrackReleaseBranchesVersionStrategy' is never used", + "markdown": "Class 'TrackReleaseBranchesVersionStrategy' is never used" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/VersionCalculation/VersionSearchStrategies/TrackReleaseBranchesVersionStrategy.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 23, + "charOffset": 235, + "charLength": 35, + "snippet": { + "text": "TrackReleaseBranchesVersionStrategy" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 171, + "charLength": 179, + "snippet": { + "text": "namespace GitVersion.VersionCalculation;\n\ninternal sealed class TrackReleaseBranchesVersionStrategy(\n Lazy contextLazy,\n IRepositoryStore repositoryStore," + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b4f244eb64615685", + "equalIndicator/v1": "b63af6c15c019a9c52843e65463894bda0c76e2ebfb309105acccc5db97bedb4" + }, + "baselineState": "unchanged", + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault", + "kind": "fail", + "level": "note", + "message": { + "text": "Some values of the enum are not processed inside switch: Inherit", + "markdown": "Some values of the enum are not processed inside switch: Inherit" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Extensions/IncrementStrategyExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 5, + "startColumn": 92, + "charOffset": 175, + "charLength": 6, + "snippet": { + "text": "switch" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 3, + "startColumn": 1, + "charOffset": 34, + "charLength": 206, + "snippet": { + "text": "public static class IncrementStrategyExtensions\n{\n public static VersionField ToVersionField(this IncrementStrategy strategy) => strategy switch\n {\n IncrementStrategy.None => VersionField.None," + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1ac30133f4a78181", + "equalIndicator/v1": "9be1d124e5d238645ce52708262f518ad3f9f4177c6a2da2044e3143590df0db" + }, + "baselineState": "new", + "properties": { + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + } + ], + "automationDetails": { + "id": "GitVersion/qodana/2025-04-24", + "guid": "cc99868b-5843-4366-856f-fdd3074dad26", + "properties": { + "jobUrl": "https://github.com/GitTools/GitVersion/actions/runs/14649015427", + "analysisKind": "regular" + } + }, + "newlineSequences": [ + "\r\n", + "\n" + ], + "properties": { + "qodana.promo.results": [ + { + "ruleId": "AutoPropertyCanBeMadeGetOnly.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Auto-property can be made get-only", + "markdown": "Auto-property can be made get-only" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 17, + "startColumn": 31, + "charOffset": 633, + "charLength": 5, + "snippet": { + "text": "init;" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 15, + "startColumn": 1, + "charOffset": 561, + "charLength": 119, + "snippet": { + "text": " new(x => x.Name, x => x.Number);\n\n public string Name { get; init; }\n\n public long? Number { get; init; }" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "39b1096331f5a6c8", + "equalIndicator/v1": "07a7b31b43b99bfe0c26afff61e4b0f77109d932a5cdc8f28e9061154276c7b6" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "AutoPropertyCanBeMadeGetOnly.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Auto-property can be made get-only", + "markdown": "Auto-property can be made get-only" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 14, + "startColumn": 44, + "charOffset": 335, + "charLength": 14, + "snippet": { + "text": "internal init;" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 12, + "startColumn": 1, + "charOffset": 276, + "charLength": 97, + "snippet": { + "text": "\n [Required]\n public ITaskItem[] CompileFiles { get; internal init; } = [];\n\n [Required]" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b9242d297fc3a345", + "equalIndicator/v1": "5ac45d68c9deae77a0676e6f36c18fe17b6d8a1261a8d8301018251345a9c3d7" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "AutoPropertyCanBeMadeGetOnly.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Auto-property can be made get-only", + "markdown": "Auto-property can be made get-only" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 31, + "startColumn": 43, + "charOffset": 894, + "charLength": 5, + "snippet": { + "text": "init;" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 29, + "startColumn": 1, + "charOffset": 794, + "charLength": 150, + "snippet": { + "text": " public long CommitsSinceVersionSource { get; init; }\n\n public long UncommittedChanges { get; init; }\n\n public SemanticVersionBuildMetaData()" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "945534524a3ecb00", + "equalIndicator/v1": "963653db6db79949c03af1d532a9e55bc25bff64c3ebae3928847676f6cbee01" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "AutoPropertyCanBeMadeGetOnly.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Auto-property can be made get-only", + "markdown": "Auto-property can be made get-only" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 21, + "startColumn": 52, + "charOffset": 733, + "charLength": 5, + "snippet": { + "text": "init;" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 19, + "startColumn": 1, + "charOffset": 642, + "charLength": 165, + "snippet": { + "text": " public long? Number { get; init; }\n\n public bool PromoteTagEvenIfNameIsEmpty { get; init; }\n\n public SemanticVersionPreReleaseTag() => Name = string.Empty;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b1e31eb5a46c5488", + "equalIndicator/v1": "f2380853e2e0a368b92041f47e42e69ff59b1ab8276af3e4c6d7876e721e903e" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "CA1822", + "kind": "fail", + "level": "note", + "message": { + "text": "Member 'FromJson' does not access instance data and can be marked as static", + "markdown": "Member 'FromJson' does not access instance data and can be marked as static" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Output/Serializer/VersionVariableSerializer.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 32, + "charOffset": 285, + "charLength": 8, + "snippet": { + "text": "FromJson" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 158, + "charLength": 210, + "snippet": { + "text": "internal class VersionVariableSerializer(IFileSystem fileSystem) : IVersionVariableSerializer\n{\n public GitVersionVariables FromJson(string json)\n {\n var serializeOptions = JsonSerializerOptions();" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Output", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f5b3f2f4c3239efc", + "equalIndicator/v1": "1200334ba035fbe3aa0c822c791d74b4c1ba606802c21aca6551b04f37a0d2a9" + }, + "properties": { + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeMadeStatic.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'FromJson' can be made static", + "markdown": "Method 'FromJson' can be made static" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Output/Serializer/VersionVariableSerializer.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 32, + "charOffset": 285, + "charLength": 8, + "snippet": { + "text": "FromJson" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 158, + "charLength": 210, + "snippet": { + "text": "internal class VersionVariableSerializer(IFileSystem fileSystem) : IVersionVariableSerializer\n{\n public GitVersionVariables FromJson(string json)\n {\n var serializeOptions = JsonSerializerOptions();" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Output", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d0162cfd80034eca", + "equalIndicator/v1": "73e075508fa3cbc3c31932c3d8f6071e21c10a5115a1398bb75174d763537d46" + }, + "properties": { + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'GetBranchSpecificLabel' can be made private", + "markdown": "Method 'GetBranchSpecificLabel' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Extensions/ConfigurationExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 80, + "startColumn": 5, + "charOffset": 3601, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 78, + "startColumn": 1, + "charOffset": 3500, + "charLength": 251, + "snippet": { + "text": " => GetBranchSpecificLabel(configuration, branchName.WithoutOrigin, branchNameOverride);\n\n public static string? GetBranchSpecificLabel(\n this EffectiveConfiguration configuration, string? branchName, string? branchNameOverride)\n {" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "3fa24d0f0642f9f7", + "equalIndicator/v1": "07f27f91c4ae9f1e135bc1acf3fdc7a6e27e5cc17691d895c26651ee7919b5ac" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithUpdateBuildNumber' can be made private", + "markdown": "Method 'WithUpdateBuildNumber' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 193, + "startColumn": 5, + "charOffset": 6597, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 191, + "startColumn": 1, + "charOffset": 6586, + "charLength": 119, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithUpdateBuildNumber(bool value)\n {\n this.updateBuildNumber = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f4cdb250e446d78c", + "equalIndicator/v1": "162dc3f8ebaf56ace070dc004cdb6c7aef4f713e104e8acf36ec6d4840918519" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithPreventIncrementOfMergedBranch' can be made private", + "markdown": "Method 'WithPreventIncrementOfMergedBranch' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 260, + "startColumn": 5, + "charOffset": 8891, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 258, + "startColumn": 1, + "charOffset": 8880, + "charLength": 146, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithPreventIncrementOfMergedBranch(bool? value)\n {\n this.preventIncrementOfMergedBranch = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a438203fe493332f", + "equalIndicator/v1": "17501f1b3cb4687f5bf4871cd3cee6f28a0fb9277cee5c439001d9f564e3a130" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'IsLabeledWith' can be made private", + "markdown": "Method 'IsLabeledWith' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersion.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 24, + "startColumn": 5, + "charOffset": 623, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 22, + "startColumn": 1, + "charOffset": 549, + "charLength": 246, + "snippet": { + "text": " public SemanticVersionBuildMetaData BuildMetaData { get; init; }\n\n public bool IsLabeledWith(string value) => PreReleaseTag.HasTag() && PreReleaseTag.Name.IsEquivalentTo(value);\n\n public bool IsMatchForBranchSpecificLabel(string? value)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a204ee13475fb9ad", + "equalIndicator/v1": "1a1388cf56fd9986badb2156d80a3858fa545384a3e7b13b71eeb4519ebcdb4a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithNoBumpMessage' can be made private", + "markdown": "Method 'WithNoBumpMessage' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 169, + "startColumn": 5, + "charOffset": 5913, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 167, + "startColumn": 1, + "charOffset": 5902, + "charLength": 114, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithNoBumpMessage(string? value)\n {\n this.noBumpMessage = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "53f8f91c63188b63", + "equalIndicator/v1": "1d04599576977cee54240cb129d4b3b7e3d60d038e1e913fa0b7fe1e6e3d9409" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'ToString' can be made private", + "markdown": "Method 'ToString' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 105, + "startColumn": 5, + "charOffset": 4019, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 103, + "startColumn": 1, + "charOffset": 3958, + "charLength": 166, + "snippet": { + "text": " public override string ToString() => ToString(\"t\");\n\n public string ToString(string format) => ToString(format, CultureInfo.CurrentCulture);\n\n /// " + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "306f43e59749c8c7", + "equalIndicator/v1": "1e655491f52cd8d75af8440cfe48b2d777ca6fa88da809b6ea67c61e8bad258c" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Property 'Context' can be made private", + "markdown": "Property 'Context' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 15, + "startColumn": 5, + "charOffset": 509, + "charLength": 9, + "snippet": { + "text": "protected" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 13, + "startColumn": 1, + "charOffset": 416, + "charLength": 257, + "snippet": { + "text": " private readonly Lazy versionContext = versionContext.NotNull();\n\n protected GitVersionContext Context => this.versionContext.Value;\n\n protected SemanticVersionBuildMetaData CreateVersionBuildMetaData(ICommit? baseVersionSource)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "edfbdbeba3db16ef", + "equalIndicator/v1": "25413b6464d5050748f884f073d7dd63c750b68d47aba1fb4936a3946f013179" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'DumpGraph' can be made private", + "markdown": "Method 'DumpGraph' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 65, + "startColumn": 5, + "charOffset": 2479, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 63, + "startColumn": 1, + "charOffset": 2415, + "charLength": 254, + "snippet": { + "text": " => DumpGraph(repository.Path, writer, maxCommits);\n\n public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null)\n => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits);\n" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild.Tests", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f66041ca3f62af8b", + "equalIndicator/v1": "3cec01000c68144291c9e0f834ba4490e64a85767ef5b82b2fdc29cdf41f8406" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'CompareTo' can be made private", + "markdown": "Method 'CompareTo' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersion.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 221, + "startColumn": 5, + "charOffset": 7523, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 219, + "startColumn": 1, + "charOffset": 7423, + "charLength": 201, + "snippet": { + "text": " public int CompareTo(SemanticVersion? value) => CompareTo(value, includePreRelease: true);\n\n public int CompareTo(SemanticVersion? value, bool includePreRelease)\n {\n if (value == null)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "dc198b8584f3d313", + "equalIndicator/v1": "59ffba36bf2f386e1e0d7b4bc0aaab48fabaa6d4afb5965b1cb95fef23992adc" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'GetCurrentDirectory' can be made private", + "markdown": "Method 'GetCurrentDirectory' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Helpers/FileSystemHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 74, + "startColumn": 9, + "charOffset": 3205, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 72, + "startColumn": 1, + "charOffset": 3142, + "charLength": 291, + "snippet": { + "text": " : StringComparison.OrdinalIgnoreCase;\n\n public static string GetCurrentDirectory() => AppContext.BaseDirectory ?? throw new InvalidOperationException();\n\n public static string GetTempPathLegacy() => fileSystem.Path.GetTempPath().TrimEnd(DirectorySeparatorChar);" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "54963d95d4a2b1c2", + "equalIndicator/v1": "6732e23188eba6b8c688b733a53c5a6787409739d46b248f42458ac8e747df96" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'GetFullPath' can be made private", + "markdown": "Method 'GetFullPath' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Helpers/FileSystemHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 108, + "startColumn": 9, + "charOffset": 4537, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 106, + "startColumn": 1, + "charOffset": 4432, + "charLength": 258, + "snippet": { + "text": " public static string? GetExtension(string? path) => fileSystem.Path.GetExtension(path);\n\n public static string GetFullPath(string? path) => fileSystem.Path.GetFullPath(path!);\n\n public static string Combine(string? path1, string? path2)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9a5d1a2ad5c4e5b8", + "equalIndicator/v1": "7bd476cf03181321fa398a10395699e96bf050ce5a5ec1162fe7964d43feacb1" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithIsReleaseBranch' can be made private", + "markdown": "Method 'WithIsReleaseBranch' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 308, + "startColumn": 5, + "charOffset": 10357, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 306, + "startColumn": 1, + "charOffset": 10346, + "charLength": 116, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithIsReleaseBranch(bool? value)\n {\n this.isReleaseBranch = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d841d600090e0246", + "equalIndicator/v1": "7c856ca43421ba359bbd8a46382b230df0b206e8b49a4c467035ef80c298b36a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'GetTempPath' can be made private", + "markdown": "Method 'GetTempPath' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Helpers/FileSystemHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 77, + "startColumn": 9, + "charOffset": 3442, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 75, + "startColumn": 1, + "charOffset": 3318, + "charLength": 218, + "snippet": { + "text": "\n public static string GetTempPathLegacy() => fileSystem.Path.GetTempPath().TrimEnd(DirectorySeparatorChar);\n public static string GetTempPath()\n {\n var tempPath = GetCurrentDirectory();" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e9bbe0a232d1f2bb", + "equalIndicator/v1": "81aff2ce6987502feac67c101fd449948663144ad455a51e46285cd218675829" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithRegularExpression' can be made private", + "markdown": "Method 'WithRegularExpression' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 296, + "startColumn": 5, + "charOffset": 10017, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 294, + "startColumn": 1, + "charOffset": 10006, + "charLength": 122, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithRegularExpression(string? value)\n {\n this.regularExpression = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "70211adbe88a21f9", + "equalIndicator/v1": "8697076173547d2573eff685a6e8048b90a53a6f77cb7f4fe749f7533fa3dc72" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithPreventIncrementWhenCurrentCommitTagged' can be made private", + "markdown": "Method 'WithPreventIncrementWhenCurrentCommitTagged' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 272, + "startColumn": 5, + "charOffset": 9277, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 270, + "startColumn": 1, + "charOffset": 9266, + "charLength": 164, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithPreventIncrementWhenCurrentCommitTagged(bool? value)\n {\n this.preventIncrementWhenCurrentCommitTagged = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9fcdeb835eacbafa", + "equalIndicator/v1": "8bed8fd8ed8cd10ae282611bde7cf3db2b2429b2c2094767b8869c59be508a56" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithPreReleaseWeight' can be made private", + "markdown": "Method 'WithPreReleaseWeight' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 320, + "startColumn": 5, + "charOffset": 10673, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 318, + "startColumn": 1, + "charOffset": 10662, + "charLength": 117, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithPreReleaseWeight(int? value)\n {\n this.preReleaseWeight = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "fa34c0dd386ebf63", + "equalIndicator/v1": "8dd744fa23bef7b300485157af43879871db8b2ee29201d3fc0e7ea51081448f" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithTracksReleaseBranches' can be made private", + "markdown": "Method 'WithTracksReleaseBranches' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 302, + "startColumn": 5, + "charOffset": 10184, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 300, + "startColumn": 1, + "charOffset": 10173, + "charLength": 128, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithTracksReleaseBranches(bool? value)\n {\n this.tracksReleaseBranches = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "72e585b50d1d68cd", + "equalIndicator/v1": "8edc4dd166cb4befd91c6b9c0352e5ba4e08dee7b4c14811073693f08fd5c1b3" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithShas' can be made private", + "markdown": "Method 'WithShas' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 29, + "startColumn": 5, + "charOffset": 672, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 27, + "startColumn": 1, + "charOffset": 661, + "charLength": 109, + "snippet": { + "text": " }\n\n public IgnoreConfigurationBuilder WithShas(HashSet value)\n {\n this.shas = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "79d7694be7303156", + "equalIndicator/v1": "9191b831b7a6c97d7f2befa29faf57850e20a6e19d4825d9a7f969ed27bfc28a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithTrackMergeTarget' can be made private", + "markdown": "Method 'WithTrackMergeTarget' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 278, + "startColumn": 5, + "charOffset": 9486, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 276, + "startColumn": 1, + "charOffset": 9475, + "charLength": 118, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithTrackMergeTarget(bool? value)\n {\n this.trackMergeTarget = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "07c819bfc6ae3ff8", + "equalIndicator/v1": "932a115609e38ccdc5b15021ffd491e1dc5465c72c341bd300126021849a5403" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithPreventIncrementWhenBranchMerged' can be made private", + "markdown": "Method 'WithPreventIncrementWhenBranchMerged' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 266, + "startColumn": 5, + "charOffset": 9082, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 264, + "startColumn": 1, + "charOffset": 9071, + "charLength": 150, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value)\n {\n this.preventIncrementWhenBranchMerged = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f8c7df635da2b8ad", + "equalIndicator/v1": "9d1091b9ff2d424c0812ed314a87cfd29c7f6eeecf559efc306e108cc1c4a2ab" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'DiscoverRepository' can be made private", + "markdown": "Method 'DiscoverRepository' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 51, + "startColumn": 5, + "charOffset": 1734, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 49, + "startColumn": 1, + "charOffset": 1723, + "charLength": 149, + "snippet": { + "text": " }\n\n public static void DiscoverRepository(this IServiceProvider sp)\n {\n var gitRepository = sp.GetRequiredService();" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild.Tests", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "3b81dbc907dc82f9", + "equalIndicator/v1": "a4265a9c06bacc2838ccd8059ca6d68eacce0b3e23d5fd78b54e6a812bca24b2" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'GetVersion' can be made private", + "markdown": "Method 'GetVersion' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 68, + "startColumn": 5, + "charOffset": 2674, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 66, + "startColumn": 1, + "charOffset": 2592, + "charLength": 343, + "snippet": { + "text": " => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits);\n\n public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null,\n IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null)\n {" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild.Tests", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "318ac156b1657713", + "equalIndicator/v1": "a4afd1b08385395f0807fd8f3fc04f39d8fc8314a24009a2342a71b99c37769a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Property 'DirectorySeparatorChar' can be made private", + "markdown": "Property 'DirectorySeparatorChar' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Helpers/FileSystemHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 67, + "startColumn": 9, + "charOffset": 2878, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 65, + "startColumn": 1, + "charOffset": 2808, + "charLength": 228, + "snippet": { + "text": " {\n public static string NewLine => SysEnv.NewLine;\n public static char DirectorySeparatorChar => fileSystem.Path.DirectorySeparatorChar;\n\n private static readonly StringComparison OsDependentComparison =" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "47e20dd81572c251", + "equalIndicator/v1": "a4f011d97b4f80ac560ed9ef839d4f3c53a31f9e284590ecb9000c1363ff5b8e" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithAssemblyVersioningFormat' can be made private", + "markdown": "Method 'WithAssemblyVersioningFormat' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 121, + "startColumn": 5, + "charOffset": 4516, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 119, + "startColumn": 1, + "charOffset": 4505, + "charLength": 136, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithAssemblyVersioningFormat(string? value)\n {\n this.assemblyVersioningFormat = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "65ec659931f70250", + "equalIndicator/v1": "a9ff1f6afad5baa1879308d0688fc50f93231148751f22ab0382a727857f2c0c" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Constructor 'SemanticVersionPreReleaseTag' can be made private", + "markdown": "Constructor 'SemanticVersionPreReleaseTag' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 23, + "startColumn": 5, + "charOffset": 746, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 21, + "startColumn": 1, + "charOffset": 682, + "charLength": 227, + "snippet": { + "text": " public bool PromoteTagEvenIfNameIsEmpty { get; init; }\n\n public SemanticVersionPreReleaseTag() => Name = string.Empty;\n\n public SemanticVersionPreReleaseTag(string name, long? number, bool promoteTagEvenIfNameIsEmpty)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "4a42a72507675ee0", + "equalIndicator/v1": "cda0e8d0b89f3b9e17c4a83e1e9316a95447c3eb3c58bef1794d599c5bb8d116" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Property 'PromoteTagEvenIfNameIsEmpty' can be made private", + "markdown": "Property 'PromoteTagEvenIfNameIsEmpty' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 21, + "startColumn": 5, + "charOffset": 686, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 19, + "startColumn": 1, + "charOffset": 642, + "charLength": 165, + "snippet": { + "text": " public long? Number { get; init; }\n\n public bool PromoteTagEvenIfNameIsEmpty { get; init; }\n\n public SemanticVersionPreReleaseTag() => Name = string.Empty;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "304d08da85634319", + "equalIndicator/v1": "ce384c072aedd7cfb73948dda11dcd04749e99d41826a45d7df82e6ad841b651" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Property 'RefSpecs' can be made private", + "markdown": "Property 'RefSpecs' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.LibGit2Sharp/Git/Remote.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 20, + "startColumn": 5, + "charOffset": 720, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 18, + "startColumn": 1, + "charOffset": 668, + "charLength": 107, + "snippet": { + "text": " public string Url => this.innerRemote.Url;\n\n public IEnumerable RefSpecs\n {\n get" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.LibGit2Sharp", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0b42b6fe81d50fee", + "equalIndicator/v1": "d9b036319212323201c50ca1c4b114e7cfd397a81f5cadd17e9763b36e145fec" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithVersionInBranchPattern' can be made private", + "markdown": "Method 'WithVersionInBranchPattern' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 139, + "startColumn": 5, + "charOffset": 5044, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 137, + "startColumn": 1, + "charOffset": 5033, + "charLength": 132, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithVersionInBranchPattern(string? value)\n {\n this.versionInBranchPattern = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "8348fe093daaf082", + "equalIndicator/v1": "da3a2b7bb813af9c8beb4477fcf5c07fc1e5fc4e6d6eeccd8de2e690e3fdeaa7" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'ToGitRepository' can be made private", + "markdown": "Method 'ToGitRepository' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 161, + "startColumn": 5, + "charOffset": 6451, + "charLength": 8, + "snippet": { + "text": "internal" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 159, + "startColumn": 1, + "charOffset": 6440, + "charLength": 154, + "snippet": { + "text": " }\n\n internal static IGitRepository ToGitRepository(this IRepository repository)\n {\n var gitRepository = new GitRepository(new NullLog());" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild.Tests", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "aa5d8e1a3910919c", + "equalIndicator/v1": "de8f75ffee4f641447c9483347e33e7705e4b9ef7d5131112ae2cdd416322ab0" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithIsMainBranch' can be made private", + "markdown": "Method 'WithIsMainBranch' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 314, + "startColumn": 5, + "charOffset": 10518, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 312, + "startColumn": 1, + "charOffset": 10507, + "charLength": 110, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithIsMainBranch(bool? value)\n {\n this.isMainBranch = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0625bb954b3755eb", + "equalIndicator/v1": "e1537a990b34403b4d0d5046b725d803e2a199c4fba0bf04dd25e4ce99f3002b" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'Combine' can be made private", + "markdown": "Method 'Combine' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/Helpers/FileSystemHelper.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 125, + "startColumn": 9, + "charOffset": 5097, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 123, + "startColumn": 1, + "charOffset": 5078, + "charLength": 164, + "snippet": { + "text": " }\n\n public static string Combine(string? path1, string? path2, string? path3)\n {\n ArgumentException.ThrowIfNullOrWhiteSpace(path1);" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Testing", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9efd3542863b65cb", + "equalIndicator/v1": "e8a2e96804c2dd49761635866a90126621007fc0bc2e3d505ebc6fef0f03383c" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithTrackMergeMessage' can be made private", + "markdown": "Method 'WithTrackMergeMessage' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 284, + "startColumn": 5, + "charOffset": 9649, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 282, + "startColumn": 1, + "charOffset": 9638, + "charLength": 120, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithTrackMergeMessage(bool? value)\n {\n this.trackMergeMessage = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c12445c5a92fea37", + "equalIndicator/v1": "fb7a2ab2c07c95d3f2a1c47d6f74f1cc0e45c77007c49f7ea9e387cc7b4ffb8d" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBePrivate.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Field 'repositoryStore' can be made private", + "markdown": "Field 'repositoryStore' can be made private" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 12, + "startColumn": 5, + "charOffset": 335, + "charLength": 9, + "snippet": { + "text": "protected" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 10, + "startColumn": 1, + "charOffset": 280, + "charLength": 224, + "snippet": { + "text": "{\n protected readonly ILog log = log.NotNull();\n protected readonly IRepositoryStore repositoryStore = repositoryStore.NotNull();\n private readonly Lazy versionContext = versionContext.NotNull();\n" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Core", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d774cc88ea0885cc", + "equalIndicator/v1": "fc453f975365798d2caf47bd8a217f79da184734fe3652e261743ccf2cb2fb7c" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithIsSourceBranchFor' can be made protected", + "markdown": "Method 'WithIsSourceBranchFor' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 102, + "startColumn": 5, + "charOffset": 2934, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 100, + "startColumn": 1, + "charOffset": 2923, + "charLength": 152, + "snippet": { + "text": " }\n\n public virtual BranchConfigurationBuilder WithIsSourceBranchFor(IEnumerable values)\n {\n WithIsSourceBranchFor([.. values]);" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "907339a47a48aba5", + "equalIndicator/v1": "26daf9e7e80d3d2b5b915dd59c36b06265526229dc1ce38f2c3d1c54476f930d" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Constant 'MainBranch' can be made protected", + "markdown": "Constant 'MainBranch' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Core.Tests/Helpers/TestBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 5, + "charOffset": 206, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 178, + "charLength": 178, + "snippet": { + "text": "public class TestBase\n{\n public const string MainBranch = \"main\";\n\n protected static IServiceProvider ConfigureServices(Action? overrideServices = null)" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.MsBuild.Tests", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d8605a834ce1f2ec", + "equalIndicator/v1": "36bec50ba3e6870ccade82084537061038c70a64dee81529a4d3f0e1a0f37a8a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithConfiguration' can be made protected", + "markdown": "Method 'WithConfiguration' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 326, + "startColumn": 5, + "charOffset": 10835, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 324, + "startColumn": 1, + "charOffset": 10824, + "charLength": 165, + "snippet": { + "text": " }\n\n public TConfigurationBuilder WithConfiguration(IGitVersionConfiguration value)\n {\n WithAssemblyVersioningScheme(value.AssemblyVersioningScheme);" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "50524bf965a4b8da", + "equalIndicator/v1": "60b9a3ae23943157b539c2d72261df7557fb4ac690984f6a78a697bc179c1db9" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithSourceBranches' can be made protected", + "markdown": "Method 'WithSourceBranches' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 90, + "startColumn": 5, + "charOffset": 2600, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 88, + "startColumn": 1, + "charOffset": 2589, + "charLength": 146, + "snippet": { + "text": " }\n\n public virtual BranchConfigurationBuilder WithSourceBranches(IEnumerable values)\n {\n WithSourceBranches([.. values]);" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "99829247586fa2d8", + "equalIndicator/v1": "9b5933600024cb61754ddb6cf50acd68e820744494fc03e9df4381f5fb2c5dcc" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithPreventIncrementWhenBranchMerged' can be made protected", + "markdown": "Method 'WithPreventIncrementWhenBranchMerged' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 54, + "startColumn": 5, + "charOffset": 1558, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 52, + "startColumn": 1, + "charOffset": 1547, + "charLength": 163, + "snippet": { + "text": " }\n\n public virtual BranchConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value)\n {\n this.preventIncrementWhenBranchMerged = value;" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "71e7d9b29242c60a", + "equalIndicator/v1": "b858e2f3b626a01e808428a2774ff97c1b17fcb757f23f4f64398e392b81dd3e" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + }, + { + "ruleId": "MemberCanBeProtected.Global", + "kind": "fail", + "level": "note", + "message": { + "text": "Method 'WithBranch' can be made protected", + "markdown": "Method 'WithBranch' can be made protected" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 229, + "startColumn": 5, + "charOffset": 7788, + "charLength": 6, + "snippet": { + "text": "public" + }, + "sourceLanguage": "C#" + }, + "contextRegion": { + "startLine": 227, + "startColumn": 1, + "charOffset": 7777, + "charLength": 169, + "snippet": { + "text": " }\n\n public BranchConfigurationBuilder WithBranch(string value)\n => this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New);\n" + }, + "sourceLanguage": "C#" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "GitVersion.Configuration", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "fbde394b0bdaac89", + "equalIndicator/v1": "e8d7c2d9d95e73a87b377c0050c29d16bfae58ce8c8bb67b334a49da873d4650" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "C#", + ".NET 8.0", + ".NET 9.0" + ] + } + } + ], + "configProfile": "starter", + "deviceId": "200820300000000-3e47-7fab-260c-3266c4769609", + "qodanaNewResultSummary": { + "low": 1, + "total": 1 + } + } + } + ] +} \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000000..2e670e81c8 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,120 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# +version: "1.0" +#Specify inspection profile for code analysis +profile: + name: qodana.starter +linter: jetbrains/qodana-cdnet:latest +include: + - name: ConvertIfStatementToReturnStatement + - name: ConvertIfStatementToConditionalTernaryExpression + - name: AutoPropertyCanBeMadeGetOnly + - name: CanReplaceCastWithLambdaReturnType + - name: ChangeFieldTypeToSystemThreadingLock + - name: ConvertIfStatementToSwitchStatement + - name: ConvertToConstant.Local + - name: DuplicatedSequentialIfBodies + - name: InlineTemporaryVariable + - name: InvertIf + - name: UseVerbatimString + - name: MemberCanBePrivate + - name: MemberCanBeProtected + - name: MergeIntoPattern + - name: UnusedMethodReturnValue.Global + - name: EditorConfigNoMatchingFiles + - name: PreferConcreteValueOverDefault + - name: PropertyCanBeMadeInitOnly.Global + - name: MoveLocalFunctionAfterJumpStatement + - name: RedundantExplicitParamsArrayCreation + - name: RedundantOverload.Global + - name: RedundantStringInterpolation + - name: RedundantVerbatimStringPrefix + - name: ReplaceSubstringWithRangeIndexer + - name: RCS1001 + - name: RCS1003 + - name: RCS1123 + - name: SYSLIB1045 + - name: CA1826 + - name: RCS1256 + - name: RCS1118 + - name: RCS1077 + - name: RCS1205 + - name: RCS1214 + - name: RCS1249 + - name: RCS1192 + - name: SYSLIB1054 + - name: CA1512 + - name: CA1866 + - name: CA1859 + - name: RCS1246 + - name: CA1829 + - name: RCS1266 + - name: RCS1267 + - name: RCS1227 + - name: SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault + - name: SwitchStatementHandlesSomeKnownEnumValuesWithDefault + - name: RedundantAlwaysMatchSubpattern + - name: UnusedType.Global + - name: UnusedMemberInSuper.Global + - name: UnusedMember.Local + - name: EditorConfigKeyCorrectness + - name: UseCollectionCountProperty + - name: UseDiscardAssignment + - name: ArrangeNamespaceBody + - name: SuggestDiscardDeclarationVarStyle + - name: ArrangeTrailingCommaInMultilineLists + - name: ArrangeObjectCreationWhenTypeNotEvident + - name: UseRawString + - name: VirtualMemberNeverOverridden.Global + - name: ArrangeVarKeywordsInDeconstructingDeclaration + - name: SuggestVarOrType_BuiltInTypes + +#Enable inspections +#include: +# - name: + +#Disable inspections +exclude: + - name: LoopCanBeConvertedToQuery + - name: ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator + - name: ConvertIfStatementToConditionalTernaryExpression + paths: + - GitVersion.Core.Tests/IntegrationTests/AlignGitFlowWithMainlineVersionStrategy.cs + - GitVersion.Core.Tests/IntegrationTests/AlignGitHubFlowWithMainlineVersionStrategy.cs + - name: MemberCanBeProtected + paths: + - GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs + - GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs + - GitVersion.Core.Tests/Helpers/TestBase.cs + - name: MemberCanBePrivate + paths: + - GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs + - GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs + - GitVersion.Core/Helpers/FileSystemHelper.cs + - GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs + - GitVersion.Core/SemVer/SemanticVersion.cs + - GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs + - GitVersion.Core/Extensions/ConfigurationExtensions.cs + - GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs + - GitVersion.LibGit2Sharp/Git/Remote.cs + - name: AutoPropertyCanBeMadeGetOnly + paths: + - GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs + - GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs + - GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs + - name: UnusedType + paths: + - GitVersion.Core/VersionCalculation/VersionSearchStrategies/TaggedCommitVersionStrategy.cs + - GitVersion.Core/VersionCalculation/VersionSearchStrategies/TrackReleaseBranchesVersionStrategy.cs + - GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +bootstrap: dotnet build src/GitVersion.slnx +dotnet: + frameworks: net8.0;net9.0 + solution: src/GitVersion.slnx + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) diff --git a/schemas/5.12/GitVersion.configuration.json b/schemas/5.12/GitVersion.configuration.json new file mode 100644 index 0000000000..cdeaf454af --- /dev/null +++ b/schemas/5.12/GitVersion.configuration.json @@ -0,0 +1,467 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/5.12/GitVersion.configuration.json", + "title": "GitVersion Configuration", + "description": "GitVersion configuration schema", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": "string" + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be \u0027MajorMinorPatchTag\u0027, \u0027MajorMinorPatch\u0027, \u0027MajorMinor\u0027, \u0027Major\u0027, \u0027None\u0027.", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None" + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. The default value is {InformationalVersion}.", + "type": "string" + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": "string" + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be \u0027MajorMinorPatchTag\u0027, \u0027MajorMinorPatch\u0027, \u0027MajorMinor\u0027, \u0027Major\u0027, \u0027None\u0027.", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None" + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/BranchConfig" + } + }, + "build-metadata-padding": { + "type": [ + "integer", + "null" + ] + }, + "commit-date-format": { + "format": "date-time", + "pattern": "\u0027yyyy-MM-dd\u0027", + "description": "The format to use when calculating the commit date. Defaults to \u0027yyyy-MM-dd\u0027.", + "type": "string" + }, + "commit-message-incrementing": { + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly" + ] + }, + "commits-since-version-source-padding": { + "type": [ + "integer", + "null" + ] + }, + "continuous-delivery-fallback-tag": { + "type": "string" + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "$ref": "#/$defs/Nullable\u006012" + }, + "sha": { + "$ref": "#/$defs/array" + } + } + }, + "increment": { + "$ref": "#/$defs/Nullable\u00601" + }, + "legacy-semver-padding": { + "type": [ + "integer", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "pattern": "\u0027\\\u002Bsemver:\\s?(breaking|major)\u0027", + "description": "The regex to match commit messages with to perform a major version increment. Default set to \u0027\\\u002Bsemver:\\s?(breaking|major)\u0027", + "type": "string" + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "pattern": "\u0027\\\u002Bsemver:\\s?(feature|minor)\u0027", + "description": "The regex to match commit messages with to perform a minor version increment. Default set to \u0027\\\u002Bsemver:\\s?(feature|minor)\u0027", + "type": "string" + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": "string" + }, + "no-bump-message": { + "format": "regex", + "pattern": "\u0027\\\u002Bsemver:\\s?(none|skip)\u0027", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. . Default set to \u0027\\\u002Bsemver:\\s?(none|skip)\u0027", + "type": "string" + }, + "patch-version-bump-message": { + "format": "regex", + "pattern": "\u0027\\\u002Bsemver:\\s?(fix|patch)\u0027", + "description": "The regex to match commit messages with to perform a patch version increment. Default set to \u0027\\\u002Bsemver:\\s?(fix|patch)\u0027", + "type": "string" + }, + "tag-prefix": { + "description": "A regex which is used to trim Git tags before processing. Defaults to [vV]", + "type": "string" + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "type": [ + "boolean", + "null" + ] + }, + "mode": { + "$ref": "#/$defs/Nullable\u006011" + } + }, + "$defs": { + "BranchConfig": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be \u0027Disabled\u0027, \u0027Enabled\u0027 or \u0027MergeMessageOnly\u0027.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly" + ] + }, + "increment": { + "$ref": "#/$defs/Nullable\u00601" + }, + "is-mainline": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch config represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "type": "array", + "items": { + "description": "The branches that this branch is a source branch.", + "type": "string" + } + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment-of-merged-branch-version": { + "description": "Prevent increment of merged branch version.", + "type": [ + "boolean", + "null" + ] + }, + "regex": { + "description": "The regex pattern to use to match this branch.", + "type": "string" + }, + "source-branches": { + "description": "The source branches for this branch.", + "type": "array", + "items": { + "description": "The source branches for this branch.", + "type": "string" + } + }, + "tag": { + "description": "The label to use for this branch. Can be \u0027useBranchName\u0027 to extract the label from the branch name.", + "type": "string" + }, + "tag-number-pattern": { + "format": "regex", + "pattern": "[/-](?\u003Cnumber\u003E\\d\u002B)[-/]", + "description": "The regex pattern to use to extract the number from the branch name. Defaults to \u0027[/-](?\u003Cnumber\u003E\\d\u002B)[-/]\u0027.", + "type": "string" + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch config represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "mode": { + "$ref": "#/$defs/Nullable\u006011" + } + } + }, + "Nullable\u00601": { + "description": "The increment strategy for this branch. Can be \u0027Inherit\u0027, \u0027Patch\u0027, \u0027Minor\u0027, \u0027Major\u0027, \u0027None\u0027.", + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "Nullable\u006011": { + "description": "The versioning mode for this branch. Can be \u0027ContinuousDelivery\u0027, \u0027ContinuousDeployment\u0027, \u0027Mainline\u0027.", + "enum": [ + "ContinuousDelivery", + "ContinuousDeployment", + "Mainline" + ] + }, + "DateTimeOffset": { + "type": [ + "object", + "null" + ], + "properties": { + "date": { + "$ref": "#/$defs/DateTime" + }, + "date-time": { + "$ref": "#/$defs/DateTime" + }, + "day": { + "$ref": "#/$defs/integer" + }, + "day-of-week": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "readOnly": true + }, + "day-of-year": { + "$ref": "#/$defs/integer" + }, + "hour": { + "$ref": "#/$defs/integer" + }, + "local-date-time": { + "$ref": "#/$defs/DateTime" + }, + "millisecond": { + "$ref": "#/$defs/integer" + }, + "minute": { + "$ref": "#/$defs/integer" + }, + "month": { + "$ref": "#/$defs/integer" + }, + "offset": { + "$ref": "#/$defs/TimeSpan" + }, + "second": { + "$ref": "#/$defs/integer" + }, + "ticks": { + "$ref": "#/$defs/integer1" + }, + "time-of-day": { + "$ref": "#/$defs/TimeSpan" + }, + "utc-date-time": { + "$ref": "#/$defs/DateTime" + }, + "utc-ticks": { + "$ref": "#/$defs/integer1" + }, + "year": { + "$ref": "#/$defs/integer" + } + } + }, + "DateTime": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "integer": { + "type": "integer", + "readOnly": true + }, + "integer1": { + "type": "integer", + "readOnly": true + }, + "number": { + "type": "number", + "readOnly": true + }, + "TimeSpan": { + "type": "object", + "properties": { + "days": { + "$ref": "#/$defs/integer" + }, + "hours": { + "$ref": "#/$defs/integer" + }, + "milliseconds": { + "$ref": "#/$defs/integer" + }, + "minutes": { + "$ref": "#/$defs/integer" + }, + "seconds": { + "$ref": "#/$defs/integer" + }, + "ticks": { + "$ref": "#/$defs/integer1" + }, + "total-days": { + "$ref": "#/$defs/number" + }, + "total-hours": { + "$ref": "#/$defs/number" + }, + "total-milliseconds": { + "$ref": "#/$defs/number" + }, + "total-minutes": { + "$ref": "#/$defs/number" + }, + "total-seconds": { + "$ref": "#/$defs/number" + } + }, + "readOnly": true + }, + "Nullable\u006012": { + "format": "date-time", + "pattern": "\u0027yyyy-MM-ddTHH:mm:ss\u0027", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "object", + "null" + ], + "properties": { + "date": { + "$ref": "#/$defs/DateTime" + }, + "date-time": { + "$ref": "#/$defs/DateTime" + }, + "day": { + "$ref": "#/$defs/integer" + }, + "day-of-week": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "readOnly": true + }, + "day-of-year": { + "$ref": "#/$defs/integer" + }, + "hour": { + "$ref": "#/$defs/integer" + }, + "local-date-time": { + "$ref": "#/$defs/DateTime" + }, + "millisecond": { + "$ref": "#/$defs/integer" + }, + "minute": { + "$ref": "#/$defs/integer" + }, + "month": { + "$ref": "#/$defs/integer" + }, + "offset": { + "$ref": "#/$defs/TimeSpan" + }, + "second": { + "$ref": "#/$defs/integer" + }, + "ticks": { + "$ref": "#/$defs/integer1" + }, + "time-of-day": { + "$ref": "#/$defs/TimeSpan" + }, + "utc-date-time": { + "$ref": "#/$defs/DateTime" + }, + "utc-ticks": { + "$ref": "#/$defs/integer1" + }, + "year": { + "$ref": "#/$defs/integer" + } + } + }, + "array": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "type": "array", + "items": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schemas/5.12/GitVersion.json b/schemas/5.12/GitVersion.json new file mode 100644 index 0000000000..2251b3f712 --- /dev/null +++ b/schemas/5.12/GitVersion.json @@ -0,0 +1,165 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/5.12/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": "string" + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": "string" + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": "string" + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "BuildMetaDataPadded": { + "description": "The BuildMetaData padded with 0 up to 4 digits.", + "type": "string" + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": "string" + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "CommitsSinceVersionSourcePadded": { + "description": "The CommitsSinceVersionSource padded with 0 up to 4 digits.", + "type": "string" + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": "string" + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": "string" + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": "string" + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": "string" + }, + "LegacySemVer": { + "description": "Equal to SemVer, but without a . separating PreReleaseLabel and PreReleaseNumber.", + "type": "string" + }, + "LegacySemVerPadded": { + "description": "Equal to LegacySemVer, but with PreReleaseNumber padded with 0 up to 4 digits.", + "type": "string" + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by \u0027.\u0027.", + "type": "string" + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "NuGetPreReleaseTag": { + "description": "A NuGet 1.0 compatible PreReleaseTag.", + "type": "string" + }, + "NuGetPreReleaseTagV2": { + "description": "A NuGet 2.0 compatible PreReleaseTag.", + "type": "string" + }, + "NuGetVersion": { + "description": "A NuGet 1.0 compatible version number.", + "type": "string" + }, + "NuGetVersionV2": { + "description": "A NuGet 2.0 compatible version number.", + "type": "string" + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": "string" + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": "string" + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": "string" + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": "string" + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": "string" + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": "string" + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": "string" + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": "string" + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/6.0/GitVersion.configuration.json b/schemas/6.0/GitVersion.configuration.json new file mode 100644 index 0000000000..2665b5d251 --- /dev/null +++ b/schemas/6.0/GitVersion.configuration.json @@ -0,0 +1,394 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.0/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.0)", + "description": "GitVersion configuration schema (6.0)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": "string" + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None" + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": "string" + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": "string" + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None" + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/branchConfiguration" + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": "string" + }, + "commit-message-incrementing": { + "$ref": "#/$defs/nullableOfCommitMessageIncrementMode" + }, + "mode": { + "$ref": "#/$defs/nullableOfDeploymentMode" + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "$ref": "#/$defs/string3" + }, + "sha": { + "$ref": "#/$defs/hashSetOfString2" + } + } + }, + "increment": { + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "$ref": "#/$defs/nullableOfBoolean" + }, + "is-release-branch": { + "$ref": "#/$defs/nullableOfBoolean1" + }, + "is-source-branch-for": { + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "$ref": "#/$defs/string" + }, + "label-number-pattern": { + "$ref": "#/$defs/string1" + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": "string" + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": "string" + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": "string" + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": "string" + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": "string" + }, + "pre-release-weight": { + "$ref": "#/$defs/nullableOfInt32" + }, + "prevent-increment": { + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "$ref": "#/$defs/string2" + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "$ref": "#/$defs/hashSetOfString1" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": "string" + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "$ref": "#/$defs/nullableOfBoolean4" + }, + "track-merge-target": { + "$ref": "#/$defs/nullableOfBoolean5" + }, + "tracks-release-branches": { + "$ref": "#/$defs/nullableOfBoolean6" + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": "string" + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": "string" + } + }, + "$defs": { + "branchConfiguration": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "$ref": "#/$defs/nullableOfCommitMessageIncrementMode" + }, + "mode": { + "$ref": "#/$defs/nullableOfDeploymentMode" + }, + "increment": { + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "$ref": "#/$defs/nullableOfBoolean" + }, + "is-release-branch": { + "$ref": "#/$defs/nullableOfBoolean1" + }, + "is-source-branch-for": { + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "$ref": "#/$defs/string" + }, + "label-number-pattern": { + "$ref": "#/$defs/string1" + }, + "pre-release-weight": { + "$ref": "#/$defs/nullableOfInt32" + }, + "prevent-increment": { + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "$ref": "#/$defs/string2" + }, + "source-branches": { + "$ref": "#/$defs/hashSetOfString1" + }, + "track-merge-message": { + "$ref": "#/$defs/nullableOfBoolean4" + }, + "track-merge-target": { + "$ref": "#/$defs/nullableOfBoolean5" + }, + "tracks-release-branches": { + "$ref": "#/$defs/nullableOfBoolean6" + } + } + }, + "nullableOfCommitMessageIncrementMode": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly" + ] + }, + "nullableOfDeploymentMode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment" + ] + }, + "incrementStrategy": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "nullableOfBoolean": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "nullableOfBoolean1": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "hashSetOfString": { + "description": "The branches that this branch is a source branch.", + "type": "array", + "items": { + "description": "The branches that this branch is a source branch.", + "type": "string" + } + }, + "string": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": "string" + }, + "string1": { + "format": "regex", + "description": "The regular expression pattern to use to extract the number from the branch name. Defaults to '[/-](?\\d+)'.", + "default": "[/-](?\\d+)", + "type": "string" + }, + "nullableOfInt32": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "preventIncrementConfiguration": { + "description": "The prevent increment configuration section.", + "type": "object", + "properties": { + "of-merged-branch": { + "$ref": "#/$defs/nullableOfBoolean2" + }, + "when-branch-merged": { + "$ref": "#/$defs/nullableOfBoolean2" + }, + "when-current-commit-tagged": { + "$ref": "#/$defs/nullableOfBoolean3" + } + } + }, + "nullableOfBoolean2": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "nullableOfBoolean3": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + }, + "string2": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": "string" + }, + "hashSetOfString1": { + "description": "The source branches for this branch.", + "type": "array", + "items": { + "description": "The source branches for this branch.", + "type": "string" + } + }, + "nullableOfBoolean4": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "nullableOfBoolean5": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "nullableOfBoolean6": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "string3": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": "string" + }, + "hashSetOfString2": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "type": "array", + "items": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schemas/6.0/GitVersion.json b/schemas/6.0/GitVersion.json new file mode 100644 index 0000000000..ef663864a3 --- /dev/null +++ b/schemas/6.0/GitVersion.json @@ -0,0 +1,133 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.0/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": "string" + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": "string" + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": "string" + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": "string" + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": "string" + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": "string" + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": "string" + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": "string" + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": "string" + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": "string" + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": "string" + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": "string" + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": "string" + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": "string" + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": "string" + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": "string" + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": "string" + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/6.1/GitVersion.configuration.json b/schemas/6.1/GitVersion.configuration.json new file mode 100644 index 0000000000..a186b94b48 --- /dev/null +++ b/schemas/6.1/GitVersion.configuration.json @@ -0,0 +1,426 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.1/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.1)", + "description": "GitVersion configuration schema (6.1)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + } + } + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": [ + "string", + "null" + ] + }, + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "$ref": "#/$defs/hashSetOfString" + } + } + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": [ + "string", + "null" + ] + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": [ + "string", + "null" + ] + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": [ + "string", + "null" + ] + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": [ + "string", + "null" + ] + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": [ + "string", + "null" + ] + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": [ + "string", + "null" + ] + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": [ + "string", + "null" + ] + } + }, + "$defs": { + "incrementStrategy": { + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "hashSetOfString": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventIncrementConfiguration": { + "type": "object", + "properties": { + "of-merged-branch": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-branch-merged": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-current-commit-tagged": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/6.1/GitVersion.json b/schemas/6.1/GitVersion.json new file mode 100644 index 0000000000..9c4e5945ab --- /dev/null +++ b/schemas/6.1/GitVersion.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.1/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": [ + "string", + "null" + ] + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": [ + "string", + "null" + ] + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": [ + "string", + "null" + ] + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": [ + "string", + "null" + ] + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": [ + "string", + "null" + ] + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": [ + "string", + "null" + ] + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": [ + "string", + "null" + ] + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": [ + "string", + "null" + ] + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": [ + "string", + "null" + ] + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": [ + "string", + "null" + ] + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": [ + "string", + "null" + ] + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": [ + "string", + "null" + ] + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": [ + "string", + "null" + ] + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/6.2/GitVersion.configuration.json b/schemas/6.2/GitVersion.configuration.json new file mode 100644 index 0000000000..66011f9140 --- /dev/null +++ b/schemas/6.2/GitVersion.configuration.json @@ -0,0 +1,426 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.2/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.2)", + "description": "GitVersion configuration schema (6.2)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + } + } + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": [ + "string", + "null" + ] + }, + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "$ref": "#/$defs/hashSetOfString" + } + } + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": [ + "string", + "null" + ] + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": [ + "string", + "null" + ] + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": [ + "string", + "null" + ] + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": [ + "string", + "null" + ] + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": [ + "string", + "null" + ] + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": [ + "string", + "null" + ] + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": [ + "string", + "null" + ] + } + }, + "$defs": { + "incrementStrategy": { + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "hashSetOfString": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventIncrementConfiguration": { + "type": "object", + "properties": { + "of-merged-branch": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-branch-merged": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-current-commit-tagged": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/6.2/GitVersion.json b/schemas/6.2/GitVersion.json new file mode 100644 index 0000000000..1a1fb8c5ce --- /dev/null +++ b/schemas/6.2/GitVersion.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.2/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": [ + "string", + "null" + ] + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": [ + "string", + "null" + ] + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": [ + "string", + "null" + ] + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": [ + "string", + "null" + ] + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": [ + "string", + "null" + ] + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": [ + "string", + "null" + ] + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": [ + "string", + "null" + ] + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": [ + "string", + "null" + ] + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": [ + "string", + "null" + ] + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": [ + "string", + "null" + ] + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": [ + "string", + "null" + ] + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": [ + "string", + "null" + ] + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": [ + "string", + "null" + ] + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/6.3/GitVersion.configuration.json b/schemas/6.3/GitVersion.configuration.json new file mode 100644 index 0000000000..9681e070f1 --- /dev/null +++ b/schemas/6.3/GitVersion.configuration.json @@ -0,0 +1,426 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.3)", + "description": "GitVersion configuration schema (6.3)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + } + } + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": [ + "string", + "null" + ] + }, + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "$ref": "#/$defs/hashSetOfString" + } + } + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": [ + "string", + "null" + ] + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": [ + "string", + "null" + ] + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": [ + "string", + "null" + ] + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": [ + "string", + "null" + ] + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": [ + "string", + "null" + ] + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": [ + "string", + "null" + ] + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": [ + "string", + "null" + ] + } + }, + "$defs": { + "incrementStrategy": { + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "hashSetOfString": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventIncrementConfiguration": { + "type": "object", + "properties": { + "of-merged-branch": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-branch-merged": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-current-commit-tagged": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/6.3/GitVersion.json b/schemas/6.3/GitVersion.json new file mode 100644 index 0000000000..80cd006aec --- /dev/null +++ b/schemas/6.3/GitVersion.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": [ + "string", + "null" + ] + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": [ + "string", + "null" + ] + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": [ + "string", + "null" + ] + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": [ + "string", + "null" + ] + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": [ + "string", + "null" + ] + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": [ + "string", + "null" + ] + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": [ + "string", + "null" + ] + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": [ + "string", + "null" + ] + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": [ + "string", + "null" + ] + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": [ + "string", + "null" + ] + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": [ + "string", + "null" + ] + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": [ + "string", + "null" + ] + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": [ + "string", + "null" + ] + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/src/.run/cli (help).run.xml b/src/.run/cli (help).run.xml new file mode 100644 index 0000000000..38d1df084c --- /dev/null +++ b/src/.run/cli (help).run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/build/.run/Tools Update.run.xml b/src/.run/cli (showconfig).run.xml similarity index 55% rename from build/.run/Tools Update.run.xml rename to src/.run/cli (showconfig).run.xml index 79b1aaa0be..ef335cde5a 100644 --- a/build/.run/Tools Update.run.xml +++ b/src/.run/cli (showconfig).run.xml @@ -1,20 +1,20 @@ - - - \ No newline at end of file diff --git a/src/.run/cli (version).run.xml b/src/.run/cli (version).run.xml new file mode 100644 index 0000000000..023092b8a6 --- /dev/null +++ b/src/.run/cli (version).run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/src/.run/cli.run.xml b/src/.run/cli.run.xml new file mode 100644 index 0000000000..5721110b54 --- /dev/null +++ b/src/.run/cli.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/src/.run/schema.run.xml b/src/.run/schema.run.xml new file mode 100644 index 0000000000..263e4061bb --- /dev/null +++ b/src/.run/schema.run.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 229c697956..1249fad91a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,5 +1,7 @@ + net8.0;net9.0 + $([System.DateTime]::Today.Year) GitTools and Contributors Copyright GitTools $(EndYear). @@ -16,60 +18,71 @@ https://github.com/GitTools/GitVersion git - 1591,8618 + $(NoWarn);NU1701;1591,8618,SYSLIB10;EnableGenerateDocumentationFile + $(WarningsAsErrors);RS0016;RS0017;RS0022;RS0024;RS0025;RS0026;RS0027 + embedded - 10 + latest enable enable + en - True - + true latest - True + true + false + false + true - - 0.27.0-preview-0182 - 2.0.315-alpha.0.9 - - 2022.1.0 - 11.2.1 - 6.0.0 - 6.0.0 - 6.0.0 - 17.2.0 - - 17.2.0 - 4.3.0 - 3.1.2 - 3.13.3 - 4.2.1 - 3.0.114 - 4.0.3 - 3.3.3 + + + true - - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + - - + - - - - + + + + - + all runtime; build; native; contentfiles; analyzers + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - + + + + + + + @@ -78,16 +91,15 @@ + + + - - - - - - + + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 0000000000..bb53b8488e --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,49 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Docker/README.md b/src/Docker/README.md deleted file mode 100644 index c89ad73690..0000000000 --- a/src/Docker/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# There are 4 variants of docker image - -* based on **microsoft/dotnet-framework:4.8-runtime** - Windows Full FX -* based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core -* based on **mono:5.18** - Linux Full FX - on mono -* based on **microsoft/dotnet:2.1-runtime** - Linux dotnet core -* based on **centos:7** - linux dotnet core - -To run on windows container run this -`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion:latest-windows-net48 c:/repo` - -`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion:latest-windows-netcoreapp2.1 c:/repo` - -To run on linux container run this -`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-net48 /repo` - -`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-netcoreapp2.1 /repo` diff --git a/src/Docker/prerequisites.md b/src/Docker/prerequisites.md deleted file mode 100644 index 5d773a44ea..0000000000 --- a/src/Docker/prerequisites.md +++ /dev/null @@ -1,20 +0,0 @@ -# Run with qemu - -## set buildx as the default docker builder - -```bash -docker buildx install -``` - -## create and use a docker buildx context - -```bash -docker buildx create --name gitversion --use -docker context use gitversion -``` - -## install qemu static - -```bash -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -``` diff --git a/src/GitTools.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs b/src/GitTools.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs deleted file mode 100644 index bc41fad9a3..0000000000 --- a/src/GitTools.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs +++ /dev/null @@ -1,57 +0,0 @@ -using LibGit2Sharp; - -namespace GitTools.Testing; - -/// -/// Creates a repo with a develop branch off main which is a single commit ahead of main -/// -public class BaseGitFlowRepositoryFixture : EmptyRepositoryFixture -{ - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// - /// Main will be tagged with the initial version before branching develop - /// - public BaseGitFlowRepositoryFixture(string initialVersion) : this(initialVersion, "main") - { - } - - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// - /// Main will be tagged with the initial version before branching develop - /// - public BaseGitFlowRepositoryFixture(string initialVersion, string branchName) : - this(r => r.MakeATaggedCommit(initialVersion), branchName) - { - } - - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// - /// The initial setup actions will be performed before branching develop - /// - public BaseGitFlowRepositoryFixture(Action initialMainAction) : this(initialMainAction, "main") - { - } - - /// - /// Creates a repo with a develop branch off main which is a single commit ahead of main - /// - /// The initial setup actions will be performed before branching develop - /// - public BaseGitFlowRepositoryFixture(Action initialMainAction, string branchName) : - base(branchName) => SetupRepo(initialMainAction); - - private void SetupRepo(Action initialMainAction) - { - var randomFile = Path.Combine(Repository.Info.WorkingDirectory, Guid.NewGuid().ToString()); - File.WriteAllText(randomFile, string.Empty); - Commands.Stage(Repository, randomFile); - - initialMainAction(Repository); - - Commands.Checkout(Repository, Repository.CreateBranch("develop")); - Repository.MakeACommit(); - } -} diff --git a/src/GitTools.Testing/Fixtures/EmptyRepositoryFixture.cs b/src/GitTools.Testing/Fixtures/EmptyRepositoryFixture.cs deleted file mode 100644 index 710ad33c08..0000000000 --- a/src/GitTools.Testing/Fixtures/EmptyRepositoryFixture.cs +++ /dev/null @@ -1,23 +0,0 @@ -using LibGit2Sharp; - -namespace GitTools.Testing; - -public class EmptyRepositoryFixture : RepositoryFixtureBase -{ - public EmptyRepositoryFixture() : this("main") - { - } - - public EmptyRepositoryFixture(string branchName) - : base(path => CreateNewRepository(path, branchName)) - { - } - - private static IRepository CreateNewRepository(string path, string branchName) - { - Init(path, branchName); - Console.WriteLine("Created git repository at '{0}'", path); - - return new Repository(path); - } -} diff --git a/src/GitTools.Testing/Fixtures/LocalRepositoryFixture.cs b/src/GitTools.Testing/Fixtures/LocalRepositoryFixture.cs deleted file mode 100644 index 3ce412eb80..0000000000 --- a/src/GitTools.Testing/Fixtures/LocalRepositoryFixture.cs +++ /dev/null @@ -1,10 +0,0 @@ -using LibGit2Sharp; - -namespace GitTools.Testing; - -public class LocalRepositoryFixture : RepositoryFixtureBase -{ - public LocalRepositoryFixture(IRepository repository) : base(repository) - { - } -} diff --git a/src/GitTools.Testing/Fixtures/RepositoryFixtureBase.cs b/src/GitTools.Testing/Fixtures/RepositoryFixtureBase.cs deleted file mode 100644 index 9ab330f4df..0000000000 --- a/src/GitTools.Testing/Fixtures/RepositoryFixtureBase.cs +++ /dev/null @@ -1,121 +0,0 @@ -using GitTools.Testing.Internal; -using LibGit2Sharp; - -namespace GitTools.Testing; - -/// -/// Fixture abstracting a git repository -/// -public abstract class RepositoryFixtureBase : IDisposable -{ - - protected RepositoryFixtureBase(Func repoBuilder) - : this(repoBuilder(PathHelper.GetTempPath())) - { - } - - protected RepositoryFixtureBase(IRepository repository) - { - this.SequenceDiagram = new SequenceDiagram(); - Repository = repository; - Repository.Config.Set("user.name", "Test"); - Repository.Config.Set("user.email", "test@email.com"); - } - - public IRepository Repository { get; } - - public string RepositoryPath => Repository.Info.WorkingDirectory.TrimEnd('\\'); - - public SequenceDiagram SequenceDiagram { get; } - - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposing) - { - return; - } - - Repository.Dispose(); - - try - { - DirectoryHelper.DeleteDirectory(RepositoryPath); - } - catch (Exception e) - { - Console.WriteLine("Failed to clean up repository path at {0}. Received exception: {1}", RepositoryPath, - e.Message); - } - - this.SequenceDiagram.End(); - Console.WriteLine("**Visualisation of test:**"); - Console.WriteLine(string.Empty); - Console.WriteLine(this.SequenceDiagram.GetDiagram()); - } - - public void Checkout(string branch) => Commands.Checkout(Repository, branch); - - public static void Init(string path, string branchName) => GitTestExtensions.ExecuteGitCmd($"init {path} -b {branchName}"); - - public void MakeATaggedCommit(string tag) - { - MakeACommit(); - ApplyTag(tag); - } - - public void ApplyTag(string tag) - { - this.SequenceDiagram.ApplyTag(tag, Repository.Head.FriendlyName); - Repository.ApplyTag(tag); - } - - public void BranchTo(string branchName, string? @as = null) - { - this.SequenceDiagram.BranchTo(branchName, Repository.Head.FriendlyName, @as); - var branch = Repository.CreateBranch(branchName); - Commands.Checkout(Repository, branch); - } - - public void BranchToFromTag(string branchName, string fromTag, string onBranch, string? @as = null) - { - this.SequenceDiagram.BranchToFromTag(branchName, fromTag, onBranch, @as); - var branch = Repository.CreateBranch(branchName); - Commands.Checkout(Repository, branch); - } - - public void MakeACommit() - { - var to = Repository.Head.FriendlyName; - this.SequenceDiagram.MakeACommit(to); - Repository.MakeACommit(); - } - - /// - /// Merges (no-ff) specified branch into the current HEAD of this repository - /// - public void MergeNoFF(string mergeSource) - { - this.SequenceDiagram.Merge(mergeSource, Repository.Head.FriendlyName); - Repository.MergeNoFF(mergeSource, Generate.SignatureNow()); - } - - /// - /// Clones the repository managed by this fixture into another LocalRepositoryFixture - /// - public LocalRepositoryFixture CloneRepository() - { - var localPath = PathHelper.GetTempPath(); - LibGit2Sharp.Repository.Clone(RepositoryPath, localPath); - return new LocalRepositoryFixture(new Repository(localPath)); - } -} diff --git a/src/GitTools.Testing/GitTools.Testing.csproj b/src/GitTools.Testing/GitTools.Testing.csproj deleted file mode 100644 index 5c885c3877..0000000000 --- a/src/GitTools.Testing/GitTools.Testing.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - netstandard2.0 - false - - - - - - diff --git a/src/GitTools.Testing/Internal/DirectoryHelper.cs b/src/GitTools.Testing/Internal/DirectoryHelper.cs deleted file mode 100644 index f11334b6c7..0000000000 --- a/src/GitTools.Testing/Internal/DirectoryHelper.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace GitTools.Testing.Internal; - -internal static class DirectoryHelper -{ - private static readonly Dictionary ToRename = new() - { - { "gitted", ".git" }, - { "gitmodules", ".gitmodules" } - }; - - public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target) - { - // From http://stackoverflow.com/questions/58744/best-way-to-copy-the-entire-contents-of-a-directory-in-c/58779#58779 - - foreach (var dir in source.GetDirectories()) - { - CopyFilesRecursively(dir, target.CreateSubdirectory(Rename(dir.Name))); - } - - foreach (var file in source.GetFiles()) - { - file.CopyTo(Path.Combine(target.FullName, Rename(file.Name))); - } - } - - private static string Rename(string name) => ToRename.ContainsKey(name) ? ToRename[name] : name; - - public static void DeleteSubDirectories(string parentPath) - { - var dirs = Directory.GetDirectories(parentPath); - foreach (var dir in dirs) - { - DeleteDirectory(dir); - } - } - - public static void DeleteDirectory(string directoryPath) - { - // From http://stackoverflow.com/questions/329355/cannot-delete-directory-with-directory-deletepath-true/329502#329502 - - if (!Directory.Exists(directoryPath)) - { - Trace.WriteLine($"Directory '{directoryPath}' is missing and can't be removed."); - - return; - } - - var files = Directory.GetFiles(directoryPath); - var dirs = Directory.GetDirectories(directoryPath); - - foreach (var file in files) - { - File.SetAttributes(file, FileAttributes.Normal); - File.Delete(file); - } - - foreach (var dir in dirs) - { - DeleteDirectory(dir); - } - - File.SetAttributes(directoryPath, FileAttributes.Normal); - try - { - Directory.Delete(directoryPath, false); - } - catch (IOException) - { - Trace.WriteLine(string.Format("{0}The directory '{1}' could not be deleted!" + - "{0}Most of the time, this is due to an external process accessing the files in the temporary repositories created during the test runs, and keeping a handle on the directory, thus preventing the deletion of those files." + - "{0}Known and common causes include:" + - "{0}- Windows Search Indexer (go to the Indexing Options, in the Windows Control Panel, and exclude the bin folder of LibGit2Sharp.Tests)" + - "{0}- Antivirus (exclude the bin folder of LibGit2Sharp.Tests from the paths scanned by your real-time antivirus){0}", - Environment.NewLine, Path.GetFullPath(directoryPath))); - } - } -} diff --git a/src/GitTools.Testing/Internal/ObjectExtensions.cs b/src/GitTools.Testing/Internal/ObjectExtensions.cs deleted file mode 100644 index 7ec170b27b..0000000000 --- a/src/GitTools.Testing/Internal/ObjectExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace GitTools.Testing.Internal; - -public static class ObjectExtensions -{ - public static void Deconstruct( - this KeyValuePair kvp, - out TKey key, - out TValue value) - { - key = kvp.Key; - value = kvp.Value; - } -} diff --git a/src/GitTools.Testing/Internal/PathHelper.cs b/src/GitTools.Testing/Internal/PathHelper.cs deleted file mode 100644 index 8b71cdf091..0000000000 --- a/src/GitTools.Testing/Internal/PathHelper.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitTools.Testing.Internal; - -internal static class PathHelper -{ - public static string GetTempPath() => Path.Combine(Path.GetTempPath(), "TestRepositories", Guid.NewGuid().ToString()); -} diff --git a/src/GitTools.Testing/Internal/ProcessHelper.cs b/src/GitTools.Testing/Internal/ProcessHelper.cs deleted file mode 100644 index 66eb4c8750..0000000000 --- a/src/GitTools.Testing/Internal/ProcessHelper.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace GitTools.Testing.Internal; - -public static class ProcessHelper -{ - private static readonly object LockObject = new(); - - // http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/f6069441-4ab1-4299-ad6a-b8bb9ed36be3 - private static Process? Start(ProcessStartInfo startInfo) - { - Process? process; - - lock (LockObject) - { - using (new ChangeErrorMode(ErrorModes.FailCriticalErrors | ErrorModes.NoGpFaultErrorBox)) - { - try - { - process = Process.Start(startInfo); - } - catch (Win32Exception exception) - { - switch ((NativeErrorCode)exception.NativeErrorCode) - { - case NativeErrorCode.Success: - // Success is not a failure. - break; - - case NativeErrorCode.FileNotFound: - throw new FileNotFoundException($"The executable file '{startInfo.FileName}' could not be found.", - startInfo.FileName, - exception); - - case NativeErrorCode.PathNotFound: - throw new DirectoryNotFoundException($"The path to the executable file '{startInfo.FileName}' could not be found.", - exception); - } - - throw; - } - - try - { - if (process != null) - { - process.PriorityClass = ProcessPriorityClass.Idle; - } - } - catch - { - // NOTE: It seems like in some situations, setting the priority class will throw a Win32Exception - // with the error code set to "Success", which I think we can safely interpret as a success and - // not an exception. - // - // See: https://travis-ci.org/GitTools/GitVersion/jobs/171288284#L2026 - // And: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382.aspx - // - // There's also the case where the process might be killed before we try to adjust its priority - // class, in which case it will throw an InvalidOperationException. What we ideally should do - // is start the process in a "suspended" state, adjust the priority class, then resume it, but - // that's not possible in pure .NET. - // - // See: https://travis-ci.org/GitTools/GitVersion/jobs/166709203#L2278 - // And: http://www.codeproject.com/Articles/230005/Launch-a-process-suspended - // - // -- @asbjornu - } - } - } - - return process; - } - - // http://csharptest.net/532/using-processstart-to-capture-console-output/ - public static int Run(Action output, Action errorOutput, TextReader? input, string exe, string args, string workingDirectory, params KeyValuePair[] environmentalVariables) - { - if (string.IsNullOrEmpty(exe)) - throw new ArgumentNullException(nameof(exe)); - if (output == null) - throw new ArgumentNullException(nameof(output)); - - var psi = new ProcessStartInfo - { - UseShellExecute = false, - RedirectStandardError = true, - RedirectStandardOutput = true, - RedirectStandardInput = true, - WindowStyle = ProcessWindowStyle.Hidden, - CreateNoWindow = true, - ErrorDialog = false, - WorkingDirectory = workingDirectory, - FileName = exe, - Arguments = args - }; - foreach (var (key, value) in environmentalVariables) - { - var psiEnvironmentVariables = psi.EnvironmentVariables; - if (psiEnvironmentVariables.ContainsKey(key) && string.IsNullOrEmpty(value)) - { - psiEnvironmentVariables.Remove(key); - } - else if (psiEnvironmentVariables.ContainsKey(key)) - { - psiEnvironmentVariables[key] = value; - } - else - { - psiEnvironmentVariables.Add(key, value); - } - } - - using var process = Start(psi); - - if (process is null) - { - // FIX ME: What error code do you want to return? - return -1; - } - - using var mreOut = new ManualResetEvent(false); - using var mreErr = new ManualResetEvent(false); - process.EnableRaisingEvents = true; - process.OutputDataReceived += (_, e) => - { - // ReSharper disable once AccessToDisposedClosure - if (e.Data == null) - mreOut.Set(); - else - output(e.Data); - }; - process.BeginOutputReadLine(); - process.ErrorDataReceived += (_, e) => - { - // ReSharper disable once AccessToDisposedClosure - if (e.Data == null) - mreErr.Set(); - else - errorOutput(e.Data); - }; - process.BeginErrorReadLine(); - - string? line; - while ((line = input?.ReadLine()) != null) - process.StandardInput.WriteLine(line); - - process.StandardInput.Close(); - process.WaitForExit(); - - mreOut.WaitOne(); - mreErr.WaitOne(); - - return process.ExitCode; - } - - /// - /// System error codes. - /// See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382.aspx - /// - private enum NativeErrorCode - { - Success = 0x0, - FileNotFound = 0x2, - PathNotFound = 0x3 - } - - [Flags] - private enum ErrorModes - { - Default = 0x0, - FailCriticalErrors = 0x1, - NoGpFaultErrorBox = 0x2, - NoAlignmentFaultExcept = 0x4, - NoOpenFileErrorBox = 0x8000 - } - - private readonly struct ChangeErrorMode : IDisposable - { - private readonly int oldMode; - - public ChangeErrorMode(ErrorModes mode) - { - try - { - this.oldMode = SetErrorMode((int)mode); - } - catch (Exception ex) when (ex is EntryPointNotFoundException or DllNotFoundException) - { - this.oldMode = (int)mode; - } - } - - - void IDisposable.Dispose() - { - try - { - SetErrorMode(this.oldMode); - } - catch (Exception ex) when (ex is EntryPointNotFoundException or DllNotFoundException) - { - // NOTE: Mono doesn't support DllImport("kernel32.dll") and its SetErrorMode method, obviously. @asbjornu - } - } - - [DllImport("kernel32.dll")] - private static extern int SetErrorMode(int newMode); - } -} diff --git a/src/GitTools.Testing/Internal/StringBuilderExtensions.cs b/src/GitTools.Testing/Internal/StringBuilderExtensions.cs deleted file mode 100644 index 0e76c7917d..0000000000 --- a/src/GitTools.Testing/Internal/StringBuilderExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using JetBrains.Annotations; - -namespace GitTools.Testing.Internal; - -internal static class StringBuilderExtensions -{ - [StringFormatMethod("format")] - public static void AppendLineFormat(this StringBuilder stringBuilder, string format, params object?[] args) - { - stringBuilder.AppendFormat(format, args); - stringBuilder.AppendLine(); - } -} diff --git a/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs b/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs index a1e5e85ec4..6d8537e276 100644 --- a/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs @@ -1,9 +1,8 @@ -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; using GitVersion.OutputVariables; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -17,8 +16,7 @@ public void SetUp() { var sp = ConfigureServices(services => { - services.AddSingleton(); - services.AddSingleton(); + services.AddModule(new GitVersionAppModule()); services.AddSingleton(); }); this.argumentParser = sp.GetRequiredService(); @@ -33,9 +31,10 @@ public void EmptyOnFetchDisabledBuildServerMeansNoFetchIsTrue() private class MockBuildAgent : ICurrentBuildAgent { + public bool IsDefault => false; public bool CanApplyToCurrentContext() => throw new NotImplementedException(); - public void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) => throw new NotImplementedException(); + public void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) => throw new NotImplementedException(); public string GetCurrentBranch(bool usingDynamicRepos) => throw new NotImplementedException(); diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index 5573c8609b..42e7c36304 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -1,14 +1,11 @@ -using GitTools.Testing; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -17,24 +14,22 @@ public class ArgumentParserTests : TestBase { private IEnvironment environment; private IArgumentParser argumentParser; + private IFileSystem fileSystem; [SetUp] public void SetUp() { - var sp = ConfigureServices(services => - { - services.AddSingleton(); - services.AddSingleton(); - }); + var sp = ConfigureServices(services => services.AddModule(new GitVersionAppModule())); this.environment = sp.GetRequiredService(); this.argumentParser = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); } [Test] public void EmptyMeansUseCurrentDirectory() { var arguments = this.argumentParser.ParseArguments(""); - arguments.TargetPath.ShouldBe(System.Environment.CurrentDirectory); + arguments.TargetPath.ShouldBe(SysEnv.CurrentDirectory); arguments.LogFilePath.ShouldBe(null); arguments.IsHelp.ShouldBe(false); } @@ -52,7 +47,7 @@ public void SingleMeansUseAsTargetDirectory() public void NoPathAndLogfileShouldUseCurrentDirectoryTargetDirectory() { var arguments = this.argumentParser.ParseArguments("-l logFilePath"); - arguments.TargetPath.ShouldBe(System.Environment.CurrentDirectory); + arguments.TargetPath.ShouldBe(SysEnv.CurrentDirectory); arguments.LogFilePath.ShouldBe("logFilePath"); arguments.IsHelp.ShouldBe(false); } @@ -61,8 +56,11 @@ public void NoPathAndLogfileShouldUseCurrentDirectoryTargetDirectory() public void HelpSwitchTest() { var arguments = this.argumentParser.ParseArguments("-h"); - Assert.IsNull(arguments.TargetPath); - Assert.IsNull(arguments.LogFilePath); + Assert.Multiple(() => + { + Assert.That(arguments.TargetPath, Is.Null); + Assert.That(arguments.LogFilePath, Is.Null); + }); arguments.IsHelp.ShouldBe(true); } @@ -70,8 +68,11 @@ public void HelpSwitchTest() public void VersionSwitchTest() { var arguments = this.argumentParser.ParseArguments("-version"); - Assert.IsNull(arguments.TargetPath); - Assert.IsNull(arguments.LogFilePath); + Assert.Multiple(() => + { + Assert.That(arguments.TargetPath, Is.Null); + Assert.That(arguments.LogFilePath, Is.Null); + }); arguments.IsVersion.ShouldBe(true); } @@ -99,7 +100,7 @@ public void UnknownOutputShouldThrow() { var exception = Assert.Throws(() => this.argumentParser.ParseArguments("targetDirectoryPath -output invalid_value")); exception.ShouldNotBeNull(); - exception.Message.ShouldBe("Value 'invalid_value' cannot be parsed as output type, please use 'json', 'file' or 'buildserver'"); + exception.Message.ShouldBe("Value 'invalid_value' cannot be parsed as output type, please use 'json', 'file', 'buildserver' or 'dotenv'"); } [Test] @@ -279,13 +280,13 @@ public void UpdateAssemblyInfoWithFilename() { using var repo = new EmptyRepositoryFixture(); - var assemblyFile = PathHelper.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); - using var file = File.Create(assemblyFile); + var assemblyFile = FileSystemHelper.Path.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); + using var file = this.fileSystem.File.Create(assemblyFile); var arguments = this.argumentParser.ParseArguments($"-targetpath {repo.RepositoryPath} -updateAssemblyInfo CommonAssemblyInfo.cs"); arguments.UpdateAssemblyInfo.ShouldBe(true); arguments.UpdateAssemblyInfoFileName.Count.ShouldBe(1); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); } [Test] @@ -293,17 +294,17 @@ public void UpdateAssemblyInfoWithMultipleFilenames() { using var repo = new EmptyRepositoryFixture(); - var assemblyFile1 = PathHelper.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); - using var file = File.Create(assemblyFile1); + var assemblyFile1 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); + using var file = this.fileSystem.File.Create(assemblyFile1); - var assemblyFile2 = PathHelper.Combine(repo.RepositoryPath, "VersionAssemblyInfo.cs"); - using var file2 = File.Create(assemblyFile2); + var assemblyFile2 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "VersionAssemblyInfo.cs"); + using var file2 = this.fileSystem.File.Create(assemblyFile2); var arguments = this.argumentParser.ParseArguments($"-targetpath {repo.RepositoryPath} -updateAssemblyInfo CommonAssemblyInfo.cs VersionAssemblyInfo.cs"); arguments.UpdateAssemblyInfo.ShouldBe(true); arguments.UpdateAssemblyInfoFileName.Count.ShouldBe(2); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("VersionAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("VersionAssemblyInfo.cs")); } [Test] @@ -311,17 +312,17 @@ public void UpdateProjectFilesWithMultipleFilenames() { using var repo = new EmptyRepositoryFixture(); - var assemblyFile1 = PathHelper.Combine(repo.RepositoryPath, "CommonAssemblyInfo.csproj"); - using var file = File.Create(assemblyFile1); + var assemblyFile1 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "CommonAssemblyInfo.csproj"); + using var file = this.fileSystem.File.Create(assemblyFile1); - var assemblyFile2 = PathHelper.Combine(repo.RepositoryPath, "VersionAssemblyInfo.csproj"); - using var file2 = File.Create(assemblyFile2); + var assemblyFile2 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "VersionAssemblyInfo.csproj"); + using var file2 = this.fileSystem.File.Create(assemblyFile2); var arguments = this.argumentParser.ParseArguments($"-targetpath {repo.RepositoryPath} -updateProjectFiles CommonAssemblyInfo.csproj VersionAssemblyInfo.csproj"); arguments.UpdateProjectFiles.ShouldBe(true); arguments.UpdateAssemblyInfoFileName.Count.ShouldBe(2); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("CommonAssemblyInfo.csproj")); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("VersionAssemblyInfo.csproj")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("CommonAssemblyInfo.csproj")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("VersionAssemblyInfo.csproj")); } [Test] @@ -329,23 +330,24 @@ public void UpdateAssemblyInfoWithMultipleFilenamesMatchingGlobbing() { using var repo = new EmptyRepositoryFixture(); - var assemblyFile1 = PathHelper.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); - using var file = File.Create(assemblyFile1); + var assemblyFile1 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); + using var file = this.fileSystem.File.Create(assemblyFile1); + + var assemblyFile2 = FileSystemHelper.Path.Combine(repo.RepositoryPath, "VersionAssemblyInfo.cs"); + using var file2 = this.fileSystem.File.Create(assemblyFile2); - var assemblyFile2 = PathHelper.Combine(repo.RepositoryPath, "VersionAssemblyInfo.cs"); - using var file2 = File.Create(assemblyFile2); + var subdir = FileSystemHelper.Path.Combine(repo.RepositoryPath, "subdir"); - var subdir = PathHelper.Combine(repo.RepositoryPath, "subdir"); - Directory.CreateDirectory(subdir); - var assemblyFile3 = PathHelper.Combine(subdir, "LocalAssemblyInfo.cs"); - using var file3 = File.Create(assemblyFile3); + this.fileSystem.Directory.CreateDirectory(subdir); + var assemblyFile3 = FileSystemHelper.Path.Combine(subdir, "LocalAssemblyInfo.cs"); + using var file3 = this.fileSystem.File.Create(assemblyFile3); var arguments = this.argumentParser.ParseArguments($"-targetpath {repo.RepositoryPath} -updateAssemblyInfo **/*AssemblyInfo.cs"); arguments.UpdateAssemblyInfo.ShouldBe(true); arguments.UpdateAssemblyInfoFileName.Count.ShouldBe(3); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("VersionAssemblyInfo.cs")); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("LocalAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("VersionAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("LocalAssemblyInfo.cs")); } [Test] @@ -353,23 +355,23 @@ public void UpdateAssemblyInfoWithRelativeFilename() { using var repo = new EmptyRepositoryFixture(); - var assemblyFile = PathHelper.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); - using var file = File.Create(assemblyFile); + var assemblyFile = FileSystemHelper.Path.Combine(repo.RepositoryPath, "CommonAssemblyInfo.cs"); + using var file = this.fileSystem.File.Create(assemblyFile); - var targetPath = PathHelper.Combine(repo.RepositoryPath, "subdir1", "subdir2"); - Directory.CreateDirectory(targetPath); + var targetPath = FileSystemHelper.Path.Combine(repo.RepositoryPath, "subdir1", "subdir2"); + this.fileSystem.Directory.CreateDirectory(targetPath); - var arguments = this.argumentParser.ParseArguments($"-targetpath {targetPath} -updateAssemblyInfo ..\\..\\CommonAssemblyInfo.cs"); + var arguments = this.argumentParser.ParseArguments($@"-targetpath {targetPath} -updateAssemblyInfo ..\..\CommonAssemblyInfo.cs"); arguments.UpdateAssemblyInfo.ShouldBe(true); arguments.UpdateAssemblyInfoFileName.Count.ShouldBe(1); - arguments.UpdateAssemblyInfoFileName.ShouldContain(x => Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); + arguments.UpdateAssemblyInfoFileName.ShouldContain(x => FileSystemHelper.Path.GetFileName(x).Equals("CommonAssemblyInfo.cs")); } [Test] public void OverrideconfigWithNoOptions() { var arguments = this.argumentParser.ParseArguments("/overrideconfig"); - arguments.OverrideConfig.ShouldBeNull(); + arguments.OverrideConfiguration.ShouldBeNull(); } [TestCaseSource(nameof(OverrideconfigWithInvalidOptionTestData))] @@ -390,217 +392,189 @@ private static IEnumerable OverrideconfigWithInvalidOptionTestData { ExpectedResult = "Could not parse /overrideconfig option: unknown-option=25. Unsupported 'key'." }; - yield return new TestCaseData("update-build-number=1") - { - ExpectedResult = "Could not parse /overrideconfig option: update-build-number=1. Ensure that 'value' is 'true' or 'false'." - }; - yield return new TestCaseData("tag-pre-release-weight=invalid-value") - { - ExpectedResult = "Could not parse /overrideconfig option: tag-pre-release-weight=invalid-value. Ensure that 'value' is valid integer number." - }; - yield return new TestCaseData("assembly-versioning-scheme=WrongEnumValue") - { - ExpectedResult = $"Could not parse /overrideconfig option: assembly-versioning-scheme=WrongEnumValue. Ensure that 'value' is valid for specified 'key' enumeration: {System.Environment.NewLine}" + - $"MajorMinorPatchTag{System.Environment.NewLine}" + - $"MajorMinorPatch{System.Environment.NewLine}" + - $"MajorMinor{System.Environment.NewLine}" + - $"Major{System.Environment.NewLine}" + - $"None{System.Environment.NewLine}" - }; } - [TestCaseSource(nameof(OverrideconfigWithSingleOptionTestData))] - public void OverrideconfigWithSingleOptions(string options, Config expected) + [TestCaseSource(nameof(OverrideConfigWithSingleOptionTestData))] + public void OverrideConfigWithSingleOptions(string options, IGitVersionConfiguration expected) { var arguments = this.argumentParser.ParseArguments($"/overrideconfig {options}"); - arguments.OverrideConfig.ShouldBeEquivalentTo(expected); + + ConfigurationHelper configurationHelper = new(arguments.OverrideConfiguration); + configurationHelper.Configuration.ShouldBeEquivalentTo(expected); } - private static IEnumerable OverrideconfigWithSingleOptionTestData() + private static IEnumerable OverrideConfigWithSingleOptionTestData() { yield return new TestCaseData( "assembly-versioning-scheme=MajorMinor", - new Config + new GitVersionConfiguration { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor } ); yield return new TestCaseData( "assembly-file-versioning-scheme=\"MajorMinorPatch\"", - new Config + new GitVersionConfiguration { AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch } ); yield return new TestCaseData( "assembly-informational-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", - new Config + new GitVersionConfiguration { AssemblyInformationalFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( "assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", - new Config + new GitVersionConfiguration { AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( "assembly-file-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", - new Config + new GitVersionConfiguration { AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( "mode=ContinuousDelivery", - new Config + new GitVersionConfiguration { - VersioningMode = VersioningMode.ContinuousDelivery + DeploymentMode = DeploymentMode.ContinuousDelivery } ); yield return new TestCaseData( "tag-prefix=sample", - new Config + new GitVersionConfiguration { - TagPrefix = "sample" + TagPrefixPattern = "sample" } ); yield return new TestCaseData( - "continuous-delivery-fallback-tag=cd-tag", - new Config + "label=cd-label", + new GitVersionConfiguration { - ContinuousDeploymentFallbackTag = "cd-tag" + Label = "cd-label" } ); yield return new TestCaseData( "next-version=1", - new Config + new GitVersionConfiguration { NextVersion = "1" } ); yield return new TestCaseData( "major-version-bump-message=\"This is major version bump message.\"", - new Config + new GitVersionConfiguration { MajorVersionBumpMessage = "This is major version bump message." } ); yield return new TestCaseData( "minor-version-bump-message=\"This is minor version bump message.\"", - new Config + new GitVersionConfiguration { MinorVersionBumpMessage = "This is minor version bump message." } ); yield return new TestCaseData( "patch-version-bump-message=\"This is patch version bump message.\"", - new Config + new GitVersionConfiguration { PatchVersionBumpMessage = "This is patch version bump message." } ); yield return new TestCaseData( "no-bump-message=\"This is no bump message.\"", - new Config + new GitVersionConfiguration { NoBumpMessage = "This is no bump message." } ); - yield return new TestCaseData( - "legacy-semver-padding=99", - new Config - { - LegacySemVerPadding = 99 - } - ); - yield return new TestCaseData( - "build-metadata-padding=30", - new Config - { - BuildMetaDataPadding = 30 - } - ); - yield return new TestCaseData( - "commits-since-version-source-padding=5", - new Config - { - CommitsSinceVersionSourcePadding = 5 - } - ); yield return new TestCaseData( "tag-pre-release-weight=2", - new Config + new GitVersionConfiguration { TagPreReleaseWeight = 2 } ); yield return new TestCaseData( "commit-message-incrementing=MergeMessageOnly", - new Config + new GitVersionConfiguration { CommitMessageIncrementing = CommitMessageIncrementMode.MergeMessageOnly } ); yield return new TestCaseData( "increment=Minor", - new Config + new GitVersionConfiguration { Increment = IncrementStrategy.Minor } ); yield return new TestCaseData( "commit-date-format=\"MM/dd/yyyy h:mm tt\"", - new Config + new GitVersionConfiguration { CommitDateFormat = "MM/dd/yyyy h:mm tt" } ); yield return new TestCaseData( "update-build-number=true", - new Config + new GitVersionConfiguration { UpdateBuildNumber = true } ); + yield return new TestCaseData( + "strategies=[\"None\",\"Mainline\"]", + new GitVersionConfiguration + { + VersionStrategies = [VersionStrategies.None, VersionStrategies.Mainline] + } + ); } - [TestCaseSource(nameof(OverrideconfigWithMultipleOptionsTestData))] - public void OverrideconfigWithMultipleOptions(string options, Config expected) + [TestCaseSource(nameof(OverrideConfigWithMultipleOptionsTestData))] + public void OverrideConfigWithMultipleOptions(string options, IGitVersionConfiguration expected) { var arguments = this.argumentParser.ParseArguments(options); - arguments.OverrideConfig.ShouldBeEquivalentTo(expected); + ConfigurationHelper configurationHelper = new(arguments.OverrideConfiguration); + configurationHelper.Configuration.ShouldBeEquivalentTo(expected); } - private static IEnumerable OverrideconfigWithMultipleOptionsTestData() + private static IEnumerable OverrideConfigWithMultipleOptionsTestData() { yield return new TestCaseData( "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-scheme=MajorMinor", - new Config + new GitVersionConfiguration { - TagPrefix = "sample", + TagPrefixPattern = "sample", AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor } ); yield return new TestCaseData( "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", - new Config + new GitVersionConfiguration { - TagPrefix = "sample", + TagPrefixPattern = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\" /overrideconfig update-build-number=true /overrideconfig assembly-versioning-scheme=MajorMinorPatchTag /overrideconfig mode=ContinuousDelivery /overrideconfig tag-pre-release-weight=4", - new Config + new GitVersionConfiguration { - TagPrefix = "sample", + TagPrefixPattern = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}", UpdateBuildNumber = true, AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDelivery, + DeploymentMode = DeploymentMode.ContinuousDelivery, TagPreReleaseWeight = 4 } ); @@ -630,8 +604,8 @@ public void EnsureAssemblyInfoFalse() [Test] public void DynamicRepoLocation() { - var arguments = this.argumentParser.ParseArguments("-dynamicRepoLocation c:\\foo\\"); - arguments.ClonePath.ShouldBe("c:\\foo\\"); + var arguments = this.argumentParser.ParseArguments("-dynamicRepoLocation /tmp/foo"); + arguments.ClonePath.ShouldBe("/tmp/foo"); } [Test] @@ -655,6 +629,13 @@ public void NoNormalizeTrueWhenDefined() arguments.NoNormalize.ShouldBe(true); } + [Test] + public void AllowshallowTrueWhenDefined() + { + var arguments = this.argumentParser.ParseArguments("-allowshallow"); + arguments.AllowShallow.ShouldBe(true); + } + [Test] public void OtherArgumentsCanBeParsedBeforeNofetch() { @@ -679,18 +660,45 @@ public void OtherArgumentsCanBeParsedBeforeNocache() arguments.NoCache.ShouldBe(true); } - [TestCase("-nofetch -nonormalize -nocache")] - [TestCase("-nofetch -nocache -nonormalize")] - [TestCase("-nocache -nofetch -nonormalize")] - [TestCase("-nocache -nonormalize -nofetch")] - [TestCase("-nonormalize -nocache -nofetch")] - [TestCase("-nonormalize -nofetch -nocache")] + [Test] + public void OtherArgumentsCanBeParsedBeforeAllowshallow() + { + var arguments = this.argumentParser.ParseArguments("targetpath -allowshallow"); + arguments.TargetPath.ShouldBe("targetpath"); + arguments.AllowShallow.ShouldBe(true); + } + + [TestCase("-nofetch -nonormalize -nocache -allowshallow")] + [TestCase("-nofetch -nonormalize -allowshallow -nocache")] + [TestCase("-nofetch -nocache -nonormalize -allowshallow")] + [TestCase("-nofetch -nocache -allowshallow -nonormalize")] + [TestCase("-nofetch -allowshallow -nonormalize -nocache")] + [TestCase("-nofetch -allowshallow -nocache -nonormalize")] + [TestCase("-nonormalize -nofetch -nocache -allowshallow")] + [TestCase("-nonormalize -nofetch -allowshallow -nocache")] + [TestCase("-nonormalize -nocache -nofetch -allowshallow")] + [TestCase("-nonormalize -nocache -allowshallow -nofetch")] + [TestCase("-nonormalize -allowshallow -nofetch -nocache")] + [TestCase("-nonormalize -allowshallow -nocache -nofetch")] + [TestCase("-nocache -nofetch -nonormalize -allowshallow")] + [TestCase("-nocache -nofetch -allowshallow -nonormalize")] + [TestCase("-nocache -nonormalize -nofetch -allowshallow")] + [TestCase("-nocache -nonormalize -allowshallow -nofetch")] + [TestCase("-nocache -allowshallow -nofetch -nonormalize")] + [TestCase("-nocache -allowshallow -nonormalize -nofetch")] + [TestCase("-allowshallow -nofetch -nonormalize -nocache")] + [TestCase("-allowshallow -nofetch -nocache -nonormalize")] + [TestCase("-allowshallow -nonormalize -nofetch -nocache")] + [TestCase("-allowshallow -nonormalize -nocache -nofetch")] + [TestCase("-allowshallow -nocache -nofetch -nonormalize")] + [TestCase("-allowshallow -nocache -nonormalize -nofetch")] public void SeveralSwitchesCanBeParsed(string commandLineArgs) { var arguments = this.argumentParser.ParseArguments(commandLineArgs); arguments.NoCache.ShouldBe(true); arguments.NoNormalize.ShouldBe(true); arguments.NoFetch.ShouldBe(true); + arguments.AllowShallow.ShouldBe(true); } [Test] @@ -765,4 +773,33 @@ public void ArbitraryArgumentsRemotePasswordDefinedSetsPassword() var arguments = this.argumentParser.ParseArguments("-nocache"); arguments.Authentication.Password.ShouldBe("value"); } + + [Test] + public void EnsureShowVariableIsSet() + { + var arguments = this.argumentParser.ParseArguments("-showvariable SemVer"); + arguments.ShowVariable.ShouldBe("SemVer"); + } + + [Test] + public void EnsureFormatIsSet() + { + var arguments = this.argumentParser.ParseArguments("-format {Major}.{Minor}.{Patch}"); + arguments.Format.ShouldBe("{Major}.{Minor}.{Patch}"); + } + + [TestCase("custom-config.yaml")] + [TestCase("/tmp/custom-config.yaml")] + public void ThrowIfConfigurationFileDoesNotExist(string configFile) => + Should.Throw(() => _ = this.argumentParser.ParseArguments($"-config {configFile}")); + + [Test] + public void EnsureConfigurationFileIsSet() + { + var configFile = FileSystemHelper.Path.GetTempPath() + Guid.NewGuid() + ".yaml"; + this.fileSystem.File.WriteAllText(configFile, "next-version: 1.0.0"); + var arguments = this.argumentParser.ParseArguments($"-config {configFile}"); + arguments.ConfigurationFile.ShouldBe(configFile); + this.fileSystem.File.Delete(configFile); + } } diff --git a/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs b/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs index e5cc3906ef..7b992bca38 100644 --- a/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs +++ b/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs @@ -1,8 +1,5 @@ -using GitTools.Testing; -using GitVersion.Core.Tests.Helpers; +using GitVersion.App.Tests.Helpers; using GitVersion.Helpers; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -17,6 +14,7 @@ public void InvalidArgumentsExitCodeShouldNotBeZero() var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /invalid-argument"); result.ExitCode.ShouldNotBe(0); + result.Output.ShouldNotBeNull(); result.Output.ShouldContain("Could not parse command line parameter '/invalid-argument'"); } @@ -27,10 +25,15 @@ public void LogPathContainsForwardSlash() fixture.MakeATaggedCommit("1.2.3"); fixture.MakeACommit(); - var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, @" /l ""/tmp/path""", false); + var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, + """ /l "/tmp/path" """, false); result.ExitCode.ShouldBe(0); - result.Output.ShouldContain(@"""MajorMinorPatch"": ""1.2.4"""); + result.Output.ShouldNotBeNull(); + result.Output.ShouldContain( + """ + "MajorMinorPatch": "1.2.4" + """); } [Theory] @@ -43,21 +46,35 @@ public void CheckBuildServerVerbosityConsole(string verbosityArg, string expecte fixture.MakeATaggedCommit("1.2.3"); fixture.MakeACommit(); - var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, $@" {verbosityArg} -output buildserver /l ""/tmp/path""", false); + var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, + $""" {verbosityArg} -output buildserver /l "/tmp/path" """, false); result.ExitCode.ShouldBe(0); + result.Output.ShouldNotBeNull(); result.Output.ShouldContain(expectedOutput); } [Test] public void WorkingDirectoryWithoutGitFolderFailsWithInformativeMessage() { - var result = GitVersionHelper.ExecuteIn(System.Environment.SystemDirectory, null, false); + var workingDirectory = FileSystemHelper.Path.GetTempPathLegacy(); + var result = GitVersionHelper.ExecuteIn(workingDirectory, null, false); result.ExitCode.ShouldNotBe(0); + result.Output.ShouldNotBeNull(); result.Output.ShouldContain("Cannot find the .git directory"); } + [TestCase(" -help")] + [TestCase(" -version")] + public void WorkingDirectoryWithoutGitFolderDoesNotFailForVersionAndHelp(string argument) + { + var result = GitVersionHelper.ExecuteIn(workingDirectory: null, arguments: argument); + + result.ExitCode.ShouldBe(0); + result.Output.ShouldNotBeNull(); + } + [Test] public void WorkingDirectoryWithoutCommitsFailsWithInformativeMessage() { @@ -66,14 +83,15 @@ public void WorkingDirectoryWithoutCommitsFailsWithInformativeMessage() var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, null, false); result.ExitCode.ShouldNotBe(0); + result.Output.ShouldNotBeNull(); result.Output.ShouldContain("No commits found on the current branch."); } [Test] public void WorkingDirectoryDoesNotExistFailsWithInformativeMessage() { - var workingDirectory = PathHelper.Combine(ExecutableHelper.GetCurrentDirectory(), Guid.NewGuid().ToString("N")); - var executable = ExecutableHelper.GetExecutable(); + var workingDirectory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetCurrentDirectory(), Guid.NewGuid().ToString("N")); + var executable = ExecutableHelper.GetDotNetExecutable(); var output = new StringBuilder(); var args = ExecutableHelper.GetExecutableArgs($" /targetpath {workingDirectory} "); @@ -84,7 +102,7 @@ public void WorkingDirectoryDoesNotExistFailsWithInformativeMessage() null, executable, args, - ExecutableHelper.GetCurrentDirectory()); + FileSystemHelper.Path.GetCurrentDirectory()); exitCode.ShouldNotBe(0); var outputString = output.ToString(); diff --git a/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj b/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj index d178a4dc93..da4bb57cc0 100644 --- a/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj +++ b/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj @@ -1,14 +1,11 @@ - - net48;netcoreapp3.1;net5.0;net6.0 - - true - - + + + @@ -19,16 +16,13 @@ - - - - + + - - + diff --git a/src/GitVersion.App.Tests/HelpWriterTests.cs b/src/GitVersion.App.Tests/HelpWriterTests.cs index e43330ba5b..38ef352b1f 100644 --- a/src/GitVersion.App.Tests/HelpWriterTests.cs +++ b/src/GitVersion.App.Tests/HelpWriterTests.cs @@ -1,8 +1,6 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -21,26 +19,43 @@ public void AllArgsAreInHelp() { var lookup = new Dictionary { + { nameof(Arguments.IsHelp), "/?" }, + { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.TargetUrl), "/url" }, - { nameof(Arguments.Init), "init" }, { nameof(Arguments.TargetBranch), "/b" }, + { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, + { nameof(Arguments.CommitId), "/c" }, + { nameof(Arguments.LogFilePath) , "/l" }, + { nameof(Arguments.Verbosity), "/verbosity" }, + { nameof(Arguments.Output) , "/output" }, { nameof(Arguments.OutputFile) , "/outputfile" }, - { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, - { nameof(Arguments.IsHelp), "/?" }, - { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.ShowVariable), "/showvariable" }, + { nameof(Arguments.Format), "/format" }, + { nameof(Arguments.UpdateWixVersionFile), "/updatewixversionfile" }, - { nameof(Arguments.ConfigFile), "/config" }, - { nameof(Arguments.Verbosity), "/verbosity" }, - { nameof(Arguments.CommitId), "/c" } + { nameof(Arguments.UpdateProjectFiles), "/updateprojectfiles" }, + { nameof(Arguments.UpdateAssemblyInfo), "/updateassemblyinfo" }, + { nameof(Arguments.EnsureAssemblyInfo), "/ensureassemblyinfo" }, + + { nameof(Arguments.ConfigurationFile), "/config" }, + { nameof(Arguments.ShowConfiguration), "/showconfig" }, + { nameof(Arguments.OverrideConfiguration), "/overrideconfig" }, + + { nameof(Arguments.NoCache), "/nocache" }, + { nameof(Arguments.NoFetch), "/nofetch" }, + { nameof(Arguments.NoNormalize), "/nonormalize" }, + { nameof(Arguments.AllowShallow), "/allowshallow" } }; - string helpText = string.Empty; + var helpText = string.Empty; this.helpWriter.WriteTo(s => helpText = s); var ignored = new[] { - nameof(Arguments.Authentication) + nameof(Arguments.Authentication), + nameof(Arguments.UpdateAssemblyInfoFileName) }; typeof(Arguments).GetFields() .Select(p => p.Name) @@ -49,10 +64,10 @@ public void AllArgsAreInHelp() .ShouldBeEmpty(); } - private static bool IsNotInHelp(IReadOnlyDictionary lookup, string propertyName, string helpText) + private static bool IsNotInHelp(Dictionary lookup, string propertyName, string helpText) { - if (lookup.ContainsKey(propertyName)) - return !helpText.Contains(lookup[propertyName]); + if (lookup.TryGetValue(propertyName, out var value)) + return !helpText.Contains(value); return !helpText.Contains("/" + propertyName.ToLower()); } diff --git a/src/GitVersion.App.Tests/Helpers/ArgumentBuilder.cs b/src/GitVersion.App.Tests/Helpers/ArgumentBuilder.cs index 26ea3b65c4..38678c4987 100644 --- a/src/GitVersion.App.Tests/Helpers/ArgumentBuilder.cs +++ b/src/GitVersion.App.Tests/Helpers/ArgumentBuilder.cs @@ -2,70 +2,28 @@ namespace GitVersion.App.Tests; -public class ArgumentBuilder +public class ArgumentBuilder(string? workingDirectory, string? additionalArguments, string? logFile) { - public ArgumentBuilder(string workingDirectory) => this.WorkingDirectory = workingDirectory; + public string? WorkingDirectory { get; } = workingDirectory; - public ArgumentBuilder(string workingDirectory, string? exec, string? execArgs, string? projectFile, string? projectArgs, string? logFile) - { - this.WorkingDirectory = workingDirectory; - this.exec = exec; - this.execArgs = execArgs; - this.projectFile = projectFile; - this.projectArgs = projectArgs; - this.LogFile = logFile; - } - - public ArgumentBuilder(string workingDirectory, string? additionalArguments, string? logFile) - { - this.WorkingDirectory = workingDirectory; - this.additionalArguments = additionalArguments; - this.LogFile = logFile; - } - - public string WorkingDirectory { get; } - - public string? LogFile { get; } + public string? LogFile { get; } = logFile; public override string ToString() { var arguments = new StringBuilder(); - arguments.Append($" /targetpath \"{this.WorkingDirectory}\""); - - if (!this.exec.IsNullOrWhiteSpace()) - { - arguments.Append($" /exec \"{this.exec}\""); - } - - if (!this.execArgs.IsNullOrWhiteSpace()) - { - arguments.Append($" /execArgs \"{this.execArgs}\""); - } - - if (!this.projectFile.IsNullOrWhiteSpace()) + if (!this.WorkingDirectory.IsNullOrWhiteSpace()) { - arguments.Append($" /proj \"{this.projectFile}\""); - } - - if (!this.projectArgs.IsNullOrWhiteSpace()) - { - arguments.Append($" /projargs \"{this.projectArgs}\""); + arguments.Append(" /targetpath \"").Append(this.WorkingDirectory).Append('\"'); } if (!this.LogFile.IsNullOrWhiteSpace()) { - arguments.Append($" /l \"{this.LogFile}\""); + arguments.Append(" /l \"").Append(this.LogFile).Append('\"'); } - arguments.Append(this.additionalArguments); + arguments.Append(additionalArguments); return arguments.ToString(); } - - private readonly string? additionalArguments; - private readonly string? exec; - private readonly string? execArgs; - private readonly string? projectArgs; - private readonly string? projectFile; } diff --git a/src/GitVersion.App.Tests/Helpers/AssemblyParallelizable.cs b/src/GitVersion.App.Tests/Helpers/AssemblyParallelizable.cs index 9ae285d9ea..fdd365b7e2 100644 --- a/src/GitVersion.App.Tests/Helpers/AssemblyParallelizable.cs +++ b/src/GitVersion.App.Tests/Helpers/AssemblyParallelizable.cs @@ -1,3 +1 @@ -using NUnit.Framework; - [assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/src/GitVersion.App.Tests/Helpers/ExecutableHelper.cs b/src/GitVersion.App.Tests/Helpers/ExecutableHelper.cs new file mode 100644 index 0000000000..f2a25a29b2 --- /dev/null +++ b/src/GitVersion.App.Tests/Helpers/ExecutableHelper.cs @@ -0,0 +1,12 @@ +using GitVersion.Helpers; + +namespace GitVersion.App.Tests.Helpers; + +public static class ExecutableHelper +{ + public static string GetDotNetExecutable() => "dotnet"; + + public static string GetExecutableArgs(string args) => $"{FileSystemHelper.Path.Combine(GetExeDirectory(), "gitversion.dll")} {args}"; + + private static string GetExeDirectory() => FileSystemHelper.Path.GetCurrentDirectory().Replace("GitVersion.App.Tests", "GitVersion.App"); +} diff --git a/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs b/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs index c56e6aef9d..6e436ffc9e 100644 --- a/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs +++ b/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs @@ -1,29 +1,26 @@ +using GitVersion.Core.Tests; +using GitVersion.Extensions; using GitVersion.OutputVariables; namespace GitVersion.App.Tests; -public class ExecutionResults +public class ExecutionResults(int exitCode, string? output, string? logContents = null) { - public ExecutionResults(int exitCode, string output, string? logContents) - { - ExitCode = exitCode; - Output = output; - Log = logContents; - } + public int ExitCode { get; } = exitCode; + public string? Output { get; } = output; + public string? Log { get; init; } = logContents; - public int ExitCode { get; } - public string Output { get; } - public string? Log { get; } - - public virtual VersionVariables OutputVariables + public GitVersionVariables? OutputVariables { get { - var jsonStartIndex = Output.IndexOf("{", StringComparison.Ordinal); - var jsonEndIndex = Output.IndexOf("}", StringComparison.Ordinal); + if (Output.IsNullOrWhiteSpace()) return null; + + var jsonStartIndex = Output.IndexOf('{'); + var jsonEndIndex = Output.IndexOf('}'); var json = Output.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex + 1); - return VersionVariables.FromJson(json); + return json.ToGitVersionVariables(); } } } diff --git a/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs b/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs index a06dc99b2c..dda67328cd 100644 --- a/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs +++ b/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs @@ -1,5 +1,5 @@ -using GitVersion.BuildAgents; -using GitVersion.Core.Tests.Helpers; +using GitVersion.Agents; +using GitVersion.App.Tests.Helpers; using GitVersion.Extensions; using GitVersion.Helpers; @@ -7,27 +7,13 @@ namespace GitVersion.App.Tests; public static class GitVersionHelper { - public static ExecutionResults ExecuteIn(string workingDirectory, - string? exec = null, - string? execArgs = null, - string? projectFile = null, - string? projectArgs = null, - bool logToFile = true, - params KeyValuePair[] environments - ) - { - var logFile = logToFile ? PathHelper.Combine(workingDirectory, "log.txt") : null; - var args = new ArgumentBuilder(workingDirectory, exec, execArgs, projectFile, projectArgs, logFile); - return ExecuteIn(args, environments); - } - public static ExecutionResults ExecuteIn( - string workingDirectory, + string? workingDirectory, string? arguments, bool logToFile = true, params KeyValuePair[] environments) { - var logFile = logToFile ? PathHelper.Combine(workingDirectory, "log.txt") : null; + var logFile = workingDirectory is not null && logToFile ? FileSystemHelper.Path.Combine(workingDirectory, "log.txt") : null; var args = new ArgumentBuilder(workingDirectory, arguments, logFile); return ExecuteIn(args, environments); } @@ -36,7 +22,7 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, params KeyValuePair[] environments ) { - var executable = ExecutableHelper.GetExecutable(); + var executable = ExecutableHelper.GetDotNetExecutable(); var output = new StringBuilder(); var environmentalVariables = new Dictionary @@ -52,14 +38,7 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, foreach (var (key, value) in environments) { - if (environmentalVariables.ContainsKey(key)) - { - environmentalVariables[key] = value; - } - else - { - environmentalVariables.Add(key, value); - } + environmentalVariables[key] = value; } var exitCode = -1; @@ -71,14 +50,16 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, Console.WriteLine("Executing: {0} {1}", executable, args); Console.WriteLine(); + var workingDirectory = arguments.WorkingDirectory ?? FileSystemHelper.Path.GetCurrentDirectory(); + exitCode = ProcessHelper.Run( s => output.AppendLine(s), s => output.AppendLine(s), null, executable, args, - arguments.WorkingDirectory, - environmentalVariables.ToArray()); + workingDirectory, + [.. environmentalVariables]); } catch (Exception exception) { @@ -96,12 +77,12 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, Console.WriteLine(); Console.WriteLine("-------------------------------------------------------"); - if (arguments.LogFile.IsNullOrWhiteSpace() || !File.Exists(arguments.LogFile)) + if (arguments.LogFile.IsNullOrWhiteSpace() || !FileSystemHelper.File.Exists(arguments.LogFile)) { - return new ExecutionResults(exitCode, output.ToString(), null); + return new(exitCode, output.ToString()); } - var logContents = File.ReadAllText(arguments.LogFile); + var logContents = FileSystemHelper.File.ReadAllText(arguments.LogFile); Console.WriteLine("Log from gitversion tool"); Console.WriteLine("-------------------------------------------------------"); Console.WriteLine(logContents); @@ -109,6 +90,6 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, Console.WriteLine(); Console.WriteLine("-------------------------------------------------------"); - return new ExecutionResults(exitCode, output.ToString(), logContents); + return new(exitCode, output.ToString(), logContents); } } diff --git a/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs b/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs index 20979e643c..a1ed7f10cb 100644 --- a/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs +++ b/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs @@ -1,15 +1,14 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; using GitVersion.Logging; -using GitVersion.OutputVariables; using Microsoft.Extensions.DependencyInjection; namespace GitVersion.App.Tests; public sealed class ProgramFixture { - private readonly IEnvironment environment; - private List> Overrides { get; } = new(); + private readonly TestEnvironment environment; + private List> Overrides { get; } = []; private readonly Lazy logger; private readonly Lazy output; @@ -23,19 +22,19 @@ public ProgramFixture(string workingDirectory = "") ILog log = new Log(logAppender); var consoleBuilder = new StringBuilder(); - IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + var consoleAdapter = new TestConsoleAdapter(consoleBuilder); this.environment = new TestEnvironment(); - Overrides.Add(services => + WithOverrides(services => { services.AddSingleton(log); - services.AddSingleton(consoleAdapter); - services.AddSingleton(this.environment); + services.AddSingleton(consoleAdapter); + services.AddSingleton(this.environment); }); - this.logger = new Lazy(() => logBuilder.ToString()); - this.output = new Lazy(() => consoleAdapter.ToString()); + this.logger = new(() => logBuilder.ToString()); + this.output = new(() => consoleAdapter.ToString()); } public void WithEnv(params KeyValuePair[] envs) @@ -46,50 +45,29 @@ public void WithEnv(params KeyValuePair[] envs) } } - public Task Run(string arg) + public void WithOverrides(Action action) => Overrides.Add(action); + + public Task Run(string arg) { - var args = arg.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); + var args = arg.Split([' '], StringSplitOptions.RemoveEmptyEntries); return Run(args); } - public async Task Run(params string[] args) + public async Task Run(params string[] args) { - // Create the application and override registrations. - var program = new Program(builder => Overrides.ForEach(action => action(builder))); - if (!this.workingDirectory.IsNullOrWhiteSpace()) { - args = new[] { "-targetpath", this.workingDirectory }.Concat(args).ToArray(); + args = ["-targetpath", this.workingDirectory, .. args]; } - await program.RunAsync(args); - return new ProgramFixtureResult - { - ExitCode = System.Environment.ExitCode, - Output = this.output.Value, - Log = this.logger.Value - }; - } -} + var builder = CliHost.CreateCliHostBuilder(args); -public class ProgramFixtureResult -{ - public int ExitCode { get; set; } - public string? Output { get; set; } - public string Log { get; set; } + Overrides.ForEach(action => action(builder.Services)); - public VersionVariables? OutputVariables - { - get - { - if (Output.IsNullOrWhiteSpace()) return null; - - var jsonStartIndex = Output.IndexOf("{", StringComparison.Ordinal); - var jsonEndIndex = Output.IndexOf("}", StringComparison.Ordinal); - var json = Output.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex + 1); + var host = builder.Build(); + var app = host.Services.GetRequiredService(); + await app.RunAsync(CancellationToken.None); - return VersionVariables.FromJson(json); - } + return new(SysEnv.ExitCode, this.output.Value, this.logger.Value); } - } diff --git a/src/GitVersion.App.Tests/Helpers/TestConsoleAdapter.cs b/src/GitVersion.App.Tests/Helpers/TestConsoleAdapter.cs deleted file mode 100644 index b5ce351058..0000000000 --- a/src/GitVersion.App.Tests/Helpers/TestConsoleAdapter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using GitVersion.Logging; - -namespace GitVersion.App.Tests; - -public class TestConsoleAdapter : IConsole -{ - private readonly StringBuilder sb; - public TestConsoleAdapter(StringBuilder sb) => this.sb = sb; - public void WriteLine(string? msg) => this.sb.AppendLine(msg); - - public void WriteLine() => this.sb.AppendLine(); - - public void Write(string? msg) => this.sb.Append(msg); - - public override string ToString() => this.sb.ToString(); - - public string ReadLine() => throw new NotImplementedException(); - - public IDisposable UseColor(ConsoleColor consoleColor) => Disposable.Empty; -} diff --git a/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs b/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs index 6a41333cd7..30d6d48108 100644 --- a/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs +++ b/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs @@ -1,9 +1,6 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; +using GitVersion.Core.Tests; using GitVersion.Helpers; -using GitVersion.OutputVariables; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -37,10 +34,11 @@ public void BeingOnBuildServerWithOutputJsonDoesNotFail() var result = GitVersionHelper.ExecuteIn(fixture.LocalRepositoryFixture.RepositoryPath, arguments: " /output json /output buildserver", environments: env); result.ExitCode.ShouldBe(0); - const string version = "0.1.0+4"; - result.Output.ShouldContain($"##teamcity[buildNumber '{version}']"); + const string expectedVersion = "0.0.1-5"; + result.Output.ShouldNotBeNull(); + result.Output.ShouldContain($"##teamcity[buildNumber '{expectedVersion}']"); result.OutputVariables.ShouldNotBeNull(); - result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(version); + result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion); } [TestCase("", "GitVersion.json")] @@ -56,16 +54,17 @@ public void BeingOnBuildServerWithOutputJsonAndOutputFileDoesNotFail(string outp var result = GitVersionHelper.ExecuteIn(fixture.LocalRepositoryFixture.RepositoryPath, arguments: $" /output json /output buildserver /output file /outputfile {outputFile}", environments: env); result.ExitCode.ShouldBe(0); - const string version = "0.1.0+4"; - result.Output.ShouldContain($"##teamcity[buildNumber '{version}']"); + const string expectedVersion = "0.0.1-5"; + result.Output.ShouldNotBeNull(); + result.Output.ShouldContain($"##teamcity[buildNumber '{expectedVersion}']"); result.OutputVariables.ShouldNotBeNull(); - result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(version); + result.OutputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion); - var filePath = PathHelper.Combine(fixture.LocalRepositoryFixture.RepositoryPath, fileName); - var json = File.ReadAllText(filePath); + var filePath = FileSystemHelper.Path.Combine(fixture.LocalRepositoryFixture.RepositoryPath, fileName); + var json = FileSystemHelper.File.ReadAllText(filePath); - var outputVariables = VersionVariables.FromJson(json); + var outputVariables = json.ToGitVersionVariables(); outputVariables.ShouldNotBeNull(); - outputVariables.FullSemVer.ShouldBeEquivalentTo(version); + outputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion); } } diff --git a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs index dbdf5342f8..c517d19aba 100644 --- a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs +++ b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs @@ -1,9 +1,10 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; +using GitVersion.Output; using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -12,13 +13,13 @@ public class PullRequestInBuildAgentTest { private const string PullRequestBranchName = "PR-5"; private static readonly string[] PrMergeRefs = - { + [ "refs/pull-requests/5/merge", "refs/pull/5/merge", "refs/heads/pull/5/head", "refs/remotes/pull/5/merge", "refs/remotes/pull-requests/5/merge" - }; + ]; [TestCaseSource(nameof(PrMergeRefs))] public async Task VerifyAzurePipelinesPullRequest(string pullRequestRef) @@ -132,7 +133,6 @@ public async Task VerifyTravisCIPullRequest(string pullRequestRef) [TestCaseSource(nameof(PrMergeRefs))] public async Task VerifyBitBucketPipelinesPullRequest(string pullRequestRef) { - var env = new Dictionary { { BitBucketPipelines.EnvironmentVariableName, "MyWorkspace" }, @@ -143,60 +143,66 @@ public async Task VerifyBitBucketPipelinesPullRequest(string pullRequestRef) private static async Task VerifyPullRequestVersionIsCalculatedProperly(string pullRequestRef, Dictionary env) { - using var fixture = new EmptyRepositoryFixture("main"); - var remoteRepositoryPath = ExecutableHelper.GetTempPath(); - RepositoryFixtureBase.Init(remoteRepositoryPath, "main"); - using (var remoteRepository = new Repository(remoteRepositoryPath)) - { - remoteRepository.Config.Set("user.name", "Test"); - remoteRepository.Config.Set("user.email", "test@email.com"); - fixture.Repository.Network.Remotes.Add("origin", remoteRepositoryPath); - Console.WriteLine("Created git repository at {0}", remoteRepositoryPath); - remoteRepository.MakeATaggedCommit("1.0.3"); - - var branch = remoteRepository.CreateBranch("FeatureBranch"); - Commands.Checkout(remoteRepository, branch); - remoteRepository.MakeCommits(2); - Commands.Checkout(remoteRepository, remoteRepository.Head.Tip.Sha); - //Emulate merge commit - var mergeCommitSha = remoteRepository.MakeACommit().Sha; - Commands.Checkout(remoteRepository, TestBase.MainBranch); // HEAD cannot be pointing at the merge commit - remoteRepository.Refs.Add(pullRequestRef, new ObjectId(mergeCommitSha)); - - // Checkout PR commit - Commands.Fetch((Repository)fixture.Repository, "origin", Array.Empty(), new FetchOptions(), null); - Commands.Checkout(fixture.Repository, mergeCommitSha); - } + using var fixture = new EmptyRepositoryFixture(); + var remoteRepositoryPath = FileSystemHelper.Path.GetRepositoryTempPath(); + RepositoryFixtureBase.Init(remoteRepositoryPath); + using var remoteRepository = new Repository(remoteRepositoryPath); + remoteRepository.Config.Set("user.name", "Test"); + remoteRepository.Config.Set("user.email", "test@email.com"); + fixture.Repository.Network.Remotes.Add("origin", remoteRepositoryPath); + Console.WriteLine("Created git repository at {0}", remoteRepositoryPath); + remoteRepository.MakeATaggedCommit("1.0.3"); + + var branch = remoteRepository.CreateBranch("FeatureBranch"); + Commands.Checkout(remoteRepository, branch); + remoteRepository.MakeCommits(2); + Commands.Checkout(remoteRepository, remoteRepository.Head.Tip.Sha); + //Emulate merge commit + var mergeCommitSha = remoteRepository.MakeACommit().Sha; + Commands.Checkout(remoteRepository, TestBase.MainBranch); // HEAD cannot be pointing at the merge commit + remoteRepository.Refs.Add(pullRequestRef, new ObjectId(mergeCommitSha)); + + // Checkout PR commit + Commands.Fetch(fixture.Repository, "origin", [], new FetchOptions(), null); + Commands.Checkout(fixture.Repository, mergeCommitSha); var programFixture = new ProgramFixture(fixture.RepositoryPath); - programFixture.WithEnv(env.ToArray()); + programFixture.WithOverrides(services => + { + services.AddModule(new GitVersionBuildAgentsModule()); + services.AddModule(new GitVersionOutputModule()); + }); + programFixture.WithEnv([.. env]); var result = await programFixture.Run(); result.ExitCode.ShouldBe(0); + result.Output.ShouldNotBeNull(); result.OutputVariables.ShouldNotBeNull(); - result.OutputVariables.FullSemVer.ShouldBe("1.0.4-PullRequest0005.3"); + result.OutputVariables.FullSemVer.ShouldBe("1.0.4-PullRequest5.3"); // Cleanup repository files - DirectoryHelper.DeleteDirectory(remoteRepositoryPath); + FileSystemHelper.Directory.DeleteDirectory(remoteRepositoryPath); } private static readonly object[] PrMergeRefInputs = - { + [ new object[] { "refs/pull-requests/5/merge", "refs/pull-requests/5/merge", false, true, false }, - new object[] { "refs/pull/5/merge", "refs/pull/5/merge", false, true, false}, + new object[] { "refs/pull/5/merge", "refs/pull/5/merge", false, true, false }, new object[] { "refs/heads/pull/5/head", "pull/5/head", true, false, false }, - new object[] { "refs/remotes/pull/5/merge", "pull/5/merge", false, true, true }, - }; + new object[] { "refs/remotes/pull/5/merge", "pull/5/merge", false, true, true } + ]; [TestCaseSource(nameof(PrMergeRefInputs))] public void VerifyPullRequestInput(string pullRequestRef, string friendly, bool isBranch, bool isPullRequest, bool isRemote) { var refName = new ReferenceName(pullRequestRef); - - Assert.AreEqual(friendly, refName.Friendly); - Assert.AreEqual(isBranch, refName.IsBranch); - Assert.AreEqual(isPullRequest, refName.IsPullRequest); - Assert.AreEqual(isRemote, refName.IsRemoteBranch); + using (Assert.EnterMultipleScope()) + { + Assert.That(refName.Friendly, Is.EqualTo(friendly)); + Assert.That(refName.IsLocalBranch, Is.EqualTo(isBranch)); + Assert.That(refName.IsPullRequest, Is.EqualTo(isPullRequest)); + Assert.That(refName.IsRemoteBranch, Is.EqualTo(isRemote)); + } } } diff --git a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs index 678fca3d4c..e615754a2b 100644 --- a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs +++ b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs @@ -1,5 +1,4 @@ using GitVersion; -using NUnit.Framework; namespace GitVersionExe.Tests; diff --git a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs index 3258565fba..fc31fa4a7d 100644 --- a/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs +++ b/src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs @@ -1,9 +1,7 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; namespace GitVersion.App.Tests; @@ -36,9 +34,9 @@ public async Task VerifyTagCheckoutOnGitHubActions() private static async Task VerifyTagCheckoutVersionIsCalculatedProperly(Dictionary env) { - using var fixture = new EmptyRepositoryFixture("main"); - var remoteRepositoryPath = ExecutableHelper.GetTempPath(); - RepositoryFixtureBase.Init(remoteRepositoryPath, "main"); + using var fixture = new EmptyRepositoryFixture(); + var remoteRepositoryPath = FileSystemHelper.Path.GetRepositoryTempPath(); + RepositoryFixtureBase.Init(remoteRepositoryPath); using (var remoteRepository = new Repository(remoteRepositoryPath)) { remoteRepository.Config.Set("user.name", "Test"); @@ -54,12 +52,12 @@ private static async Task VerifyTagCheckoutVersionIsCalculatedProperly(Dictionar remoteRepository.MergeNoFF("release/0.2.0", Generate.SignatureNow()); remoteRepository.MakeATaggedCommit("0.2.0"); - Commands.Fetch((Repository)fixture.Repository, "origin", Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.Repository, "origin", [], new FetchOptions(), null); Commands.Checkout(fixture.Repository, "0.2.0"); } var programFixture = new ProgramFixture(fixture.RepositoryPath); - programFixture.WithEnv(env.ToArray()); + programFixture.WithEnv([.. env]); var result = await programFixture.Run(); @@ -68,6 +66,6 @@ private static async Task VerifyTagCheckoutVersionIsCalculatedProperly(Dictionar result.OutputVariables.FullSemVer.ShouldBe("0.2.0"); // Cleanup repository files - DirectoryHelper.DeleteDirectory(remoteRepositoryPath); + FileSystemHelper.Directory.DeleteDirectory(remoteRepositoryPath); } } diff --git a/src/GitVersion.App.Tests/TestBuildFile.proj b/src/GitVersion.App.Tests/TestBuildFile.proj index 690b4d6748..464452d51b 100644 --- a/src/GitVersion.App.Tests/TestBuildFile.proj +++ b/src/GitVersion.App.Tests/TestBuildFile.proj @@ -1,4 +1,4 @@ - + diff --git a/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs b/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs index bd2672436a..f3ba06a794 100644 --- a/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs +++ b/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs @@ -1,8 +1,6 @@ -using GitTools.Testing; using GitVersion.Helpers; +using GitVersion.Output.WixUpdater; using GitVersion.OutputVariables; -using GitVersion.VersionConverters.WixUpdater; -using NUnit.Framework; namespace GitVersion.App.Tests; @@ -23,7 +21,7 @@ public void WixVersionFileCreationTest() fixture.MakeACommit(); GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /updatewixversionfile"); - Assert.IsTrue(File.Exists(PathHelper.Combine(fixture.RepositoryPath, this.wixVersionFileName))); + Assert.That(FileSystemHelper.File.Exists(FileSystemHelper.Path.Combine(fixture.RepositoryPath, this.wixVersionFileName)), Is.True); } [Test] @@ -38,10 +36,10 @@ public void WixVersionFileVarCountTest() GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /updatewixversionfile"); - var gitVersionVarsInWix = GetGitVersionVarsInWixFile(PathHelper.Combine(fixture.RepositoryPath, this.wixVersionFileName)); - var gitVersionVars = VersionVariables.AvailableVariables; + var gitVersionVarsInWix = GetGitVersionVarsInWixFile(FileSystemHelper.Path.Combine(fixture.RepositoryPath, this.wixVersionFileName)); + var gitVersionVars = GitVersionVariables.AvailableVariables; - Assert.AreEqual(gitVersionVars.Count(), gitVersionVarsInWix.Count); + Assert.That(gitVersionVarsInWix, Has.Count.EqualTo(gitVersionVars.Count)); } [Test] @@ -53,19 +51,23 @@ public void WixVersionFileContentTest() var gitVersionExecutionResults = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: null); var vars = gitVersionExecutionResults.OutputVariables; + vars.ShouldNotBeNull(); GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /updatewixversionfile"); - var gitVersionVarsInWix = GetGitVersionVarsInWixFile(PathHelper.Combine(fixture.RepositoryPath, this.wixVersionFileName)); - var gitVersionVars = VersionVariables.AvailableVariables; + var gitVersionVarsInWix = GetGitVersionVarsInWixFile(FileSystemHelper.Path.Combine(fixture.RepositoryPath, this.wixVersionFileName)); + var gitVersionVars = GitVersionVariables.AvailableVariables; foreach (var variable in gitVersionVars) { vars.TryGetValue(variable, out var value); - //Make sure the variable is present in the Wix file - Assert.IsTrue(gitVersionVarsInWix.ContainsKey(variable)); - //Make sure the values are equal - Assert.AreEqual(value, gitVersionVarsInWix[variable]); + Assert.Multiple(() => + { + //Make sure the variable is present in the Wix file + Assert.That(gitVersionVarsInWix.ContainsKey(variable), Is.True); + //Make sure the values are equal + Assert.That(gitVersionVarsInWix[variable], Is.EqualTo(value)); + }); } } diff --git a/src/GitVersion.App.Tests/VersionWriterTests.cs b/src/GitVersion.App.Tests/VersionWriterTests.cs index 5ce3a4be1c..bea307439b 100644 --- a/src/GitVersion.App.Tests/VersionWriterTests.cs +++ b/src/GitVersion.App.Tests/VersionWriterTests.cs @@ -1,8 +1,8 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.DependencyInjection; -using Mono.Cecil; -using NUnit.Framework; namespace GitVersion.App.Tests; @@ -22,38 +22,41 @@ public void WriteVersionShouldWriteFileVersionWithNoPrereleaseTag() { var asm = GenerateAssembly(new Version(1, 0, 0), ""); - string? version = string.Empty; + var version = string.Empty; this.versionWriter.WriteTo(asm, v => version = v); - - Assert.IsNotNull(asm); - Assert.AreEqual("1.0.0", version); + Assert.Multiple(() => + { + Assert.That(asm, Is.Not.Null); + Assert.That(version, Is.EqualTo("1.0.0")); + }); } [Test] public void WriteVersionShouldWriteFileVersionWithPrereleaseTag() { - var asm = GenerateAssembly(new Version(1, 0, 0), "-beta0004"); + var asm = GenerateAssembly(new Version(1, 0, 0), "-beta4"); - string? version = string.Empty; + var version = string.Empty; this.versionWriter.WriteTo(asm, v => version = v); - - Assert.IsNotNull(asm); - Assert.AreEqual("1.0.0-beta0004", version); + Assert.Multiple(() => + { + Assert.That(asm, Is.Not.Null); + Assert.That(version, Is.EqualTo("1.0.0-beta4")); + }); } private static Assembly GenerateAssembly(Version fileVersion, string prereleaseInfo) { - var definition = new AssemblyNameDefinition("test-asm", fileVersion); - - var asmDef = AssemblyDefinition.CreateAssembly(definition, "test-asm", ModuleKind.Dll); - var constructor = typeof(AssemblyInformationalVersionAttribute).GetConstructor(new[] { typeof(string) }); - var methodReference = asmDef.MainModule.ImportReference(constructor); - var customAttribute = new CustomAttribute(methodReference); - customAttribute.ConstructorArguments.Add(new CustomAttributeArgument(asmDef.MainModule.TypeSystem.String, fileVersion + prereleaseInfo)); - asmDef.CustomAttributes.Add(customAttribute); + var attribute = typeof(AssemblyInformationalVersionAttribute); + var csharpCode = $"""[assembly: {attribute.FullName}("{fileVersion + prereleaseInfo}")]"""; + var compilation = CSharpCompilation.Create("test-asm") + .WithOptions(new(OutputKind.DynamicallyLinkedLibrary)) + .AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location)) + .AddReferences(MetadataReference.CreateFromFile(attribute.Assembly.Location)) + .AddSyntaxTrees(CSharpSyntaxTree.ParseText(csharpCode)); using var memoryStream = new MemoryStream(); - asmDef.Write(memoryStream); + compilation.Emit(memoryStream); return Assembly.Load(memoryStream.ToArray()); } diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs index 0214ad1524..1f85a1b3d2 100644 --- a/src/GitVersion.App/ArgumentParser.cs +++ b/src/GitVersion.App/ArgumentParser.cs @@ -1,27 +1,28 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Agents; using GitVersion.Extensions; +using GitVersion.FileSystemGlobbing; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model; using GitVersion.OutputVariables; namespace GitVersion; -public class ArgumentParser : IArgumentParser +internal class ArgumentParser(IEnvironment environment, + IFileSystem fileSystem, + ICurrentBuildAgent buildAgent, + IConsole console, + IGlobbingResolver globbingResolver) + : IArgumentParser { - private readonly IEnvironment environment; - private readonly ICurrentBuildAgent buildAgent; - private readonly IConsole console; - private readonly IGlobbingResolver globbingResolver; - private const string defaultOutputFileName = "GitVersion.json"; + private readonly IEnvironment environment = environment.NotNull(); + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ICurrentBuildAgent buildAgent = buildAgent.NotNull(); + private readonly IConsole console = console.NotNull(); + private readonly IGlobbingResolver globbingResolver = globbingResolver.NotNull(); - public ArgumentParser(IEnvironment environment, ICurrentBuildAgent buildAgent, IConsole console, IGlobbingResolver globbingResolver) - { - this.environment = environment.NotNull(); - this.console = console.NotNull(); - this.globbingResolver = globbingResolver.NotNull(); - this.buildAgent = buildAgent.NotNull(); - } + private const string defaultOutputFileName = "GitVersion.json"; + private static readonly IEnumerable availableVariables = GitVersionVariables.AvailableVariables; public Arguments ParseArguments(string commandLineArguments) { @@ -36,7 +37,7 @@ public Arguments ParseArguments(string[] commandLineArguments) { var args = new Arguments { - TargetPath = System.Environment.CurrentDirectory + TargetPath = SysEnv.CurrentDirectory }; args.Output.Add(OutputType.Json); @@ -48,16 +49,7 @@ public Arguments ParseArguments(string[] commandLineArguments) return args; } - var firstArgument = commandLineArguments.First(); - - if (firstArgument.IsInit()) - { - return new Arguments - { - TargetPath = System.Environment.CurrentDirectory, - Init = true - }; - } + var firstArgument = commandLineArguments[0]; if (firstArgument.IsHelp()) { @@ -99,7 +91,7 @@ public Arguments ParseArguments(string[] commandLineArguments) // If the first argument is a switch, it should already have been consumed in the above loop, // or else a WarningException should have been thrown and we wouldn't end up here. arguments.TargetPath ??= firstArgumentIsSwitch - ? System.Environment.CurrentDirectory + ? SysEnv.CurrentDirectory : firstArgument; arguments.TargetPath = arguments.TargetPath.TrimEnd('/', '\\'); @@ -107,9 +99,28 @@ public Arguments ParseArguments(string[] commandLineArguments) if (!arguments.EnsureAssemblyInfo) arguments.UpdateAssemblyInfoFileName = ResolveFiles(arguments.TargetPath, arguments.UpdateAssemblyInfoFileName).ToHashSet(); arguments.NoFetch = arguments.NoFetch || this.buildAgent.PreventFetch(); + ValidateConfigurationFile(arguments); + return arguments; } + private void ValidateConfigurationFile(Arguments arguments) + { + if (arguments.ConfigurationFile.IsNullOrWhiteSpace()) return; + + if (FileSystemHelper.Path.IsPathRooted(arguments.ConfigurationFile)) + { + if (!this.fileSystem.File.Exists(arguments.ConfigurationFile)) throw new WarningException($"Could not find config file at '{arguments.ConfigurationFile}'"); + arguments.ConfigurationFile = FileSystemHelper.Path.GetFullPath(arguments.ConfigurationFile); + } + else + { + var configFilePath = FileSystemHelper.Path.GetFullPath(FileSystemHelper.Path.Combine(arguments.TargetPath, arguments.ConfigurationFile)); + if (!this.fileSystem.File.Exists(configFilePath)) throw new WarningException($"Could not find config file at '{configFilePath}'"); + arguments.ConfigurationFile = configFilePath; + } + } + private void ParseSwitchArguments(Arguments arguments, NameValueCollection switchesAndValues, int i) { var name = switchesAndValues.AllKeys[i]; @@ -142,11 +153,9 @@ private IEnumerable ResolveFiles(string workingDirectory, ISet? foreach (var file in assemblyInfoFiles) { - var paths = this.globbingResolver.Resolve(workingDirectory, file); - - foreach (var path in paths) + foreach (var path in this.globbingResolver.Resolve(workingDirectory, file)) { - yield return Path.GetFullPath(PathHelper.Combine(workingDirectory, path)); + yield return path; } } } @@ -157,7 +166,7 @@ private void ParseTargetPath(Arguments arguments, string? name, IReadOnlyList? values, string? value) @@ -288,7 +303,7 @@ private static bool ParseConfigArguments(Arguments arguments, string? name, IRea if (name.IsSwitch("config")) { EnsureArgumentValueCount(values); - arguments.ConfigFile = value; + arguments.ConfigurationFile = value; return true; } @@ -301,9 +316,8 @@ private static bool ParseConfigArguments(Arguments arguments, string? name, IRea if (!name.IsSwitch("showConfig")) return false; - arguments.ShowConfig = value.IsTrue() || !value.IsFalse(); + arguments.ShowConfiguration = value.IsTrue() || !value.IsFalse(); return true; - } private static bool ParseRemoteArguments(Arguments arguments, string? name, IReadOnlyList? values, string? value) @@ -343,14 +357,10 @@ private static bool ParseRemoteArguments(Arguments arguments, string? name, IRea return true; } - if (name.IsSwitch("b")) - { - EnsureArgumentValueCount(values); - arguments.TargetBranch = value; - return true; - } - - return false; + if (!name.IsSwitch("b")) return false; + EnsureArgumentValueCount(values); + arguments.TargetBranch = value; + return true; } private static void ParseShowVariable(Arguments arguments, string? value, string? name) @@ -359,19 +369,36 @@ private static void ParseShowVariable(Arguments arguments, string? value, string if (!value.IsNullOrWhiteSpace()) { - versionVariable = VersionVariables.AvailableVariables.SingleOrDefault(av => av.Equals(value.Replace("'", ""), StringComparison.CurrentCultureIgnoreCase)); + versionVariable = availableVariables.SingleOrDefault(av => av.Equals(value.Replace("'", ""), StringComparison.CurrentCultureIgnoreCase)); } if (versionVariable == null) { - var message = $"{name} requires a valid version variable. Available variables are:{System.Environment.NewLine}" + - string.Join(", ", VersionVariables.AvailableVariables.Select(x => string.Concat("'", x, "'"))); + var message = $"{name} requires a valid version variable. Available variables are:{FileSystemHelper.Path.NewLine}" + + string.Join(", ", availableVariables.Select(x => $"'{x}'")); throw new WarningException(message); } arguments.ShowVariable = versionVariable; } + private static void ParseFormat(Arguments arguments, string? value) + { + if (value.IsNullOrWhiteSpace()) + { + throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", availableVariables)); + } + + var foundVariable = availableVariables.Any(variable => value.Contains(variable, StringComparison.CurrentCultureIgnoreCase)); + + if (!foundVariable) + { + throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", availableVariables)); + } + + arguments.Format = value; + } + private static void ParseEnsureAssemblyInfo(Arguments arguments, string? value) { arguments.EnsureAssemblyInfo = true; @@ -400,7 +427,7 @@ private static void ParseOutput(Arguments arguments, IEnumerable? values { if (!Enum.TryParse(v, true, out OutputType outputType)) { - throw new WarningException($"Value '{v}' cannot be parsed as output type, please use 'json', 'file' or 'buildserver'"); + throw new WarningException($"Value '{v}' cannot be parsed as output type, please use 'json', 'file', 'buildserver' or 'dotenv'"); } arguments.Output.Add(outputType); @@ -409,12 +436,7 @@ private static void ParseOutput(Arguments arguments, IEnumerable? values private static void ParseVerbosity(Arguments arguments, string? value) { - // first try the old version, this check will be removed in version 6.0.0, making it a breaking change - if (Enum.TryParse(value, true, out LogLevel logLevel)) - { - arguments.Verbosity = LogExtensions.GetVerbosityForLevel(logLevel); - } - else if (!Enum.TryParse(value, true, out arguments.Verbosity)) + if (!Enum.TryParse(value, true, out arguments.Verbosity)) { throw new WarningException($"Could not parse Verbosity value '{value}'"); } @@ -425,7 +447,7 @@ private static void ParseOverrideConfig(Arguments arguments, IReadOnlyCollection if (values == null || values.Count == 0) return; - var parser = new OverrideConfigOptionParser(); + var parser = new OverrideConfigurationOptionParser(); // key=value foreach (var keyValueOption in values) @@ -437,13 +459,13 @@ private static void ParseOverrideConfig(Arguments arguments, IReadOnlyCollection } var optionKey = keyAndValue[0].ToLowerInvariant(); - if (!OverrideConfigOptionParser.SupportedProperties.Contains(optionKey)) + if (!OverrideConfigurationOptionParser.SupportedProperties.Contains(optionKey)) { throw new WarningException($"Could not parse /overrideconfig option: {keyValueOption}. Unsupported 'key'."); } parser.SetValue(optionKey, keyAndValue[1]); } - arguments.OverrideConfig = parser.GetConfig(); + arguments.OverrideConfiguration = parser.GetOverrideConfiguration(); } private static void ParseUpdateAssemblyInfo(Arguments arguments, string? value, IReadOnlyCollection? values) @@ -536,14 +558,14 @@ private static void EnsureArgumentValueCount(IReadOnlyList? values) } } - private static NameValueCollection CollectSwitchesAndValuesFromArguments(IList namedArguments, out bool firstArgumentIsSwitch) + private static NameValueCollection CollectSwitchesAndValuesFromArguments(string[] namedArguments, out bool firstArgumentIsSwitch) { firstArgumentIsSwitch = true; var switchesAndValues = new NameValueCollection(); string? currentKey = null; var argumentRequiresValue = false; - for (var i = 0; i < namedArguments.Count; i += 1) + for (var i = 0; i < namedArguments.Length; ++i) { var arg = namedArguments[i]; diff --git a/src/GitVersion.App/ArgumentParserExtensions.cs b/src/GitVersion.App/ArgumentParserExtensions.cs new file mode 100644 index 0000000000..852773f941 --- /dev/null +++ b/src/GitVersion.App/ArgumentParserExtensions.cs @@ -0,0 +1,82 @@ +using GitVersion.Core; +using GitVersion.Helpers; + +namespace GitVersion; + +internal static class ArgumentParserExtensions +{ + private static readonly string[] TrueValues = ["1", "true"]; + private static readonly string[] FalseValues = ["0", "false"]; + + public static bool IsTrue(this string? value) => TrueValues.Contains(value, StringComparer.OrdinalIgnoreCase); + + public static bool IsFalse(this string? value) => FalseValues.Contains(value, StringComparer.OrdinalIgnoreCase); + + public static bool IsValidPath(this string? path) + { + if (path == null) + return false; + + try + { + _ = FileSystemHelper.Path.GetFullPath(path); + } + catch + { + path = FileSystemHelper.Path.Combine(SysEnv.CurrentDirectory, path); + + try + { + _ = FileSystemHelper.Path.GetFullPath(path); + } + catch + { + return false; + } + } + + return FileSystemHelper.Directory.Exists(path); + } + + public static bool IsSwitchArgument(this string? value) + { + var patternRegex = RegexPatterns.Common.SwitchArgumentRegex(); + return value != null + && (value.StartsWith('-') || value.StartsWith('/')) + && !patternRegex.Match(value).Success; + //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names. + } + + public static bool IsSwitch(this string? value, string switchName) + { + if (value == null) + return false; + + if (value.StartsWith('-')) + { + value = value[1..]; + } + + if (value.StartsWith('/')) + { + value = value[1..]; + } + + return string.Equals(switchName, value, StringComparison.OrdinalIgnoreCase); + } + + public static bool IsHelp(this string singleArgument) => (singleArgument == "?") || singleArgument.IsSwitch("h") || singleArgument.IsSwitch("help") || singleArgument.IsSwitch("?"); + + public static bool ArgumentRequiresValue(this string argument, int argumentIndex) + { + var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache", "allowshallow" }; + + var argumentMightRequireValue = !booleanArguments.Contains(argument[1..], StringComparer.OrdinalIgnoreCase); + + // If this is the first argument that might be a target path, the argument starts with slash, and we're on an OS that supports paths with slashes, the argument does not require a value. + if (argumentMightRequireValue && argumentIndex == 0 && argument.StartsWith('/') && FileSystemHelper.Path.DirectorySeparatorChar == '/' && argument.IsValidPath()) + return false; + + return argumentMightRequireValue; + } +} diff --git a/src/GitVersion.App/Arguments.cs b/src/GitVersion.App/Arguments.cs index 29ba7baaa7..8c5ea2f74c 100644 --- a/src/GitVersion.App/Arguments.cs +++ b/src/GitVersion.App/Arguments.cs @@ -1,27 +1,23 @@ +using GitVersion.Git; using GitVersion.Logging; -using GitVersion.Model; -using GitVersion.Model.Configuration; namespace GitVersion; -public class Arguments +internal class Arguments { public AuthenticationInfo Authentication = new(); - public string? ConfigFile; - public Config? OverrideConfig; - public bool ShowConfig; + public string? ConfigurationFile; + public IReadOnlyDictionary OverrideConfiguration; + public bool ShowConfiguration; public string? TargetPath; - public bool UpdateWixVersionFile; - public string? TargetUrl; public string? TargetBranch; public string? CommitId; public string? ClonePath; - public bool Init; public bool Diag; public bool IsVersion; public bool IsHelp; @@ -29,13 +25,16 @@ public class Arguments public bool NoFetch; public bool NoCache; public bool NoNormalize; + public bool AllowShallow; public string? LogFilePath; public string? ShowVariable; + public string? Format; public string? OutputFile; public ISet Output = new HashSet(); public Verbosity Verbosity = Verbosity.Normal; + public bool UpdateWixVersionFile; public bool UpdateProjectFiles; public bool UpdateAssemblyInfo; public bool EnsureAssemblyInfo; @@ -45,7 +44,7 @@ public GitVersionOptions ToOptions() { var gitVersionOptions = new GitVersionOptions { - AssemblyInfo = + AssemblySettingsInfo = { UpdateProjectFiles = UpdateProjectFiles, UpdateAssemblyInfo = UpdateAssemblyInfo, @@ -53,18 +52,18 @@ public GitVersionOptions ToOptions() Files = UpdateAssemblyInfoFileName }, - Authentication = + AuthenticationInfo = { Username = this.Authentication.Username, Password = this.Authentication.Password, Token = this.Authentication.Token }, - ConfigInfo = + ConfigurationInfo = { - ConfigFile = ConfigFile, - OverrideConfig = OverrideConfig, - ShowConfig = ShowConfig + ConfigurationFile = ConfigurationFile, + OverrideConfiguration = OverrideConfiguration, + ShowConfiguration = ShowConfiguration }, RepositoryInfo = @@ -79,21 +78,22 @@ public GitVersionOptions ToOptions() { NoFetch = NoFetch, NoCache = NoCache, - NoNormalize = NoNormalize + NoNormalize = NoNormalize, + AllowShallow = AllowShallow }, WixInfo = { - ShouldUpdate = UpdateWixVersionFile + UpdateWixVersionFile = UpdateWixVersionFile }, - Init = Init, Diag = Diag, IsVersion = IsVersion, IsHelp = IsHelp, LogFilePath = LogFilePath, ShowVariable = ShowVariable, + Format = Format, Verbosity = Verbosity, Output = Output, OutputFile = OutputFile diff --git a/src/GitVersion.App/AssemblyInfo.cs b/src/GitVersion.App/AssemblyInfo.cs deleted file mode 100644 index 83c2d3c0f9..0000000000 --- a/src/GitVersion.App/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("AcceptanceTests")] -[assembly: InternalsVisibleTo("GitVersion.App.Tests")] diff --git a/src/GitVersion.App/CliHost.cs b/src/GitVersion.App/CliHost.cs new file mode 100644 index 0000000000..357e7df742 --- /dev/null +++ b/src/GitVersion.App/CliHost.cs @@ -0,0 +1,35 @@ +using GitVersion.Agents; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Output; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +namespace GitVersion; + +internal static class CliHost +{ + internal static HostApplicationBuilder CreateCliHostBuilder(string[] args) + { + var builder = Host.CreateApplicationBuilder(args); + + builder.Services.AddModule(new GitVersionCoreModule()); + builder.Services.AddModule(new GitVersionLibGit2SharpModule()); + builder.Services.AddModule(new GitVersionBuildAgentsModule()); + builder.Services.AddModule(new GitVersionConfigurationModule()); + builder.Services.AddModule(new GitVersionOutputModule()); + builder.Services.AddModule(new GitVersionAppModule()); + + builder.Services.AddSingleton(sp => + { + var arguments = sp.GetRequiredService().ParseArguments(args); + var gitVersionOptions = arguments.ToOptions(); + return Options.Create(gitVersionOptions); + }); + + builder.Services.AddSingleton(); + + return builder; + } +} diff --git a/src/GitVersion.App/FileAppender.cs b/src/GitVersion.App/FileAppender.cs new file mode 100644 index 0000000000..ca75930e87 --- /dev/null +++ b/src/GitVersion.App/FileAppender.cs @@ -0,0 +1,43 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.Logging; + +namespace GitVersion; + +internal class FileAppender : ILogAppender +{ + private readonly IFileSystem fileSystem; + private readonly string filePath; + + public FileAppender(IFileSystem fileSystem, string filePath) + { + this.fileSystem = fileSystem.NotNull(); + this.filePath = filePath; + + var logFile = this.fileSystem.FileInfo.New(FileSystemHelper.Path.GetFullPath(filePath)); + + logFile.Directory?.Create(); + if (logFile.Exists) return; + + using (logFile.CreateText()) { } + } + + public void WriteTo(LogLevel level, string message) + { + try + { + WriteLogEntry(this.filePath, message); + } + catch + { + // + } + } + + private void WriteLogEntry(string logFilePath, string str) + { + var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{FileSystemHelper.Path.NewLine}"; + this.fileSystem.File.AppendAllText(logFilePath, contents); + } +} diff --git a/src/GitVersion.App/FileSystemGlobbing/DirectoryInfoGlobbingWrapper.cs b/src/GitVersion.App/FileSystemGlobbing/DirectoryInfoGlobbingWrapper.cs new file mode 100644 index 0000000000..798e4ddbf3 --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/DirectoryInfoGlobbingWrapper.cs @@ -0,0 +1,92 @@ +using System.IO.Abstractions; + +namespace GitVersion.FileSystemGlobbing; + +internal sealed class DirectoryInfoGlobbingWrapper + : Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase +{ + private readonly IFileSystem fileSystem; + private readonly IDirectoryInfo directoryInfo; + private readonly bool isParentPath; + + public DirectoryInfoGlobbingWrapper(IFileSystem fileSystem, IDirectoryInfo directoryInfo) + : this(fileSystem, directoryInfo, isParentPath: false) + { + } + + private DirectoryInfoGlobbingWrapper( + IFileSystem fileSystem, + IDirectoryInfo directoryInfo, + bool isParentPath + ) + { + this.fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); + this.directoryInfo = directoryInfo ?? throw new ArgumentNullException(nameof(directoryInfo)); + this.isParentPath = isParentPath; + } + + public override string Name => this.isParentPath ? ".." : this.directoryInfo.Name; + + public override string FullName => this.directoryInfo.FullName; + + public override Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase? ParentDirectory => + this.directoryInfo.Parent is null + ? null + : new DirectoryInfoGlobbingWrapper(this.fileSystem, this.directoryInfo.Parent); + + public override IEnumerable EnumerateFileSystemInfos() + { + if (!this.directoryInfo.Exists) yield break; + IEnumerable fileSystemInfos; + try + { + fileSystemInfos = this.directoryInfo.EnumerateFileSystemInfos( + "*", + SearchOption.TopDirectoryOnly + ); + } + catch (DirectoryNotFoundException) + { + yield break; + } + + foreach (var fileSystemInfo in fileSystemInfos) + { + yield return fileSystemInfo switch + { + IDirectoryInfo info => new DirectoryInfoGlobbingWrapper(this.fileSystem, info), + IFileInfo info => new FileInfoGlobbingWrapper(this.fileSystem, info), + _ => new FileSystemInfoGlobbingWrapper(this.fileSystem, fileSystemInfo) + }; + } + } + + public override Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase? GetDirectory(string path) + { + var parentPath = string.Equals(path, "..", StringComparison.Ordinal); + + if (parentPath) + { + return new DirectoryInfoGlobbingWrapper( + this.fileSystem, + this.fileSystem.DirectoryInfo.New(this.fileSystem.Path.Combine(this.directoryInfo.FullName, path)), + parentPath + ); + } + + var dirs = this.directoryInfo.GetDirectories(path); + + return dirs switch + { + { Length: 1 } => new DirectoryInfoGlobbingWrapper(this.fileSystem, dirs[0], parentPath), + { Length: 0 } => null, + _ => throw new InvalidOperationException($"More than one sub directories are found under {this.directoryInfo.FullName} with name {path}.") + }; + } + + public override Microsoft.Extensions.FileSystemGlobbing.Abstractions.FileInfoBase GetFile(string path) + => new FileInfoGlobbingWrapper( + this.fileSystem, + this.fileSystem.FileInfo.New(this.fileSystem.Path.Combine(FullName, path)) + ); +} diff --git a/src/GitVersion.App/FileSystemGlobbing/FileInfoGlobbingWrapper.cs b/src/GitVersion.App/FileSystemGlobbing/FileInfoGlobbingWrapper.cs new file mode 100644 index 0000000000..cfd3e630da --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/FileInfoGlobbingWrapper.cs @@ -0,0 +1,28 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; + +namespace GitVersion.FileSystemGlobbing; + +/// +/// Initialize a new instance +/// +/// The filesystem +/// The file +internal sealed class FileInfoGlobbingWrapper(IFileSystem fileSystem, IFileInfo fileInfo) + : Microsoft.Extensions.FileSystemGlobbing.Abstractions.FileInfoBase +{ + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IFileInfo fileInfo = fileInfo.NotNull(); + + /// + public override string Name => this.fileInfo.Name; + + /// + public override string FullName => this.fileInfo.FullName; + + /// + public override Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase? ParentDirectory => + this.fileInfo.Directory is null + ? null + : new DirectoryInfoGlobbingWrapper(this.fileSystem, this.fileInfo.Directory); +} diff --git a/src/GitVersion.App/FileSystemGlobbing/FileSystemInfoGlobbingWrapper.cs b/src/GitVersion.App/FileSystemGlobbing/FileSystemInfoGlobbingWrapper.cs new file mode 100644 index 0000000000..3805e5726d --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/FileSystemInfoGlobbingWrapper.cs @@ -0,0 +1,20 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; + +namespace GitVersion.FileSystemGlobbing; + +internal sealed class FileSystemInfoGlobbingWrapper(IFileSystem fileSystem, IFileSystemInfo fileSystemInfo) : Microsoft.Extensions.FileSystemGlobbing.Abstractions.FileSystemInfoBase +{ + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IFileSystemInfo fileSystemInfo = fileSystemInfo.NotNull(); + + public override string Name => this.fileSystemInfo.Name; + + public override string FullName => this.fileSystemInfo.FullName; + + public override Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase ParentDirectory => + new DirectoryInfoGlobbingWrapper( + this.fileSystem, + this.fileSystem.DirectoryInfo.New(this.fileSystemInfo.FullName) + ); +} diff --git a/src/GitVersion.App/FileSystemGlobbing/GlobbingResolver.cs b/src/GitVersion.App/FileSystemGlobbing/GlobbingResolver.cs new file mode 100644 index 0000000000..fa4da4eb06 --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/GlobbingResolver.cs @@ -0,0 +1,17 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using Microsoft.Extensions.FileSystemGlobbing; + +namespace GitVersion.FileSystemGlobbing; + +internal class GlobbingResolver(IFileSystem fileSystem) : IGlobbingResolver +{ + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + + public IEnumerable Resolve(string workingDirectory, string pattern) + { + var matcher = new Matcher(StringComparison.OrdinalIgnoreCase); + matcher.AddInclude(pattern); + return matcher.GetResultsInFullPath(this.fileSystem, workingDirectory); + } +} diff --git a/src/GitVersion.App/FileSystemGlobbing/IGlobbingResolver.cs b/src/GitVersion.App/FileSystemGlobbing/IGlobbingResolver.cs new file mode 100644 index 0000000000..80da9c212c --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/IGlobbingResolver.cs @@ -0,0 +1,6 @@ +namespace GitVersion.FileSystemGlobbing; + +internal interface IGlobbingResolver +{ + IEnumerable Resolve(string workingDirectory, string pattern); +} diff --git a/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs b/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs new file mode 100644 index 0000000000..fa568b712b --- /dev/null +++ b/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs @@ -0,0 +1,76 @@ +using System.IO.Abstractions; +using Microsoft.Extensions.FileSystemGlobbing; + +namespace GitVersion.FileSystemGlobbing; + +internal static class MatcherExtensions +{ + public static PatternMatchingResult Execute( + this Matcher matcher, + IFileSystem fileSystem, + string directoryPath + ) + { + ArgumentNullException.ThrowIfNull(matcher); + ArgumentNullException.ThrowIfNull(fileSystem); + + return Execute(matcher, fileSystem, fileSystem.DirectoryInfo.New(directoryPath)); + } + + private static PatternMatchingResult Execute( + this Matcher matcher, + IFileSystem fileSystem, + IDirectoryInfo directoryInfo + ) + { + ArgumentNullException.ThrowIfNull(matcher); + ArgumentNullException.ThrowIfNull(fileSystem); + ArgumentNullException.ThrowIfNull(directoryInfo); + + return matcher.Execute(new DirectoryInfoGlobbingWrapper(fileSystem, directoryInfo)); + } + + public static IEnumerable GetResultsInFullPath( + this Matcher matcher, + IFileSystem fileSystem, + string directoryPath + ) + { + ArgumentNullException.ThrowIfNull(matcher); + ArgumentNullException.ThrowIfNull(fileSystem); + + return GetResultsInFullPath( + matcher, + fileSystem, + fileSystem.DirectoryInfo.New(directoryPath) + ); + } + + private static IEnumerable GetResultsInFullPath( + this Matcher matcher, + IFileSystem fileSystem, + IDirectoryInfo directoryInfo + ) + { + ArgumentNullException.ThrowIfNull(matcher); + ArgumentNullException.ThrowIfNull(fileSystem); + ArgumentNullException.ThrowIfNull(directoryInfo); + + var matches = Execute(matcher, fileSystem, directoryInfo); + + if (!matches.HasMatches) + { + return EmptyStringsEnumerable; + } + + var fsPath = fileSystem.Path; + var directoryFullName = directoryInfo.FullName; + + return matches.Files.Select(GetFullPath); + + string GetFullPath(FilePatternMatch match) => + fsPath.GetFullPath(fsPath.Combine(directoryFullName, match.Path)); + } + + private static readonly IEnumerable EmptyStringsEnumerable = []; +} diff --git a/src/GitVersion.App/GitVersion.App.csproj b/src/GitVersion.App/GitVersion.App.csproj index 19bfe98c4d..00c1587488 100644 --- a/src/GitVersion.App/GitVersion.App.csproj +++ b/src/GitVersion.App/GitVersion.App.csproj @@ -4,20 +4,10 @@ Exe GitVersion gitversion - netcoreapp3.1;net5.0;net6.0 AnyCPU MIT - - net48;$(TargetFrameworks); - - - - - net6.0 - - dotnet-gitversion GitVersion.Tool @@ -25,28 +15,26 @@ Derives SemVer information from a repository following GitFlow or GitHubFlow. This is the .NET Core Global Tool allowing usage of GitVersion from command line. - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + + + + + + + diff --git a/src/GitVersion.App/GitVersionApp.cs b/src/GitVersion.App/GitVersionApp.cs index 389acc127b..ae9bc0f9c4 100644 --- a/src/GitVersion.App/GitVersionApp.cs +++ b/src/GitVersion.App/GitVersionApp.cs @@ -5,37 +5,32 @@ namespace GitVersion; -internal class GitVersionApp : IHostedService +internal class GitVersionApp( + ILog log, + IHostApplicationLifetime applicationLifetime, + IGitVersionExecutor gitVersionExecutor, + IOptions options) { - private readonly IHostApplicationLifetime applicationLifetime; - private readonly IGitVersionExecutor gitVersionExecutor; - private readonly ILog log; - private readonly IOptions options; + private readonly ILog log = log.NotNull(); + private readonly IHostApplicationLifetime applicationLifetime = applicationLifetime.NotNull(); + private readonly IGitVersionExecutor gitVersionExecutor = gitVersionExecutor.NotNull(); + private readonly IOptions options = options.NotNull(); - public GitVersionApp(IHostApplicationLifetime applicationLifetime, IGitVersionExecutor gitVersionExecutor, ILog log, IOptions options) - { - this.options = options.NotNull(); - this.applicationLifetime = applicationLifetime.NotNull(); - this.gitVersionExecutor = gitVersionExecutor.NotNull(); - this.log = log.NotNull(); - } - public Task StartAsync(CancellationToken cancellationToken) + public Task RunAsync(CancellationToken _) { try { var gitVersionOptions = this.options.Value; this.log.Verbosity = gitVersionOptions.Verbosity; - System.Environment.ExitCode = this.gitVersionExecutor.Execute(gitVersionOptions); + SysEnv.ExitCode = this.gitVersionExecutor.Execute(gitVersionOptions); } catch (Exception exception) { Console.Error.WriteLine(exception.Message); - System.Environment.ExitCode = 1; + SysEnv.ExitCode = 1; } this.applicationLifetime.StopApplication(); return Task.CompletedTask; } - - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; } diff --git a/src/GitVersion.App/GitVersionAppModule.cs b/src/GitVersion.App/GitVersionAppModule.cs index abbfe807e7..c8cb45b42e 100644 --- a/src/GitVersion.App/GitVersionAppModule.cs +++ b/src/GitVersion.App/GitVersionAppModule.cs @@ -1,8 +1,9 @@ +using GitVersion.FileSystemGlobbing; using Microsoft.Extensions.DependencyInjection; namespace GitVersion; -public class GitVersionAppModule : IGitVersionModule +internal class GitVersionAppModule : IGitVersionModule { public void RegisterTypes(IServiceCollection services) { diff --git a/src/GitVersion.App/GitVersionExecutor.cs b/src/GitVersion.App/GitVersionExecutor.cs index eb4df79884..36199ac398 100644 --- a/src/GitVersion.App/GitVersionExecutor.cs +++ b/src/GitVersion.App/GitVersionExecutor.cs @@ -1,39 +1,41 @@ +using System.IO.Abstractions; using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model; namespace GitVersion; -public class GitVersionExecutor : IGitVersionExecutor +internal class GitVersionExecutor( + ILog log, + IFileSystem fileSystem, + IConsole console, + IVersionWriter versionWriter, + IHelpWriter helpWriter, + IConfigurationFileLocator configurationFileLocator, + IConfigurationProvider configurationProvider, + IConfigurationSerializer configurationSerializer, + IGitVersionCalculateTool gitVersionCalculateTool, + IGitVersionOutputTool gitVersionOutputTool, + IGitRepository gitRepository, + IGitRepositoryInfo repositoryInfo) + : IGitVersionExecutor { - private readonly ILog log; - private readonly IConsole console; - private readonly IConfigFileLocator configFileLocator; - private readonly IHelpWriter helpWriter; - private readonly IGitRepositoryInfo repositoryInfo; - private readonly IConfigProvider configProvider; - private readonly IGitVersionCalculateTool gitVersionCalculateTool; - private readonly IGitVersionOutputTool gitVersionOutputTool; - private readonly IVersionWriter versionWriter; - - public GitVersionExecutor(ILog log, IConsole console, - IConfigFileLocator configFileLocator, IConfigProvider configProvider, - IGitVersionCalculateTool gitVersionCalculateTool, IGitVersionOutputTool gitVersionOutputTool, - IVersionWriter versionWriter, IHelpWriter helpWriter, IGitRepositoryInfo repositoryInfo) - { - this.log = log.NotNull(); - this.console = console.NotNull(); - this.configFileLocator = configFileLocator.NotNull(); - this.configProvider = configProvider.NotNull(); + private readonly ILog log = log.NotNull(); + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IConsole console = console.NotNull(); + private readonly IVersionWriter versionWriter = versionWriter.NotNull(); + private readonly IHelpWriter helpWriter = helpWriter.NotNull(); - this.gitVersionCalculateTool = gitVersionCalculateTool.NotNull(); - this.gitVersionOutputTool = gitVersionOutputTool.NotNull(); + private readonly IConfigurationFileLocator configurationFileLocator = configurationFileLocator.NotNull(); + private readonly IConfigurationProvider configurationProvider = configurationProvider.NotNull(); + private readonly IConfigurationSerializer configurationSerializer = configurationSerializer.NotNull(); - this.versionWriter = versionWriter.NotNull(); - this.helpWriter = helpWriter.NotNull(); - this.repositoryInfo = repositoryInfo.NotNull(); - } + private readonly IGitVersionCalculateTool gitVersionCalculateTool = gitVersionCalculateTool.NotNull(); + private readonly IGitVersionOutputTool gitVersionOutputTool = gitVersionOutputTool.NotNull(); + private readonly IGitRepository gitRepository = gitRepository.NotNull(); + private readonly IGitRepositoryInfo repositoryInfo = repositoryInfo.NotNull(); public int Execute(GitVersionOptions gitVersionOptions) { @@ -53,7 +55,8 @@ public int Execute(GitVersionOptions gitVersionOptions) private int RunGitVersionTool(GitVersionOptions gitVersionOptions) { - var mutexName = this.repositoryInfo.DotGitDirectory?.Replace(Path.DirectorySeparatorChar.ToString(), "") ?? string.Empty; + this.gitRepository.DiscoverRepository(gitVersionOptions.WorkingDirectory); + var mutexName = this.repositoryInfo.DotGitDirectory?.Replace(FileSystemHelper.Path.DirectorySeparatorChar.ToString(), "") ?? string.Empty; using var mutex = new Mutex(true, $@"Global\gitversion{mutexName}", out var acquired); try @@ -65,33 +68,30 @@ private int RunGitVersionTool(GitVersionOptions gitVersionOptions) var variables = this.gitVersionCalculateTool.CalculateVersionVariables(); - var configuration = this.configProvider.Provide(gitVersionOptions.ConfigInfo.OverrideConfig); + var configuration = this.configurationProvider.Provide(gitVersionOptions.ConfigurationInfo.OverrideConfiguration); - this.gitVersionOutputTool.OutputVariables(variables, configuration.UpdateBuildNumber ?? true); + this.gitVersionOutputTool.OutputVariables(variables, configuration.UpdateBuildNumber); this.gitVersionOutputTool.UpdateAssemblyInfo(variables); this.gitVersionOutputTool.UpdateWixVersionFile(variables); } catch (WarningException exception) { - var error = $"An error occurred:{System.Environment.NewLine}{exception.Message}"; + var error = $"An error occurred:{FileSystemHelper.Path.NewLine}{exception.Message}"; this.log.Warning(error); return 1; } catch (Exception exception) { - var error = $"An unexpected error occurred:{System.Environment.NewLine}{exception}"; + var error = $"An unexpected error occurred:{FileSystemHelper.Path.NewLine}{exception}"; this.log.Error(error); - this.log.Info("Attempting to show the current git graph (please include in issue): "); - this.log.Info("Showing max of 100 commits"); - try { - GitExtensions.DumpGraph(gitVersionOptions.WorkingDirectory, mess => this.log.Info(mess), 100); + GitExtensions.DumpGraphLog(logMessage => this.log.Info(logMessage)); } catch (Exception dumpGraphException) { - this.log.Error("Couldn't dump the git graph due to the following error: " + dumpGraphException); + this.log.Error($"Couldn't dump the git graph due to the following error: {dumpGraphException}"); } return 1; } @@ -123,19 +123,17 @@ private bool HandleNonMainCommand(GitVersionOptions gitVersionOptions, out int e if (gitVersionOptions.Diag) { gitVersionOptions.Settings.NoCache = true; - gitVersionOptions.Output.Add(OutputType.BuildServer); } - ConfigureLogging(gitVersionOptions, this.log); + ConfigureLogging(gitVersionOptions, this.log, this.fileSystem); var workingDirectory = gitVersionOptions.WorkingDirectory; if (gitVersionOptions.Diag) { - this.log.Info("Dumping commit graph: "); - GitExtensions.DumpGraph(workingDirectory, mess => this.log.Info(mess), 100); + GitExtensions.DumpGraphLog(logMessage => this.log.Info(logMessage)); } - if (!Directory.Exists(workingDirectory)) + if (!this.fileSystem.Directory.Exists(workingDirectory)) { this.log.Warning($"The working directory '{workingDirectory}' does not exist."); } @@ -144,19 +142,15 @@ private bool HandleNonMainCommand(GitVersionOptions gitVersionOptions, out int e this.log.Info("Working directory: " + workingDirectory); } - this.configFileLocator.Verify(gitVersionOptions, this.repositoryInfo); - - if (gitVersionOptions.Init) + if (gitVersionOptions.ConfigurationInfo.ShowConfiguration) { - this.configProvider.Init(workingDirectory); - exitCode = 0; - return true; - } - - if (gitVersionOptions.ConfigInfo.ShowConfig) - { - var config = this.configProvider.Provide(workingDirectory); - this.console.WriteLine(config.ToString()); + if (gitVersionOptions.RepositoryInfo.TargetUrl.IsNullOrWhiteSpace()) + { + this.configurationFileLocator.Verify(workingDirectory, this.repositoryInfo.ProjectRootDirectory); + } + var configuration = this.configurationProvider.Provide(); + var configurationString = configurationSerializer.Serialize(configuration); + this.console.WriteLine(configurationString); exitCode = 0; return true; } @@ -165,16 +159,16 @@ private bool HandleNonMainCommand(GitVersionOptions gitVersionOptions, out int e return false; } - private static void ConfigureLogging(GitVersionOptions gitVersionOptions, ILog log) + private static void ConfigureLogging(GitVersionOptions gitVersionOptions, ILog log, IFileSystem fileSystem) { - if (gitVersionOptions.Output.Contains(OutputType.BuildServer) || gitVersionOptions.LogFilePath == "console" || gitVersionOptions.Init) + if (gitVersionOptions.Output.Contains(OutputType.BuildServer) || gitVersionOptions.LogFilePath == "console") { log.AddLogAppender(new ConsoleAppender()); } if (gitVersionOptions.LogFilePath != null && gitVersionOptions.LogFilePath != "console") { - log.AddLogAppender(new FileAppender(gitVersionOptions.LogFilePath)); + log.AddLogAppender(new FileAppender(fileSystem, gitVersionOptions.LogFilePath)); } } } diff --git a/src/GitVersion.App/GlobbingResolver.cs b/src/GitVersion.App/GlobbingResolver.cs deleted file mode 100644 index a79712f67f..0000000000 --- a/src/GitVersion.App/GlobbingResolver.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.FileSystemGlobbing; -using Microsoft.Extensions.FileSystemGlobbing.Abstractions; - -namespace GitVersion; - -public class GlobbingResolver : IGlobbingResolver -{ - private readonly Matcher matcher = new(StringComparison.OrdinalIgnoreCase); - - public IEnumerable Resolve(string workingDirectory, string pattern) - { - this.matcher.AddInclude(pattern); - return this.matcher.Execute(GetDirectoryInfoWrapper(workingDirectory)).Files.Select(file => file.Path); - } - - protected virtual DirectoryInfoBase GetDirectoryInfoWrapper(string workingDirectory) => new DirectoryInfoWrapper(new DirectoryInfo(workingDirectory)); -} diff --git a/src/GitVersion.App/HelpWriter.cs b/src/GitVersion.App/HelpWriter.cs index 664e281207..7bc0db8951 100644 --- a/src/GitVersion.App/HelpWriter.cs +++ b/src/GitVersion.App/HelpWriter.cs @@ -1,18 +1,13 @@ using GitVersion.Extensions; +using GitVersion.Helpers; using GitVersion.Logging; namespace GitVersion; -public class HelpWriter : IHelpWriter +internal class HelpWriter(IVersionWriter versionWriter, IConsole console) : IHelpWriter { - private readonly IVersionWriter versionWriter; - private readonly IConsole console; - - public HelpWriter(IVersionWriter versionWriter, IConsole console) - { - this.versionWriter = versionWriter.NotNull(); - this.console = console.NotNull(); - } + private readonly IVersionWriter versionWriter = versionWriter.NotNull(); + private readonly IConsole console = console.NotNull(); public void Write() => WriteTo(this.console.WriteLine); @@ -23,8 +18,7 @@ public void WriteTo(Action writeAction) this.versionWriter.WriteTo(assembly, v => version = v); var args = ArgumentList(); - var nl = System.Environment.NewLine; - var message = "GitVersion " + version + nl + nl + args; + var message = $"GitVersion {version}{FileSystemHelper.Path.NewLine}{FileSystemHelper.Path.NewLine}{args}"; writeAction(message); } diff --git a/src/GitVersion.App/IArgumentParser.cs b/src/GitVersion.App/IArgumentParser.cs index 0b54023c06..df71145f08 100644 --- a/src/GitVersion.App/IArgumentParser.cs +++ b/src/GitVersion.App/IArgumentParser.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IArgumentParser +internal interface IArgumentParser { Arguments ParseArguments(string commandLineArguments); Arguments ParseArguments(string[] commandLineArguments); diff --git a/src/GitVersion.App/IGitVersionExecutor.cs b/src/GitVersion.App/IGitVersionExecutor.cs index 0bca364649..d65689e765 100644 --- a/src/GitVersion.App/IGitVersionExecutor.cs +++ b/src/GitVersion.App/IGitVersionExecutor.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IGitVersionExecutor +internal interface IGitVersionExecutor { int Execute(GitVersionOptions gitVersionOptions); } diff --git a/src/GitVersion.App/IGlobbingResolver.cs b/src/GitVersion.App/IGlobbingResolver.cs deleted file mode 100644 index 161e649067..0000000000 --- a/src/GitVersion.App/IGlobbingResolver.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitVersion; - -public interface IGlobbingResolver -{ - public IEnumerable Resolve(string workingDirectory, string pattern); -} diff --git a/src/GitVersion.App/IHelpWriter.cs b/src/GitVersion.App/IHelpWriter.cs index 81c7b998b8..652badd469 100644 --- a/src/GitVersion.App/IHelpWriter.cs +++ b/src/GitVersion.App/IHelpWriter.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IHelpWriter +internal interface IHelpWriter { void Write(); void WriteTo(Action writeAction); diff --git a/src/GitVersion.App/IVersionWriter.cs b/src/GitVersion.App/IVersionWriter.cs index 736ec6a6f6..cadaec1b79 100644 --- a/src/GitVersion.App/IVersionWriter.cs +++ b/src/GitVersion.App/IVersionWriter.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IVersionWriter +internal interface IVersionWriter { void Write(Assembly assembly); void WriteTo(Assembly assembly, Action writeAction); diff --git a/src/GitVersion.App/OverrideConfigOptionParser.cs b/src/GitVersion.App/OverrideConfigOptionParser.cs deleted file mode 100644 index 4f18f59b03..0000000000 --- a/src/GitVersion.App/OverrideConfigOptionParser.cs +++ /dev/null @@ -1,101 +0,0 @@ -using GitVersion.Model.Configuration; -using YamlDotNet.Serialization; - -namespace GitVersion; - -internal class OverrideConfigOptionParser -{ - private static readonly Lazy> _lazySupportedProperties = - new(GetSupportedProperties, true); - - private readonly Lazy lazyConfig = new(); - - internal static ILookup SupportedProperties => _lazySupportedProperties.Value; - - /// - /// Dynamically creates of - /// properties supported as a part of command line '/overrideconfig' option. - /// - /// - /// - /// Lookup keys are created from to match 'GitVersion.yml' - /// options as close as possible. - /// - private static ILookup GetSupportedProperties() => typeof(Config).GetProperties(BindingFlags.Public | BindingFlags.Instance) - .Where( - pi => IsSupportedPropertyType(pi.PropertyType) - && pi.CanWrite - && pi.GetCustomAttributes(typeof(YamlMemberAttribute), false).Length > 0 - ) - .ToLookup( - pi => (pi.GetCustomAttributes(typeof(YamlMemberAttribute), false)[0] as YamlMemberAttribute)?.Alias, - pi => pi - ); - - /// - /// Checks if property of - /// is supported as a part of command line '/overrideconfig' option. - /// - /// Type we want to check. - /// True, if type is supported. - /// Only simple types are supported - private static bool IsSupportedPropertyType(Type propertyType) - { - Type unwrappedType = Nullable.GetUnderlyingType(propertyType) ?? propertyType; - - return unwrappedType == typeof(string) - || unwrappedType.IsEnum - || unwrappedType == typeof(int) - || unwrappedType == typeof(bool); - } - - internal void SetValue(string key, string value) - { - if (!SupportedProperties.Contains(key)) - return; - - var unwrappedText = QuotedStringHelpers.UnquoteText(value); - foreach (var pi in SupportedProperties[key]) - { - Type unwrapped = Nullable.GetUnderlyingType(pi.PropertyType) ?? pi.PropertyType; - - if (unwrapped == typeof(string)) - pi.SetValue(this.lazyConfig.Value, unwrappedText); - else if (unwrapped.IsEnum) - { - try - { - var parsedEnum = Enum.Parse(unwrapped, unwrappedText); - pi.SetValue(this.lazyConfig.Value, parsedEnum); - } - catch (ArgumentException) - { - var sb = new StringBuilder(); - - sb.Append($"Could not parse /overrideconfig option: {key}={value}."); - sb.AppendLine(" Ensure that 'value' is valid for specified 'key' enumeration: "); - foreach (var name in Enum.GetNames(unwrapped)) - sb.AppendLine(name); - - throw new WarningException(sb.ToString()); - } - } - else if (unwrapped == typeof(int)) - { - if (int.TryParse(unwrappedText, out int parsedInt)) - pi.SetValue(this.lazyConfig.Value, parsedInt); - else - throw new WarningException($"Could not parse /overrideconfig option: {key}={value}. Ensure that 'value' is valid integer number."); - } - else if (unwrapped == typeof(bool)) - { - if (bool.TryParse(unwrappedText, out bool parsedBool)) - pi.SetValue(this.lazyConfig.Value, parsedBool); - else - throw new WarningException($"Could not parse /overrideconfig option: {key}={value}. Ensure that 'value' is 'true' or 'false'."); - } - } - } - - internal Config? GetConfig() => this.lazyConfig.IsValueCreated ? this.lazyConfig.Value : null; -} diff --git a/src/GitVersion.App/OverrideConfigurationOptionParser.cs b/src/GitVersion.App/OverrideConfigurationOptionParser.cs new file mode 100644 index 0000000000..2b19243e63 --- /dev/null +++ b/src/GitVersion.App/OverrideConfigurationOptionParser.cs @@ -0,0 +1,56 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; + +namespace GitVersion; + +internal class OverrideConfigurationOptionParser +{ + private readonly Dictionary overrideConfiguration = []; + + private static readonly Lazy> _lazySupportedProperties = + new(GetSupportedProperties, true); + + internal static ILookup SupportedProperties => _lazySupportedProperties.Value; + + /// + /// Dynamically creates of + /// properties supported as a part of command line '/overrideconfig' option. + /// + /// + /// + /// Lookup keys are created from to match 'GitVersion.yml', 'GitVersion.yaml', '.GitVersion.yml' or '.GitVersion.yaml' file + /// options as close as possible. + /// + private static ILookup GetSupportedProperties() => typeof(GitVersionConfiguration).GetProperties(BindingFlags.Public | BindingFlags.Instance) + .Where( + pi => IsSupportedPropertyType(pi.PropertyType) + && pi.CanWrite + && pi.GetCustomAttributes(typeof(JsonPropertyNameAttribute), false).Length > 0 + ) + .ToLookup( + pi => (pi.GetCustomAttributes(typeof(JsonPropertyNameAttribute), false)[0] as JsonPropertyNameAttribute)?.Name, + pi => pi + ); + + /// + /// Checks if property of + /// is supported as a part of command line '/overrideconfig' option. + /// + /// Type we want to check. + /// True, if type is supported. + /// Only simple types are supported + private static bool IsSupportedPropertyType(Type propertyType) + { + var unwrappedType = Nullable.GetUnderlyingType(propertyType) ?? propertyType; + + return unwrappedType == typeof(string) + || unwrappedType.IsEnum + || unwrappedType == typeof(int) + || unwrappedType == typeof(bool) + || unwrappedType == typeof(VersionStrategies[]); + } + + internal void SetValue(string key, string value) => overrideConfiguration[key] = QuotedStringHelpers.UnquoteText(value); + + internal IReadOnlyDictionary GetOverrideConfiguration() => this.overrideConfiguration; +} diff --git a/src/GitVersion.App/Program.cs b/src/GitVersion.App/Program.cs index 373bce10af..f82d650445 100644 --- a/src/GitVersion.App/Program.cs +++ b/src/GitVersion.App/Program.cs @@ -1,39 +1,16 @@ -using GitVersion.Extensions; -using Microsoft.Extensions.Configuration; +using GitVersion; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -namespace GitVersion; +var builder = CliHost.CreateCliHostBuilder(args); -internal class Program -{ - private readonly Action? overrides; - - internal Program(Action? overrides = null) => this.overrides = overrides; - - private static async Task Main(string[] args) => await new Program().RunAsync(args); +var host = builder.Build(); +var app = host.Services.GetRequiredService(); - internal Task RunAsync(string[] args) => CreateHostBuilder(args).Build().RunAsync(); - - private IHostBuilder CreateHostBuilder(string[] args) => - new HostBuilder() - .ConfigureAppConfiguration((_, configApp) => configApp.AddCommandLine(args)) - .ConfigureServices((_, services) => - { - services.AddModule(new GitVersionCoreModule()); - services.AddModule(new GitVersionLibGit2SharpModule()); - services.AddModule(new GitVersionAppModule()); - - services.AddSingleton(sp => - { - var arguments = sp.GetRequiredService().ParseArguments(args); - var gitVersionOptions = arguments.ToOptions(); - return Options.Create(gitVersionOptions); - }); +var cts = new CancellationTokenSource(); +Console.CancelKeyPress += (_, _) => +{ + cts.Cancel(); + cts.Dispose(); +}; - this.overrides?.Invoke(services); - services.AddHostedService(); - }) - .UseConsoleLifetime(); -} +await app.RunAsync(cts.Token).ConfigureAwait(false); diff --git a/src/GitVersion.App/PublicAPI.Shipped.txt b/src/GitVersion.App/PublicAPI.Shipped.txt index 8c88bf07ad..7dc5c58110 100644 --- a/src/GitVersion.App/PublicAPI.Shipped.txt +++ b/src/GitVersion.App/PublicAPI.Shipped.txt @@ -1,68 +1 @@ #nullable enable -GitVersion.ArgumentParser -GitVersion.ArgumentParser.ArgumentParser(GitVersion.IEnvironment! environment, GitVersion.BuildAgents.ICurrentBuildAgent! buildAgent, GitVersion.Logging.IConsole! console, GitVersion.IGlobbingResolver! globbingResolver) -> void -GitVersion.ArgumentParser.ParseArguments(string! commandLineArguments) -> GitVersion.Arguments! -GitVersion.ArgumentParser.ParseArguments(string![]! commandLineArguments) -> GitVersion.Arguments! -GitVersion.Arguments -GitVersion.Arguments.Arguments() -> void -GitVersion.Arguments.Authentication -> GitVersion.AuthenticationInfo! -GitVersion.Arguments.ClonePath -> string? -GitVersion.Arguments.CommitId -> string? -GitVersion.Arguments.ConfigFile -> string? -GitVersion.Arguments.Diag -> bool -GitVersion.Arguments.EnsureAssemblyInfo -> bool -GitVersion.Arguments.Init -> bool -GitVersion.Arguments.IsHelp -> bool -GitVersion.Arguments.IsVersion -> bool -GitVersion.Arguments.LogFilePath -> string? -GitVersion.Arguments.NoCache -> bool -GitVersion.Arguments.NoFetch -> bool -GitVersion.Arguments.NoNormalize -> bool -GitVersion.Arguments.Output -> System.Collections.Generic.ISet! -GitVersion.Arguments.OutputFile -> string? -GitVersion.Arguments.OverrideConfig -> GitVersion.Model.Configuration.Config? -GitVersion.Arguments.ShowConfig -> bool -GitVersion.Arguments.ShowVariable -> string? -GitVersion.Arguments.TargetBranch -> string? -GitVersion.Arguments.TargetPath -> string? -GitVersion.Arguments.TargetUrl -> string? -GitVersion.Arguments.ToOptions() -> GitVersion.GitVersionOptions! -GitVersion.Arguments.UpdateAssemblyInfo -> bool -GitVersion.Arguments.UpdateAssemblyInfoFileName -> System.Collections.Generic.ISet! -GitVersion.Arguments.UpdateProjectFiles -> bool -GitVersion.Arguments.UpdateWixVersionFile -> bool -GitVersion.Arguments.Verbosity -> GitVersion.Logging.Verbosity -GitVersion.GitVersionAppModule -GitVersion.GitVersionAppModule.GitVersionAppModule() -> void -GitVersion.GitVersionAppModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.GitVersionExecutor -GitVersion.GitVersionExecutor.Execute(GitVersion.GitVersionOptions! gitVersionOptions) -> int -GitVersion.GitVersionExecutor.GitVersionExecutor(GitVersion.Logging.ILog! log, GitVersion.Logging.IConsole! console, GitVersion.Configuration.IConfigFileLocator! configFileLocator, GitVersion.Configuration.IConfigProvider! configProvider, GitVersion.IGitVersionCalculateTool! gitVersionCalculateTool, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, GitVersion.IVersionWriter! versionWriter, GitVersion.IHelpWriter! helpWriter, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.GlobbingResolver -GitVersion.GlobbingResolver.GlobbingResolver() -> void -GitVersion.GlobbingResolver.Resolve(string! workingDirectory, string! pattern) -> System.Collections.Generic.IEnumerable! -GitVersion.HelpWriter -GitVersion.HelpWriter.HelpWriter(GitVersion.IVersionWriter! versionWriter, GitVersion.Logging.IConsole! console) -> void -GitVersion.HelpWriter.Write() -> void -GitVersion.HelpWriter.WriteTo(System.Action! writeAction) -> void -GitVersion.IArgumentParser -GitVersion.IArgumentParser.ParseArguments(string! commandLineArguments) -> GitVersion.Arguments! -GitVersion.IArgumentParser.ParseArguments(string![]! commandLineArguments) -> GitVersion.Arguments! -GitVersion.IGitVersionExecutor -GitVersion.IGitVersionExecutor.Execute(GitVersion.GitVersionOptions! gitVersionOptions) -> int -GitVersion.IGlobbingResolver -GitVersion.IGlobbingResolver.Resolve(string! workingDirectory, string! pattern) -> System.Collections.Generic.IEnumerable! -GitVersion.IHelpWriter -GitVersion.IHelpWriter.Write() -> void -GitVersion.IHelpWriter.WriteTo(System.Action! writeAction) -> void -GitVersion.IVersionWriter -GitVersion.IVersionWriter.Write(System.Reflection.Assembly! assembly) -> void -GitVersion.IVersionWriter.WriteTo(System.Reflection.Assembly! assembly, System.Action! writeAction) -> void -GitVersion.QuotedStringHelpers -GitVersion.VersionWriter -GitVersion.VersionWriter.VersionWriter(GitVersion.Logging.IConsole! console) -> void -GitVersion.VersionWriter.Write(System.Reflection.Assembly! assembly) -> void -GitVersion.VersionWriter.WriteTo(System.Reflection.Assembly! assembly, System.Action! writeAction) -> void -static GitVersion.QuotedStringHelpers.SplitUnquoted(string? input, char splitChar) -> string![]! -static GitVersion.QuotedStringHelpers.UnquoteText(string! input) -> string! -virtual GitVersion.GlobbingResolver.GetDirectoryInfoWrapper(string! workingDirectory) -> Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase! diff --git a/src/GitVersion.App/PublicAPI.Unshipped.txt b/src/GitVersion.App/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/GitVersion.App/PublicAPI.Unshipped.txt +++ b/src/GitVersion.App/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.App/QuotedStringHelpers.cs b/src/GitVersion.App/QuotedStringHelpers.cs index 15a1c7fa8f..4a360a6428 100644 --- a/src/GitVersion.App/QuotedStringHelpers.cs +++ b/src/GitVersion.App/QuotedStringHelpers.cs @@ -2,7 +2,7 @@ namespace GitVersion; -public static class QuotedStringHelpers +internal static class QuotedStringHelpers { /// /// Splits input string based on split-character, ignoring split-character in @@ -23,16 +23,16 @@ public static class QuotedStringHelpers public static string[] SplitUnquoted(string? input, char splitChar) { if (input == null) - return Array.Empty(); + return []; var split = new List(); - bool isPreviousCharBackslash = false; - bool isInsideQuotes = false; + var isPreviousCharBackslash = false; + var isInsideQuotes = false; - int startIndex = 0; - for (int i = 0; i < input.Length; i++) + var startIndex = 0; + for (var i = 0; i < input.Length; i++) { - char current = input[i]; + var current = input[i]; switch (current) { case '"': @@ -50,9 +50,9 @@ public static string[] SplitUnquoted(string? input, char splitChar) isPreviousCharBackslash = current == '\\'; } - split.Add(input.Substring(startIndex, input.Length - startIndex)); + split.Add(input[startIndex..]); - return split.Where(argument => !argument.IsNullOrEmpty()).ToArray(); + return [.. split.Where(argument => !argument.IsNullOrEmpty())]; } /// @@ -71,7 +71,7 @@ public static string UnquoteText(string input) if (sb[0] == '"') sb.Remove(0, 1); - if (sb[sb.Length - 1] == '"' && sb[sb.Length - 2] != '\\') + if (sb[^1] == '"' && sb[^2] != '\\') sb.Remove(sb.Length - 1, 1); sb.Replace("\\\"", "\""); // unescape quotes. diff --git a/src/GitVersion.App/VersionWriter.cs b/src/GitVersion.App/VersionWriter.cs index a15889b9ad..41f5140d62 100644 --- a/src/GitVersion.App/VersionWriter.cs +++ b/src/GitVersion.App/VersionWriter.cs @@ -3,11 +3,10 @@ namespace GitVersion; -public class VersionWriter : IVersionWriter +internal class VersionWriter(IConsole console) : IVersionWriter { - private readonly IConsole console; + private readonly IConsole console = console.NotNull(); - public VersionWriter(IConsole console) => this.console = console.NotNull(); public void Write(Assembly assembly) => WriteTo(assembly, this.console.WriteLine); public void WriteTo(Assembly assembly, Action writeAction) diff --git a/src/GitVersion.Core.Tests/BuildAgents/AzurePipelinesTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs similarity index 59% rename from src/GitVersion.Core.Tests/BuildAgents/AzurePipelinesTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs index d14d9ec83c..79c27fb26c 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/AzurePipelinesTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs @@ -1,10 +1,7 @@ -using GitVersion.BuildAgents; using GitVersion.Core.Tests.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class AzurePipelinesTests : TestBase @@ -29,18 +26,18 @@ public void SetEnvironmentVariableForTest() public void ClearEnvironmentVariableForTest() => this.environment.SetEnvironmentVariable(key, null); [Test] - public void DevelopBranch() + public void ShouldSetBuildNumber() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); - var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; + var vsVersion = this.buildServer.SetBuildNumber(vars); vsVersion.ShouldBe("##vso[build.updatebuildnumber]Some Build_Value 0.0.0-Unstable4 20151310.3 $(UnknownVar) Release"); } [Test] - public void EscapeValues() + public void ShouldSetOutputVariables() { - var vsVersion = this.buildServer.GenerateSetParameterMessage("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); + var vsVersion = this.buildServer.SetOutputVariables("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); vsVersion.ShouldContain("##vso[task.setvariable variable=GitVersion.Foo]0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); vsVersion.ShouldContain("##vso[task.setvariable variable=GitVersion.Foo;isOutput=true]0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); @@ -52,8 +49,8 @@ public void MissingEnvShouldNotBlowUp() this.environment.SetEnvironmentVariable(key, null); const string semver = "0.0.0-Unstable4"; - var vars = new TestableVersionVariables(fullSemVer: semver); - var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = semver }; + var vsVersion = this.buildServer.SetBuildNumber(vars); vsVersion.ShouldBe(semver); } @@ -64,8 +61,8 @@ public void MissingEnvShouldNotBlowUp() public void AzurePipelinesBuildNumberWithFullSemVer(string buildNumberFormat, string myFullSemVer, string expectedBuildNumber) { this.environment.SetEnvironmentVariable(key, buildNumberFormat); - var vars = new TestableVersionVariables(fullSemVer: myFullSemVer); - var logMessage = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = myFullSemVer }; + var logMessage = this.buildServer.SetBuildNumber(vars); logMessage.ShouldBe(logPrefix + expectedBuildNumber); } @@ -76,8 +73,47 @@ public void AzurePipelinesBuildNumberWithFullSemVer(string buildNumberFormat, st public void AzurePipelinesBuildNumberWithSemVer(string buildNumberFormat, string mySemVer, string expectedBuildNumber) { this.environment.SetEnvironmentVariable(key, buildNumberFormat); - var vars = new TestableVersionVariables(semVer: mySemVer); - var logMessage = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { SemVer = mySemVer }; + var logMessage = this.buildServer.SetBuildNumber(vars); logMessage.ShouldBe(logPrefix + expectedBuildNumber); } + + [Test] + public void GetCurrentBranchShouldHandleBranches() + { + // Arrange + this.environment.SetEnvironmentVariable("BUILD_SOURCEBRANCH", $"refs/heads/{MainBranch}"); + + // Act + var result = this.buildServer.GetCurrentBranch(false); + + // Assert + result.ShouldBe($"refs/heads/{MainBranch}"); + } + + [Test] + public void GetCurrentBranchShouldHandleTags() + { + // Arrange + this.environment.SetEnvironmentVariable("BUILD_SOURCEBRANCH", "refs/tags/1.0.0"); + + // Act + var result = this.buildServer.GetCurrentBranch(false); + + // Assert + result.ShouldBeNull(); + } + + [Test] + public void GetCurrentBranchShouldHandlePullRequests() + { + // Arrange + this.environment.SetEnvironmentVariable("BUILD_SOURCEBRANCH", "refs/pull/1/merge"); + + // Act + var result = this.buildServer.GetCurrentBranch(false); + + // Assert + result.ShouldBe("refs/pull/1/merge"); + } } diff --git a/src/GitVersion.Core.Tests/BuildAgents/BitBucketPipelinesTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs similarity index 63% rename from src/GitVersion.Core.Tests/BuildAgents/BitBucketPipelinesTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs index ecd5218fa0..a443730955 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/BitBucketPipelinesTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs @@ -1,17 +1,17 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class BitBucketPipelinesTests : TestBase { private IEnvironment environment; + private IFileSystem fileSystem; private BitBucketPipelines buildServer; private IServiceProvider sp; @@ -19,13 +19,13 @@ public class BitBucketPipelinesTests : TestBase public void SetEnvironmentVariableForTest() { this.sp = ConfigureServices(services => services.AddSingleton()); - this.environment = sp.GetRequiredService(); - this.buildServer = sp.GetRequiredService(); + this.environment = this.sp.GetRequiredService(); + this.fileSystem = this.sp.GetRequiredService(); + this.buildServer = this.sp.GetRequiredService(); this.environment.SetEnvironmentVariable(BitBucketPipelines.EnvironmentVariableName, "MyWorkspace"); } - [Test] public void CanNotApplyToCurrentContextWhenEnvironmentVariableNotSet() { @@ -45,8 +45,8 @@ public void CalculateVersionOnMainBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/main"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3"); - var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3" }; + var vsVersion = this.buildServer.SetBuildNumber(vars); vsVersion.ShouldBe("1.2.3"); } @@ -57,8 +57,8 @@ public void CalculateVersionOnDevelopBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/develop"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3-unstable.4"); - var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3-unstable.4" }; + var vsVersion = this.buildServer.SetBuildNumber(vars); vsVersion.ShouldBe("1.2.3-unstable.4"); } @@ -69,8 +69,8 @@ public void CalculateVersionOnFeatureBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/feature/my-work"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3-beta.4"); - var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3-beta.4" }; + var vsVersion = this.buildServer.SetBuildNumber(vars); vsVersion.ShouldBe("1.2.3-beta.4"); } @@ -85,7 +85,7 @@ public void GetCurrentBranchShouldHandleBranches() var result = this.buildServer.GetCurrentBranch(false); // Assert - result.ShouldBe($"refs/heads/feature/my-work"); + result.ShouldBe("refs/heads/feature/my-work"); } [Test] @@ -117,25 +117,26 @@ public void GetCurrentBranchShouldHandlePullRequests() result.ShouldBeNull(); } - [Test] public void WriteAllVariablesToTheTextWriter() { - var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var assemblyLocation = FileSystemHelper.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); assemblyLocation.ShouldNotBeNull(); - var f = PathHelper.Combine(assemblyLocation, "gitversion.properties"); + var propertyFile = FileSystemHelper.Path.Combine(assemblyLocation, "gitversion.properties"); + var ps1File = FileSystemHelper.Path.Combine(assemblyLocation, "gitversion.ps1"); try { - AssertVariablesAreWrittenToFile(f); + AssertVariablesAreWrittenToFile(propertyFile, ps1File); } finally { - File.Delete(f); + this.fileSystem.File.Delete(propertyFile); + this.fileSystem.File.Delete(ps1File); } } - private void AssertVariablesAreWrittenToFile(string file) + private void AssertVariablesAreWrittenToFile(string propertyFile, string ps1File) { var writes = new List(); var semanticVersion = new SemanticVersion @@ -144,30 +145,36 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = "5" + BuildMetaData = new SemanticVersionBuildMetaData("5") { Sha = "f28807e615e9f06aec8a33c87780374e0c1f6fb8", CommitDate = new DateTimeOffset(2022, 4, 6, 16, 10, 59, TimeSpan.FromHours(10)) } }; - semanticVersion.BuildMetaData.CommitDate = new DateTimeOffset(2022, 4, 6, 16, 10, 59, TimeSpan.FromHours(10)); - semanticVersion.BuildMetaData.Sha = "f28807e615e9f06aec8a33c87780374e0c1f6fb8"; - - var config = new TestEffectiveConfiguration(); var variableProvider = this.sp.GetRequiredService(); - var variables = variableProvider.GetVariablesFor(semanticVersion, config, false); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); - this.buildServer.WithPropertyFile(file); + this.buildServer.WithPropertyFile(propertyFile); + this.buildServer.WithPowershellFile(ps1File); this.buildServer.WriteIntegration(writes.Add, variables); writes[1].ShouldBe("1.2.3-beta.1+5"); - File.Exists(file).ShouldBe(true); + this.fileSystem.File.Exists(propertyFile).ShouldBe(true); - var props = File.ReadAllText(file); + var props = this.fileSystem.File.ReadAllText(propertyFile); props.ShouldContain("export GITVERSION_MAJOR=1"); props.ShouldContain("export GITVERSION_MINOR=2"); props.ShouldContain("export GITVERSION_SHA=f28807e615e9f06aec8a33c87780374e0c1f6fb8"); props.ShouldContain("export GITVERSION_COMMITDATE=2022-04-06"); + + this.fileSystem.File.Exists(ps1File).ShouldBe(true); + + var psProps = this.fileSystem.File.ReadAllText(ps1File); + + psProps.ShouldContain("$GITVERSION_MAJOR = \"1\""); + psProps.ShouldContain("$GITVERSION_MINOR = \"2\""); + psProps.ShouldContain("$GITVERSION_SHA = \"f28807e615e9f06aec8a33c87780374e0c1f6fb8\""); + psProps.ShouldContain("$GITVERSION_COMMITDATE = \"2022-04-06\""); } } diff --git a/src/GitVersion.Core.Tests/BuildAgents/BuildKiteTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs similarity index 83% rename from src/GitVersion.Core.Tests/BuildAgents/BuildKiteTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs index 4bbd4541fb..516bf2da94 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/BuildKiteTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs @@ -1,10 +1,7 @@ -using GitVersion.BuildAgents; using GitVersion.Core.Tests.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class BuildKiteTests : TestBase @@ -76,23 +73,23 @@ public void GetCurrentBranchShouldHandlePullRequests() } [Test] - public void GetSetParameterMessageShouldReturnEmptyArray() + public void ShouldSetOutputVariables() { // Act - var result = this.buildServer.GenerateSetParameterMessage("Foo", "Bar"); + var result = this.buildServer.SetOutputVariables("Foo", "Bar"); // Assert result.ShouldBeEmpty(); } [Test] - public void GetEmptyGenerateSetVersionMessage() + public void ShouldSetBuildNumber() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act - var message = this.buildServer.GenerateSetVersionMessage(vars); + var message = this.buildServer.SetBuildNumber(vars); // Assert message.ShouldBeEmpty(); diff --git a/src/GitVersion.Core.Tests/BuildAgents/BuildServerBaseTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs similarity index 62% rename from src/GitVersion.Core.Tests/BuildAgents/BuildServerBaseTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs index ceacebd38b..44200014a9 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/BuildServerBaseTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs @@ -1,13 +1,12 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Logging; using GitVersion.OutputVariables; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class BuildServerBaseTests : TestBase @@ -32,37 +31,32 @@ public void BuildNumberIsFullSemVer() Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = "5" + BuildMetaData = new SemanticVersionBuildMetaData("5") + { + Sha = "commitSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semanticVersion.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - semanticVersion.BuildMetaData.Sha = "commitSha"; - - var config = new TestEffectiveConfiguration(); - - var variables = this.buildServer.GetVariablesFor(semanticVersion, config, false); + var variables = this.buildServer.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); var buildAgent = this.sp.GetRequiredService(); buildAgent.WriteIntegration(writes.Add, variables); writes[1].ShouldBe("1.2.3-beta.1+5"); - writes = new List(); + writes = []; buildAgent.WriteIntegration(writes.Add, variables, false); - writes.ShouldNotContain(x => x != null && x.StartsWith("Executing GenerateSetVersionMessage for ")); + writes.ShouldNotContain(x => x != null && x.StartsWith("Set Build Number for ")); } - private class BuildAgent : BuildAgentBase + private class BuildAgent(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { protected override string EnvironmentVariable => throw new NotImplementedException(); - public BuildAgent(IEnvironment environment, ILog log) : base(environment, log) - { - } - public override bool CanApplyToCurrentContext() => throw new NotImplementedException(); - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); + public override string[] SetOutputVariables(string name, string? value) => []; } } diff --git a/src/GitVersion.Core.Tests/BuildAgents/CodeBuildTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/CodeBuildTests.cs similarity index 75% rename from src/GitVersion.Core.Tests/BuildAgents/CodeBuildTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/CodeBuildTests.cs index b81e4f1e91..9924a3da9e 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/CodeBuildTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/CodeBuildTests.cs @@ -1,17 +1,17 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public sealed class CodeBuildTests : TestBase { private IEnvironment environment; + private IFileSystem fileSystem; private IServiceProvider sp; private CodeBuild buildServer; @@ -20,6 +20,7 @@ public void SetUp() { this.sp = ConfigureServices(services => services.AddSingleton()); this.environment = this.sp.GetRequiredService(); + this.fileSystem = this.sp.GetRequiredService(); this.buildServer = this.sp.GetRequiredService(); } @@ -54,9 +55,9 @@ public void PicksUpBranchNameFromEnvironmentFromWebHook() [Test] public void WriteAllVariablesToTheTextWriter() { - var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var assemblyLocation = FileSystemHelper.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); assemblyLocation.ShouldNotBeNull(); - var f = PathHelper.Combine(assemblyLocation, "codebuild_this_file_should_be_deleted.properties"); + var f = FileSystemHelper.Path.Combine(assemblyLocation, "codebuild_this_file_should_be_deleted.properties"); try { @@ -64,7 +65,7 @@ public void WriteAllVariablesToTheTextWriter() } finally { - File.Delete(f); + this.fileSystem.File.Delete(f); } } @@ -77,17 +78,16 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = "5" + BuildMetaData = new SemanticVersionBuildMetaData("5") + { + Sha = "commitSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semanticVersion.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - semanticVersion.BuildMetaData.Sha = "commitSha"; - - var config = new TestEffectiveConfiguration(); - var variableProvider = this.sp.GetRequiredService(); - var variables = variableProvider.GetVariablesFor(semanticVersion, config, false); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); this.buildServer.WithPropertyFile(file); @@ -95,9 +95,9 @@ private void AssertVariablesAreWrittenToFile(string file) writes[1].ShouldBe("1.2.3-beta.1+5"); - File.Exists(file).ShouldBe(true); + this.fileSystem.File.Exists(file).ShouldBe(true); - var props = File.ReadAllText(file); + var props = this.fileSystem.File.ReadAllText(file); props.ShouldContain("GitVersion_Major=1"); props.ShouldContain("GitVersion_Minor=2"); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs new file mode 100644 index 0000000000..6ed2ff100e --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs @@ -0,0 +1,22 @@ +using GitVersion.Core.Tests.Helpers; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Agents.Tests; + +[TestFixture] +public class ContinuaCiTests : TestBase +{ + private IServiceProvider sp; + + [SetUp] + public void SetUp() => this.sp = ConfigureServices(services => services.AddSingleton()); + + [Test] + public void ShouldSetBuildNumber() + { + var buildServer = this.sp.GetRequiredService(); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; + var continuaCiVersion = buildServer.SetBuildNumber(vars); + Assert.That(continuaCiVersion, Is.EqualTo("@@continua[setBuildVersion value='0.0.0-Beta4.7']")); + } +} diff --git a/src/GitVersion.Core.Tests/BuildAgents/DroneTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/DroneTests.cs similarity index 97% rename from src/GitVersion.Core.Tests/BuildAgents/DroneTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/DroneTests.cs index be4181fb3c..4e65698cca 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/DroneTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/DroneTests.cs @@ -1,10 +1,7 @@ -using GitVersion.BuildAgents; using GitVersion.Core.Tests.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class DroneTests : TestBase diff --git a/src/GitVersion.Core.Tests/BuildAgents/EnvRunTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs similarity index 70% rename from src/GitVersion.Core.Tests/BuildAgents/EnvRunTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs index 73ae7dcbdc..86604b2737 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/EnvRunTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs @@ -1,11 +1,9 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class EnvRunTests : TestBase @@ -13,6 +11,7 @@ public class EnvRunTests : TestBase private const string EnvVarName = "ENVRUN_DATABASE"; private string mFilePath; private IEnvironment environment; + private IFileSystem fileSystem; private EnvRun buildServer; [SetUp] @@ -20,19 +19,20 @@ public void SetEnvironmentVariableForTest() { var sp = ConfigureServices(services => services.AddSingleton()); this.environment = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); this.buildServer = sp.GetRequiredService(); // set environment variable and create an empty envrun file to indicate that EnvRun is running... - this.mFilePath = PathHelper.Combine(Path.GetTempPath(), "envrun.db"); + this.mFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "envrun.db"); this.environment.SetEnvironmentVariable(EnvVarName, this.mFilePath); - File.OpenWrite(this.mFilePath).Dispose(); + this.fileSystem.File.OpenWrite(this.mFilePath).Dispose(); } [TearDown] public void ClearEnvironmentVariableForTest() { this.environment.SetEnvironmentVariable(EnvVarName, null); - File.Delete(this.mFilePath); + this.fileSystem.File.Delete(this.mFilePath); } [Test] @@ -52,18 +52,18 @@ public void CanApplyToCurrentContextEnvironmentVariableNotSet() [TestCase("1.2.3")] [TestCase("1.2.3-rc4")] - public void GenerateSetVersionMessage(string fullSemVer) + public void ShouldSetBuildNumber(string fullSemVer) { - var vars = new TestableVersionVariables(fullSemVer: fullSemVer); - var version = this.buildServer.GenerateSetVersionMessage(vars); + var vars = new TestableGitVersionVariables { FullSemVer = fullSemVer }; + var version = this.buildServer.SetBuildNumber(vars); version.ShouldBe(fullSemVer); } [TestCase("Version", "1.2.3", "@@envrun[set name='GitVersion_Version' value='1.2.3']")] [TestCase("Version", "1.2.3-rc4", "@@envrun[set name='GitVersion_Version' value='1.2.3-rc4']")] - public void GenerateSetParameterMessage(string name, string value, string expected) + public void ShouldSetOutputVariables(string name, string? value, string expected) { - var output = this.buildServer.GenerateSetParameterMessage(name, value); + var output = this.buildServer.SetOutputVariables(name, value); output.ShouldHaveSingleItem(); output[0].ShouldBe(expected); } diff --git a/src/GitVersion.Core.Tests/BuildAgents/GitHubActionsTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs similarity index 66% rename from src/GitVersion.Core.Tests/BuildAgents/GitHubActionsTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs index f4fbc1b621..2e0e258a13 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/GitHubActionsTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs @@ -1,15 +1,15 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class GitHubActionsTests : TestBase { private IEnvironment environment; + private IFileSystem fileSystem; private GitHubActions buildServer; private string? githubSetEnvironmentTempFilePath; @@ -18,10 +18,12 @@ public void SetUp() { var sp = ConfigureServices(services => services.AddSingleton()); this.environment = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); this.buildServer = sp.GetRequiredService(); this.environment.SetEnvironmentVariable(GitHubActions.EnvironmentVariableName, "true"); + this.environment.SetEnvironmentVariable("GITHUB_REF_TYPE", "branch"); - this.githubSetEnvironmentTempFilePath = Path.GetTempFileName(); + this.githubSetEnvironmentTempFilePath = FileSystemHelper.Path.GetRandomFileName(); this.environment.SetEnvironmentVariable(GitHubActions.GitHubSetEnvTempFileEnvironmentVariableName, this.githubSetEnvironmentTempFilePath); } @@ -30,10 +32,10 @@ public void TearDown() { this.environment.SetEnvironmentVariable(GitHubActions.EnvironmentVariableName, null); this.environment.SetEnvironmentVariable(GitHubActions.GitHubSetEnvTempFileEnvironmentVariableName, null); - if (this.githubSetEnvironmentTempFilePath == null || !File.Exists(this.githubSetEnvironmentTempFilePath)) + if (this.githubSetEnvironmentTempFilePath == null || !this.fileSystem.File.Exists(this.githubSetEnvironmentTempFilePath)) return; - File.Delete(this.githubSetEnvironmentTempFilePath); + this.fileSystem.File.Delete(this.githubSetEnvironmentTempFilePath); this.githubSetEnvironmentTempFilePath = null; } @@ -77,13 +79,14 @@ public void GetCurrentBranchShouldHandleBranches() public void GetCurrentBranchShouldHandleTags() { // Arrange + this.environment.SetEnvironmentVariable("GITHUB_REF_TYPE", "tag"); this.environment.SetEnvironmentVariable("GITHUB_REF", "refs/tags/1.0.0"); // Act var result = this.buildServer.GetCurrentBranch(false); // Assert - result.ShouldBe("refs/tags/1.0.0"); + result.ShouldBeNull(); } [Test] @@ -100,23 +103,23 @@ public void GetCurrentBranchShouldHandlePullRequests() } [Test] - public void GetSetParameterMessage() + public void ShouldSetOutputVariables() { // Assert this.environment.GetEnvironmentVariable("GitVersion_Something").ShouldBeNullOrWhiteSpace(); // Act - var result = this.buildServer.GenerateSetParameterMessage("GitVersion_Something", "1.0.0"); + var result = this.buildServer.SetOutputVariables("GitVersion_Something", "1.0.0"); // Assert - result.ShouldContain(s => true, 0); + result.ShouldContain(_ => true, 0); } [Test] - public void SkipEmptySetParameterMessage() + public void SkipEmptyOutputVariables() { // Act - var result = this.buildServer.GenerateSetParameterMessage("Hello", string.Empty); + var result = this.buildServer.SetOutputVariables("Hello", string.Empty); // Assert result.ShouldBeEquivalentTo(Array.Empty()); @@ -126,7 +129,7 @@ public void SkipEmptySetParameterMessage() public void ShouldWriteIntegration() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { Major = "1.0.0" }; var list = new List(); @@ -137,24 +140,15 @@ public void ShouldWriteIntegration() this.buildServer.WriteIntegration(s => list.Add(s), vars); // Assert - var expected = new List - { - "Executing GenerateSetVersionMessage for 'GitHubActions'.", - "", - "Executing GenerateBuildLogOutput for 'GitHubActions'.", - "Writing version variables to $GITHUB_ENV file for 'GitHubActions'." - }; - - string.Join(System.Environment.NewLine, list) - .ShouldBe(string.Join(System.Environment.NewLine, expected)); - - var expectedFileContents = new List - { - "GitVersion_Major=1.0.0" - }; + var expected = new List { "Set Build Number for 'GitHubActions'.", "", "Set Output Variables for 'GitHubActions'.", "Writing version variables to $GITHUB_ENV file for 'GitHubActions'." }; + + string.Join(FileSystemHelper.Path.NewLine, list) + .ShouldBe(string.Join(FileSystemHelper.Path.NewLine, expected)); + + var expectedFileContents = new List { "GitVersion_Major=1.0.0" }; this.githubSetEnvironmentTempFilePath.ShouldNotBeNull(); - var actualFileContents = File.ReadAllLines(this.githubSetEnvironmentTempFilePath); + var actualFileContents = this.fileSystem.File.ReadAllLines(this.githubSetEnvironmentTempFilePath); actualFileContents.ShouldBe(expectedFileContents); } @@ -163,7 +157,7 @@ public void ShouldWriteIntegration() public void ShouldNotWriteIntegration() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; var list = new List(); @@ -173,17 +167,17 @@ public void ShouldNotWriteIntegration() // Act this.buildServer.WriteIntegration(s => list.Add(s), vars, false); - list.ShouldNotContain(x => x != null && x.StartsWith("Executing GenerateSetVersionMessage for ")); + list.ShouldNotContain(x => x != null && x.StartsWith("Set Build Number for ")); } [Test] - public void GetEmptyGenerateSetVersionMessage() + public void ShouldSetBuildNumber() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act - var message = this.buildServer.GenerateSetVersionMessage(vars); + var message = this.buildServer.SetBuildNumber(vars); // Assert message.ShouldBeEmpty(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs new file mode 100644 index 0000000000..457955b088 --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs @@ -0,0 +1,145 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; +using GitVersion.VersionCalculation; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Agents.Tests; + +[TestFixture] +public class GitLabCiTests : TestBase +{ + private IEnvironment environment; + private IFileSystem fileSystem; + private IServiceProvider sp; + private GitLabCi buildServer; + + [SetUp] + public void SetUp() + { + this.sp = ConfigureServices(services => services.AddSingleton()); + this.environment = this.sp.GetRequiredService(); + this.fileSystem = this.sp.GetRequiredService(); + this.buildServer = this.sp.GetRequiredService(); + this.environment.SetEnvironmentVariable(GitLabCi.EnvironmentVariableName, "true"); + } + + [TearDown] + public void TearDown() => this.environment.SetEnvironmentVariable(GitLabCi.EnvironmentVariableName, null); + + [Test] + public void ShouldSetBuildNumber() + { + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; + this.buildServer.SetBuildNumber(vars).ShouldBe("0.0.0-Beta4.7"); + } + + [Test] + public void ShouldSetOutputVariables() + { + var result = this.buildServer.SetOutputVariables("name", "value"); + result.Length.ShouldBe(1); + result[0].ShouldBe("GitVersion_name=value"); + } + + [TestCase("main", "main")] + [TestCase("dev", "dev")] + [TestCase("development", "development")] + [TestCase("my_cool_feature", "my_cool_feature")] + [TestCase("#3-change_projectname", "#3-change_projectname")] + public void GetCurrentBranchShouldHandleBranches(string branchName, string expectedResult) + { + this.environment.SetEnvironmentVariable("CI_COMMIT_REF_NAME", branchName); + + var result = this.buildServer.GetCurrentBranch(false); + + result.ShouldBe(expectedResult); + } + + [TestCase("main", "", "main")] + [TestCase("v1.0.0", "v1.0.0", null)] + [TestCase("development", "", "development")] + [TestCase("v1.2.1", "v1.2.1", null)] + public void GetCurrentBranchShouldHandleTags(string branchName, string commitTag, string? expectedResult) + { + this.environment.SetEnvironmentVariable("CI_COMMIT_REF_NAME", branchName); + this.environment.SetEnvironmentVariable("CI_COMMIT_TAG", commitTag); // only set in pipelines for tags + + var result = this.buildServer.GetCurrentBranch(false); + + if (!string.IsNullOrEmpty(expectedResult)) + { + result.ShouldBe(expectedResult); + } + else + { + result.ShouldBeNull(); + } + } + + [TestCase("main", "main")] + [TestCase("dev", "dev")] + [TestCase("development", "development")] + [TestCase("my_cool_feature", "my_cool_feature")] + [TestCase("#3-change_projectname", "#3-change_projectname")] + public void GetCurrentBranchShouldHandlePullRequests(string branchName, string expectedResult) + { + this.environment.SetEnvironmentVariable("CI_COMMIT_REF_NAME", branchName); + + var result = this.buildServer.GetCurrentBranch(false); + + result.ShouldBe(expectedResult); + } + + [Test] + public void WriteAllVariablesToTheTextWriter() + { + var assemblyLocation = FileSystemHelper.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + assemblyLocation.ShouldNotBeNull(); + var f = FileSystemHelper.Path.Combine(assemblyLocation, "jenkins_this_file_should_be_deleted.properties"); + + try + { + AssertVariablesAreWrittenToFile(f); + } + finally + { + this.fileSystem.File.Delete(f); + } + } + + private void AssertVariablesAreWrittenToFile(string file) + { + var writes = new List(); + var semanticVersion = new SemanticVersion + { + Major = 1, + Minor = 2, + Patch = 3, + PreReleaseTag = "beta1", + BuildMetaData = new SemanticVersionBuildMetaData("5") + { + Sha = "commitSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } + }; + + var variableProvider = this.sp.GetRequiredService(); + + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); + + this.buildServer.WithPropertyFile(file); + + this.buildServer.WriteIntegration(writes.Add, variables); + + writes[1].ShouldBe("1.2.3-beta.1+5"); + + this.fileSystem.File.Exists(file).ShouldBe(true); + + var props = this.fileSystem.File.ReadAllText(file); + + props.ShouldContain("GitVersion_Major=1"); + props.ShouldContain("GitVersion_Minor=2"); + } +} diff --git a/src/GitVersion.Core.Tests/BuildAgents/JenkinsTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs similarity index 79% rename from src/GitVersion.Core.Tests/BuildAgents/JenkinsTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs index 896b9aacab..6c23d10ec2 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/JenkinsTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs @@ -1,12 +1,11 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersion.Core.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class JenkinsTests : TestBase @@ -16,6 +15,7 @@ public class JenkinsTests : TestBase private const string localBranch = "GIT_LOCAL_BRANCH"; private const string pipelineBranch = "BRANCH_NAME"; private IEnvironment environment; + private IFileSystem fileSystem; private IServiceProvider sp; private Jenkins buildServer; @@ -24,6 +24,7 @@ public void SetUp() { this.sp = ConfigureServices(services => services.AddSingleton()); this.environment = this.sp.GetRequiredService(); + this.fileSystem = this.sp.GetRequiredService(); this.buildServer = this.sp.GetRequiredService(); } @@ -93,26 +94,26 @@ public void JenkinsTakesBranchNameInPipelineAsCode() } [Test] - public void GenerateSetVersionMessageReturnsVersionAsIsAlthoughThisIsNotUsedByJenkins() + public void ShouldSetBuildNumber() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); - this.buildServer.GenerateSetVersionMessage(vars).ShouldBe("0.0.0-Beta4.7"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; + this.buildServer.SetBuildNumber(vars).ShouldBe("0.0.0-Beta4.7"); } [Test] - public void GenerateMessageTest() + public void ShouldSetOutputVariables() { - var generatedParameterMessages = this.buildServer.GenerateSetParameterMessage("name", "value"); - generatedParameterMessages.Length.ShouldBe(1); - generatedParameterMessages[0].ShouldBe("GitVersion_name=value"); + var result = this.buildServer.SetOutputVariables("name", "value"); + result.Length.ShouldBe(1); + result[0].ShouldBe("GitVersion_name=value"); } [Test] public void WriteAllVariablesToTheTextWriter() { - var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var assemblyLocation = FileSystemHelper.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); assemblyLocation.ShouldNotBeNull(); - var f = PathHelper.Combine(assemblyLocation, "gitlab_this_file_should_be_deleted.properties"); + var f = FileSystemHelper.Path.Combine(assemblyLocation, "gitlab_this_file_should_be_deleted.properties"); try { @@ -120,7 +121,7 @@ public void WriteAllVariablesToTheTextWriter() } finally { - File.Delete(f); + this.fileSystem.File.Delete(f); } } @@ -133,17 +134,12 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = "5" + BuildMetaData = new SemanticVersionBuildMetaData("5") { Sha = "commitSha", CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") } }; - semanticVersion.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - semanticVersion.BuildMetaData.Sha = "commitSha"; - - var config = new TestEffectiveConfiguration(); - var variableProvider = this.sp.GetRequiredService(); - var variables = variableProvider.GetVariablesFor(semanticVersion, config, false); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); this.buildServer.WithPropertyFile(file); @@ -151,9 +147,9 @@ private void AssertVariablesAreWrittenToFile(string file) writes[1].ShouldBe("1.2.3-beta.1+5"); - File.Exists(file).ShouldBe(true); + this.fileSystem.File.Exists(file).ShouldBe(true); - var props = File.ReadAllText(file); + var props = this.fileSystem.File.ReadAllText(file); props.ShouldContain("GitVersion_Major=1"); props.ShouldContain("GitVersion_Minor=2"); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs new file mode 100644 index 0000000000..9894f777ef --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs @@ -0,0 +1,32 @@ +using GitVersion.Core.Tests.Helpers; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Agents.Tests; + +[TestFixture] +public class MyGetTests : TestBase +{ + private MyGet buildServer; + + [SetUp] + public void SetUp() + { + var sp = ConfigureServices(services => services.AddSingleton()); + this.buildServer = sp.GetRequiredService(); + } + + [Test] + public void ShouldSetBuildNumber() + { + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; + var message = this.buildServer.SetBuildNumber(vars); + Assert.That(message, Is.EqualTo("##myget[buildNumber '0.0.0-Unstable4']")); + } + + [Test] + public void ShouldSetOutputVariables() + { + var message = this.buildServer.SetOutputVariables("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); + Assert.That(message[0], Is.EqualTo("##myget[setParameter name='GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']")); + } +} diff --git a/src/GitVersion.Core.Tests/BuildAgents/SpaceAutomationTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs similarity index 88% rename from src/GitVersion.Core.Tests/BuildAgents/SpaceAutomationTests.cs rename to src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs index f4160a9154..c330ab2ea7 100644 --- a/src/GitVersion.Core.Tests/BuildAgents/SpaceAutomationTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs @@ -1,11 +1,7 @@ -using GitVersion; -using GitVersion.BuildAgents; using GitVersion.Core.Tests.Helpers; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; -namespace GitVersionCore.Tests.BuildAgents; +namespace GitVersion.Agents.Tests; [TestFixture] public class SpaceAutomationTests : TestBase @@ -88,13 +84,13 @@ public void GetCurrentBranchShouldHandlePullRequests() } [Test] - public void GetEmptyGenerateSetVersionMessage() + public void ShouldSetBuildNumber() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act - var message = this.buildServer.GenerateSetVersionMessage(vars); + var message = this.buildServer.SetBuildNumber(vars); // Assert message.ShouldBeEmpty(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs new file mode 100644 index 0000000000..d3cbca95cf --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs @@ -0,0 +1,36 @@ +using GitVersion.Core.Tests.Helpers; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Agents.Tests; + +[TestFixture] +public class TeamCityTests : TestBase +{ + private TeamCity buildServer; + + [SetUp] + public void SetUp() + { + var sp = ConfigureServices(services => services.AddSingleton()); + this.buildServer = sp.GetRequiredService(); + } + + [Test] + public void ShouldSetBuildNumber() + { + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; + var tcVersion = this.buildServer.SetBuildNumber(vars); + Assert.That(tcVersion, Is.EqualTo("##teamcity[buildNumber '0.0.0-Unstable4']")); + } + + [Test] + public void ShouldSetOutputVariables() + { + var tcVersion = this.buildServer.SetOutputVariables("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); + Assert.Multiple(() => + { + Assert.That(tcVersion[0], Is.EqualTo("##teamcity[setParameter name='GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']")); + Assert.That(tcVersion[1], Is.EqualTo("##teamcity[setParameter name='system.GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']")); + }); + } +} diff --git a/src/GitVersion.BuildAgents.Tests/AssemblyParallelizable.cs b/src/GitVersion.BuildAgents.Tests/AssemblyParallelizable.cs new file mode 100644 index 0000000000..fdd365b7e2 --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/AssemblyParallelizable.cs @@ -0,0 +1 @@ +[assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/src/GitVersion.BuildAgents.Tests/GitVersion.BuildAgents.Tests.csproj b/src/GitVersion.BuildAgents.Tests/GitVersion.BuildAgents.Tests.csproj new file mode 100644 index 0000000000..b7253b713e --- /dev/null +++ b/src/GitVersion.BuildAgents.Tests/GitVersion.BuildAgents.Tests.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/GitVersion.Core/BuildAgents/AppVeyor.cs b/src/GitVersion.BuildAgents/Agents/AppVeyor.cs similarity index 79% rename from src/GitVersion.Core/BuildAgents/AppVeyor.cs rename to src/GitVersion.BuildAgents/Agents/AppVeyor.cs index 0fbac0430e..b9c46c8da6 100644 --- a/src/GitVersion.Core/BuildAgents/AppVeyor.cs +++ b/src/GitVersion.BuildAgents/Agents/AppVeyor.cs @@ -1,21 +1,17 @@ -using System.Text.Json; +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class AppVeyor : BuildAgentBase +internal class AppVeyor(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { - public AppVeyor(IEnvironment environment, ILog log) : base(environment, log) - { - } - public const string EnvironmentVariableName = "APPVEYOR"; protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) + public override string SetBuildNumber(GitVersionVariables variables) { var buildNumber = Environment.GetEnvironmentVariable("APPVEYOR_BUILD_NUMBER"); var apiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL") ?? throw new Exception("APPVEYOR_API_URL environment variable not set"); @@ -42,7 +38,7 @@ public override string GenerateSetVersionMessage(VersionVariables variables) return $"Set AppVeyor build number to '{variables.FullSemVer}'."; } - public override string[] GenerateSetParameterMessage(string name, string value) + public override string[] SetOutputVariables(string name, string? value) { var apiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL") ?? throw new Exception("APPVEYOR_API_URL environment variable not set"); var httpClient = GetHttpClient(apiUrl); @@ -57,10 +53,10 @@ public override string[] GenerateSetParameterMessage(string name, string value) var response = httpClient.PostAsync("api/build/variables", stringContent).GetAwaiter().GetResult(); response.EnsureSuccessStatusCode(); - return new[] - { + return + [ $"Adding Environment Variable. name='GitVersion_{name}' value='{value}']" - }; + ]; } private static HttpClient GetHttpClient(string apiUrl) => new() @@ -71,11 +67,9 @@ public override string[] GenerateSetParameterMessage(string name, string value) public override string? GetCurrentBranch(bool usingDynamicRepos) { var pullRequestBranchName = Environment.GetEnvironmentVariable("APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"); - if (!pullRequestBranchName.IsNullOrWhiteSpace()) - { - return pullRequestBranchName; - } - return Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"); + return !pullRequestBranchName.IsNullOrWhiteSpace() + ? pullRequestBranchName + : this.Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"); } public override bool PreventFetch() => false; diff --git a/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs b/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs new file mode 100644 index 0000000000..d372f067b4 --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs @@ -0,0 +1,65 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class AzurePipelines(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public const string EnvironmentVariableName = "TF_BUILD"; + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"##vso[task.setvariable variable=GitVersion.{name}]{value}", + $"##vso[task.setvariable variable=GitVersion.{name};isOutput=true]{value}" + ]; + + public override string? GetCurrentBranch(bool usingDynamicRepos) + { + var gitBranch = Environment.GetEnvironmentVariable("GIT_BRANCH"); + if (gitBranch is not null) + return gitBranch; + + var sourceBranch = Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"); + + // https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml + // BUILD_SOURCEBRANCH must be used only for "real" branches, not for tags. + // Azure Pipelines sets BUILD_SOURCEBRANCH to refs/tags/ when the pipeline is triggered for a tag. + return sourceBranch?.StartsWith("refs/tags", StringComparison.OrdinalIgnoreCase) == true ? null : sourceBranch; + } + + public override bool PreventFetch() => true; + + public override string SetBuildNumber(GitVersionVariables variables) + { + // For AzurePipelines, we'll get the Build Number and insert GitVersion variables where + // specified + var buildNumberEnv = Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER"); + if (buildNumberEnv.IsNullOrWhiteSpace()) + return variables.FullSemVer; + + var newBuildNumber = variables.OrderBy(x => x.Key).Aggregate(buildNumberEnv, ReplaceVariables); + + // If no variable substitution has happened, use FullSemVer + if (buildNumberEnv != newBuildNumber) return $"##vso[build.updatebuildnumber]{newBuildNumber}"; + var buildNumber = variables.FullSemVer.EndsWith("+0") + ? variables.FullSemVer[..^2] + : variables.FullSemVer; + + return $"##vso[build.updatebuildnumber]{buildNumber}"; + } + + private static string ReplaceVariables(string buildNumberEnv, KeyValuePair variable) + { + var pattern = $@"\$\(GITVERSION[_\.]{variable.Key}\)"; + var replacement = variable.Value; + return replacement switch + { + null => buildNumberEnv, + _ => buildNumberEnv.RegexReplace(pattern, replacement) + }; + } +} diff --git a/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs b/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs new file mode 100644 index 0000000000..ec79090b94 --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs @@ -0,0 +1,79 @@ +using System.IO.Abstractions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class BitBucketPipelines : BuildAgentBase +{ + public const string EnvironmentVariableName = "BITBUCKET_WORKSPACE"; + public const string BranchEnvironmentVariableName = "BITBUCKET_BRANCH"; + public const string TagEnvironmentVariableName = "BITBUCKET_TAG"; + public const string PullRequestEnvironmentVariableName = "BITBUCKET_PR_ID"; + private string? propertyFile; + private string? ps1File; + + public BitBucketPipelines(IEnvironment environment, ILog log, IFileSystem fileSystem) : base(environment, log, fileSystem) + { + WithPropertyFile("gitversion.properties"); + WithPowershellFile("gitversion.ps1"); + } + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; + + public void WithPropertyFile(string propertiesFileName) => this.propertyFile = propertiesFileName; + + public void WithPowershellFile(string powershellFileName) => this.ps1File = powershellFileName; + + public override string[] SetOutputVariables(string name, string? value) => [$"GITVERSION_{name.ToUpperInvariant()}={value}"]; + + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) + { + if (this.propertyFile is null || this.ps1File is null) + return; + + base.WriteIntegration(writer, variables, updateBuildNumber); + writer($"Outputting variables to '{this.propertyFile}' for Bash,"); + writer($"and to '{this.ps1File}' for Powershell ... "); + writer("To import the file into your build environment, add the following line to your build step:"); + writer("Bash:"); + writer($" - source {this.propertyFile}"); + writer("Powershell:"); + writer($" - . .\\{this.ps1File}"); + writer(""); + writer("To reuse the file across build steps, add the file as a build artifact:"); + writer("Bash:"); + writer(" artifacts:"); + writer($" - {this.propertyFile}"); + writer("Powershell:"); + writer(" artifacts:"); + writer($" - {this.ps1File}"); + + var exports = variables + .Select(variable => $"export GITVERSION_{variable.Key.ToUpperInvariant()}={variable.Value}") + .ToList(); + + this.FileSystem.File.WriteAllLines(this.propertyFile, exports); + + var psExports = variables + .Select(variable => $"$GITVERSION_{variable.Key.ToUpperInvariant()} = \"{variable.Value}\"") + .ToList(); + + this.FileSystem.File.WriteAllLines(this.ps1File, psExports); + } + + public override string? GetCurrentBranch(bool usingDynamicRepos) + { + var branchName = EvaluateEnvironmentVariable(BranchEnvironmentVariableName); + return branchName?.StartsWith("refs/heads/") == true ? branchName : null; + } + + private string? EvaluateEnvironmentVariable(string variableName) + { + var branchName = Environment.GetEnvironmentVariable(variableName); + this.Log.Info("Evaluating environment variable {0} : {1}", variableName, branchName ?? "(null)"); + return branchName; + } +} diff --git a/src/GitVersion.Core/BuildAgents/BuildKite.cs b/src/GitVersion.BuildAgents/Agents/BuildKite.cs similarity index 54% rename from src/GitVersion.Core/BuildAgents/BuildKite.cs rename to src/GitVersion.BuildAgents/Agents/BuildKite.cs index f54fb2a1ca..bdf325460a 100644 --- a/src/GitVersion.Core/BuildAgents/BuildKite.cs +++ b/src/GitVersion.BuildAgents/Agents/BuildKite.cs @@ -1,25 +1,22 @@ +using System.IO.Abstractions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class BuildKite : BuildAgentBase +internal class BuildKite(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { - public BuildKite(IEnvironment environment, ILog log) : base(environment, log) - { - } - public const string EnvironmentVariableName = "BUILDKITE"; protected override string EnvironmentVariable => EnvironmentVariableName; public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable), StringComparison.OrdinalIgnoreCase); - public override string GenerateSetVersionMessage(VersionVariables variables) => + public override string SetBuildNumber(GitVersionVariables variables) => string.Empty; // There is no equivalent function in BuildKite. - public override string[] GenerateSetParameterMessage(string name, string value) => - Array.Empty(); // There is no equivalent function in BuildKite. + public override string[] SetOutputVariables(string name, string? value) => + []; // There is no equivalent function in BuildKite. public override string? GetCurrentBranch(bool usingDynamicRepos) { @@ -28,12 +25,10 @@ public override string[] GenerateSetParameterMessage(string name, string value) { return Environment.GetEnvironmentVariable("BUILDKITE_BRANCH"); } - else - { - // For pull requests BUILDKITE_BRANCH refers to the head, so adjust the - // branch name for pull request versioning to function as expected - return string.Format("refs/pull/{0}/head", pullRequest); - } + + // For pull requests BUILDKITE_BRANCH refers to the head, so adjust the + // branch name for pull request versioning to function as expected + return $"refs/pull/{pullRequest}/head"; } public override bool PreventFetch() => true; diff --git a/src/GitVersion.Core/BuildAgents/CodeBuild.cs b/src/GitVersion.BuildAgents/Agents/CodeBuild.cs similarity index 70% rename from src/GitVersion.Core/BuildAgents/CodeBuild.cs rename to src/GitVersion.BuildAgents/Agents/CodeBuild.cs index 1b06d29ce4..30b710d8c4 100644 --- a/src/GitVersion.Core/BuildAgents/CodeBuild.cs +++ b/src/GitVersion.BuildAgents/Agents/CodeBuild.cs @@ -1,27 +1,28 @@ +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public sealed class CodeBuild : BuildAgentBase +internal sealed class CodeBuild : BuildAgentBase { private string? file; public const string WebHookEnvironmentVariableName = "CODEBUILD_WEBHOOK_HEAD_REF"; public const string SourceVersionEnvironmentVariableName = "CODEBUILD_SOURCE_VERSION"; - public CodeBuild(IEnvironment environment, ILog log) : base(environment, log) => WithPropertyFile("gitversion.properties"); + public CodeBuild(IEnvironment environment, ILog log, IFileSystem fileSystem) : base(environment, log, fileSystem) => WithPropertyFile("gitversion.properties"); public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; protected override string EnvironmentVariable => WebHookEnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { + public override string[] SetOutputVariables(string name, string? value) => + [ $"GitVersion_{name}={value}" - }; + ]; public override string? GetCurrentBranch(bool usingDynamicRepos) { @@ -30,14 +31,14 @@ public override string[] GenerateSetParameterMessage(string name, string value) return currentBranch.IsNullOrEmpty() ? Environment.GetEnvironmentVariable(SourceVersionEnvironmentVariableName) : currentBranch; } - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; base.WriteIntegration(writer, variables, updateBuildNumber); writer($"Outputting variables to '{this.file}' ... "); - File.WriteAllLines(this.file, GenerateBuildLogOutput(variables)); + this.FileSystem.File.WriteAllLines(this.file, SetOutputVariables(variables)); } public override bool PreventFetch() => true; diff --git a/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs b/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs new file mode 100644 index 0000000000..ecdf5a0bc8 --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs @@ -0,0 +1,21 @@ +using System.IO.Abstractions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class ContinuaCi(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public const string EnvironmentVariableName = "ContinuaCI.Version"; + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"@@continua[setVariable name='GitVersion_{name}' value='{value}' skipIfNotDefined='true']" + ]; + + public override string SetBuildNumber(GitVersionVariables variables) => $"@@continua[setBuildVersion value='{variables.FullSemVer}']"; + + public override bool PreventFetch() => false; +} diff --git a/src/GitVersion.BuildAgents/Agents/Drone.cs b/src/GitVersion.BuildAgents/Agents/Drone.cs new file mode 100644 index 0000000000..5895fe791b --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/Drone.cs @@ -0,0 +1,43 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class Drone(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public const string EnvironmentVariableName = "DRONE"; + protected override string EnvironmentVariable => EnvironmentVariableName; + public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable), StringComparison.OrdinalIgnoreCase); + + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"GitVersion_{name}={value}" + ]; + + public override string? GetCurrentBranch(bool usingDynamicRepos) + { + // In Drone DRONE_BRANCH variable is equal to destination branch in case of pull request + // https://discourse.drone.io/t/getting-the-branch-a-pull-request-is-created-from/670 + // Unfortunately, DRONE_REFSPEC isn't populated, however CI_COMMIT_REFSPEC can be used instead of. + var pullRequestNumber = Environment.GetEnvironmentVariable("DRONE_PULL_REQUEST"); + if (pullRequestNumber.IsNullOrWhiteSpace()) return this.Environment.GetEnvironmentVariable("DRONE_BRANCH"); + // DRONE_SOURCE_BRANCH is available in Drone 1.x.x version + var sourceBranch = this.Environment.GetEnvironmentVariable("DRONE_SOURCE_BRANCH"); + if (!sourceBranch.IsNullOrWhiteSpace()) + return sourceBranch; + + // In drone lower than 1.x.x source branch can be parsed from CI_COMMIT_REFSPEC + // CI_COMMIT_REFSPEC - {sourceBranch}:{destinationBranch} + // https://github.com/drone/drone/issues/2222 + var ciCommitRefSpec = this.Environment.GetEnvironmentVariable("CI_COMMIT_REFSPEC"); + if (ciCommitRefSpec.IsNullOrWhiteSpace()) return this.Environment.GetEnvironmentVariable("DRONE_BRANCH"); + var colonIndex = ciCommitRefSpec.IndexOf(':'); + return colonIndex > 0 ? ciCommitRefSpec[..colonIndex] : this.Environment.GetEnvironmentVariable("DRONE_BRANCH"); + } + + public override bool PreventFetch() => false; +} diff --git a/src/GitVersion.BuildAgents/Agents/EnvRun.cs b/src/GitVersion.BuildAgents/Agents/EnvRun.cs new file mode 100644 index 0000000000..c74962f92b --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/EnvRun.cs @@ -0,0 +1,29 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class EnvRun(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + private const string EnvironmentVariableName = "ENVRUN_DATABASE"; + protected override string EnvironmentVariable => EnvironmentVariableName; + public override bool CanApplyToCurrentContext() + { + var envRunDatabasePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); + if (envRunDatabasePath.IsNullOrEmpty()) return false; + if (this.FileSystem.File.Exists(envRunDatabasePath)) return true; + this.Log.Error($"The database file of EnvRun.exe was not found at {envRunDatabasePath}."); + + return false; + } + + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"@@envrun[set name='GitVersion_{name}' value='{value}']" + ]; + public override bool PreventFetch() => true; +} diff --git a/src/GitVersion.Core/BuildAgents/GitHubActions.cs b/src/GitVersion.BuildAgents/Agents/GitHubActions.cs similarity index 62% rename from src/GitVersion.Core/BuildAgents/GitHubActions.cs rename to src/GitVersion.BuildAgents/Agents/GitHubActions.cs index f1a694367e..7bd1515e11 100644 --- a/src/GitVersion.Core/BuildAgents/GitHubActions.cs +++ b/src/GitVersion.BuildAgents/Agents/GitHubActions.cs @@ -1,41 +1,38 @@ +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class GitHubActions : BuildAgentBase +internal class GitHubActions(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { // https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables - public GitHubActions(IEnvironment environment, ILog log) : base(environment, log) - { - } - public const string EnvironmentVariableName = "GITHUB_ACTIONS"; public const string GitHubSetEnvTempFileEnvironmentVariableName = "GITHUB_ENV"; protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => + public override string SetBuildNumber(GitVersionVariables variables) => string.Empty; // There is no equivalent function in GitHub Actions. - public override string[] GenerateSetParameterMessage(string name, string value) => - Array.Empty(); // There is no equivalent function in GitHub Actions. + public override string[] SetOutputVariables(string name, string? value) => + []; // There is no equivalent function in GitHub Actions. - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { base.WriteIntegration(writer, variables, updateBuildNumber); // https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files // The outgoing environment variables must be written to a temporary file (identified by the $GITHUB_ENV environment - // variable, which changes for every step in a workflow) which is then parsed. That file must also be UTF-8 or it will fail. + // variable, which changes for every step in a workflow) which is then parsed. That file must also be UTF-8, or it will fail. var gitHubSetEnvFilePath = this.Environment.GetEnvironmentVariable(GitHubSetEnvTempFileEnvironmentVariableName); if (gitHubSetEnvFilePath != null) { writer($"Writing version variables to $GITHUB_ENV file for '{GetType().Name}'."); - using var streamWriter = File.AppendText(gitHubSetEnvFilePath); + using var streamWriter = this.FileSystem.File.AppendText(gitHubSetEnvFilePath); foreach (var (key, value) in variables) { if (!value.IsNullOrEmpty()) @@ -50,7 +47,15 @@ public override void WriteIntegration(Action writer, VersionVariables v } } - public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("GITHUB_REF"); + public override string? GetCurrentBranch(bool usingDynamicRepos) + { + // https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables + // GITHUB_REF must be used only for "real" branches, not for tags. + // Bug fix for https://github.com/GitTools/GitVersion/issues/2838 + + var refType = Environment.GetEnvironmentVariable("GITHUB_REF_TYPE") ?? ""; + return refType.Equals("tag", StringComparison.OrdinalIgnoreCase) ? null : Environment.GetEnvironmentVariable("GITHUB_REF"); + } public override bool PreventFetch() => true; } diff --git a/src/GitVersion.BuildAgents/Agents/GitLabCi.cs b/src/GitVersion.BuildAgents/Agents/GitLabCi.cs new file mode 100644 index 0000000000..90308f1e5e --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/GitLabCi.cs @@ -0,0 +1,46 @@ +using System.IO.Abstractions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class GitLabCi : BuildAgentBase +{ + public const string EnvironmentVariableName = "GITLAB_CI"; + private string? file; + + public GitLabCi(IEnvironment environment, ILog log, IFileSystem fileSystem) : base(environment, log, fileSystem) => WithPropertyFile("gitversion.properties"); + + public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"GitVersion_{name}={value}" + ]; + + // CI_COMMIT_REF_NAME can contain either the branch or the tag + // See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html + // CI_COMMIT_TAG is only available in tag pipelines, + // so we can exit if CI_COMMIT_REF_NAME would return the tag + public override string? GetCurrentBranch(bool usingDynamicRepos) => + string.IsNullOrEmpty(this.Environment.GetEnvironmentVariable("CI_COMMIT_TAG")) + ? this.Environment.GetEnvironmentVariable("CI_COMMIT_REF_NAME") + : null; + + public override bool PreventFetch() => true; + + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) + { + if (this.file is null) + return; + + base.WriteIntegration(writer, variables, updateBuildNumber); + writer($"Outputting variables to '{this.file}' ... "); + + this.FileSystem.File.WriteAllLines(this.file, SetOutputVariables(variables)); + } +} diff --git a/src/GitVersion.Core/BuildAgents/Jenkins.cs b/src/GitVersion.BuildAgents/Agents/Jenkins.cs similarity index 69% rename from src/GitVersion.Core/BuildAgents/Jenkins.cs rename to src/GitVersion.BuildAgents/Agents/Jenkins.cs index c9105d765e..57c78aede1 100644 --- a/src/GitVersion.Core/BuildAgents/Jenkins.cs +++ b/src/GitVersion.BuildAgents/Agents/Jenkins.cs @@ -1,25 +1,26 @@ +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class Jenkins : BuildAgentBase +internal class Jenkins : BuildAgentBase { public const string EnvironmentVariableName = "JENKINS_URL"; private string? file; protected override string EnvironmentVariable => EnvironmentVariableName; - public Jenkins(IEnvironment environment, ILog log) : base(environment, log) => WithPropertyFile("gitversion.properties"); + public Jenkins(IEnvironment environment, ILog log, IFileSystem fileSystem) : base(environment, log, fileSystem) => WithPropertyFile("gitversion.properties"); public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { + public override string[] SetOutputVariables(string name, string? value) => + [ $"GitVersion_{name}={value}" - }; + ]; public override string? GetCurrentBranch(bool usingDynamicRepos) => IsPipelineAsCode() ? Environment.GetEnvironmentVariable("BRANCH_NAME") @@ -36,14 +37,13 @@ public override string[] GenerateSetParameterMessage(string name, string value) /// public override bool ShouldCleanUpRemotes() => IsPipelineAsCode(); - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; base.WriteIntegration(writer, variables, updateBuildNumber); writer($"Outputting variables to '{this.file}' ... "); - File.WriteAllLines(this.file, GenerateBuildLogOutput(variables)); + this.FileSystem.File.WriteAllLines(this.file, SetOutputVariables(variables)); } - } diff --git a/src/GitVersion.Core/BuildAgents/MyGet.cs b/src/GitVersion.BuildAgents/Agents/MyGet.cs similarity index 57% rename from src/GitVersion.Core/BuildAgents/MyGet.cs rename to src/GitVersion.BuildAgents/Agents/MyGet.cs index 2f77cc69d6..dad7d7feb7 100644 --- a/src/GitVersion.Core/BuildAgents/MyGet.cs +++ b/src/GitVersion.BuildAgents/Agents/MyGet.cs @@ -1,16 +1,13 @@ +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class MyGet : BuildAgentBase +internal class MyGet(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { - public MyGet(IEnvironment environment, ILog log) : base(environment, log) - { - } - public const string EnvironmentVariableName = "BuildRunner"; protected override string EnvironmentVariable => EnvironmentVariableName; public override bool CanApplyToCurrentContext() @@ -21,22 +18,18 @@ public override bool CanApplyToCurrentContext() && buildRunner.Equals("MyGet", StringComparison.InvariantCultureIgnoreCase); } - public override string[] GenerateSetParameterMessage(string name, string value) + public override string[] SetOutputVariables(string name, string? value) { var messages = new List { $"##myget[setParameter name='GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']" }; - if (string.Equals(name, "LegacySemVerPadded", StringComparison.InvariantCultureIgnoreCase)) - { - messages.Add($"##myget[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(value)}']"); - } - - return messages.ToArray(); + return [.. messages]; } - public override string? GenerateSetVersionMessage(VersionVariables variables) => null; + public override string SetBuildNumber(GitVersionVariables variables) => + $"##myget[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']"; public override bool PreventFetch() => false; } diff --git a/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs b/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs new file mode 100644 index 0000000000..2814896e04 --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs @@ -0,0 +1,18 @@ +using System.IO.Abstractions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class SpaceAutomation(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public const string EnvironmentVariableName = "JB_SPACE_PROJECT_KEY"; + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("JB_SPACE_GIT_BRANCH"); + + public override string[] SetOutputVariables(string name, string? value) => []; + + public override string SetBuildNumber(GitVersionVariables variables) => string.Empty; +} diff --git a/src/GitVersion.BuildAgents/Agents/TeamCity.cs b/src/GitVersion.BuildAgents/Agents/TeamCity.cs new file mode 100644 index 0000000000..cae3ca8ab3 --- /dev/null +++ b/src/GitVersion.BuildAgents/Agents/TeamCity.cs @@ -0,0 +1,44 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class TeamCity(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public const string EnvironmentVariableName = "TEAMCITY_VERSION"; + + protected override string EnvironmentVariable => EnvironmentVariableName; + + public override string? GetCurrentBranch(bool usingDynamicRepos) + { + var branchName = Environment.GetEnvironmentVariable("Git_Branch"); + + if (!branchName.IsNullOrEmpty()) return branchName; + if (!usingDynamicRepos) + { + WriteBranchEnvVariableWarning(); + } + + return base.GetCurrentBranch(usingDynamicRepos); + } + + private void WriteBranchEnvVariableWarning() => this.Log.Warning(""" + TeamCity doesn't make the current branch available through environmental variables. + Depending on your authentication and transport setup of your git VCS root things may work. In that case, ignore this warning. + In your TeamCity build configuration, add a parameter called `env.Git_Branch` with value %teamcity.build.vcs.branch.% + See https://gitversion.net/docs/reference/build-servers/teamcity for more info + """); + + public override bool PreventFetch() => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("Git_Branch")); + + public override string[] SetOutputVariables(string name, string? value) => + [ + $"##teamcity[setParameter name='GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']", + $"##teamcity[setParameter name='system.GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']" + ]; + + public override string SetBuildNumber(GitVersionVariables variables) => $"##teamcity[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']"; +} diff --git a/src/GitVersion.Core/BuildAgents/TravisCI.cs b/src/GitVersion.BuildAgents/Agents/TravisCI.cs similarity index 55% rename from src/GitVersion.Core/BuildAgents/TravisCI.cs rename to src/GitVersion.BuildAgents/Agents/TravisCI.cs index 520864feaf..43eb4638c8 100644 --- a/src/GitVersion.Core/BuildAgents/TravisCI.cs +++ b/src/GitVersion.BuildAgents/Agents/TravisCI.cs @@ -1,25 +1,22 @@ +using System.IO.Abstractions; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class TravisCi : BuildAgentBase +internal class TravisCi(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) { - public TravisCi(IEnvironment environment, ILog log) : base(environment, log) - { - } - public const string EnvironmentVariableName = "TRAVIS"; protected override string EnvironmentVariable => EnvironmentVariableName; public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable)) && "true".Equals(Environment.GetEnvironmentVariable("CI")); - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string SetBuildNumber(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { + public override string[] SetOutputVariables(string name, string? value) => + [ $"GitVersion_{name}={value}" - }; + ]; public override bool PreventFetch() => true; } diff --git a/src/GitVersion.BuildAgents/GitVersion.BuildAgents.csproj b/src/GitVersion.BuildAgents/GitVersion.BuildAgents.csproj new file mode 100644 index 0000000000..13485fe695 --- /dev/null +++ b/src/GitVersion.BuildAgents/GitVersion.BuildAgents.csproj @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs b/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs new file mode 100644 index 0000000000..17ba4b85b8 --- /dev/null +++ b/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Agents; + +public class GitVersionBuildAgentsModule : IGitVersionModule +{ + public void RegisterTypes(IServiceCollection services) + { + var buildAgents = IGitVersionModule.FindAllDerivedTypes(Assembly.GetAssembly(GetType())); + + foreach (var buildAgent in buildAgents) + { + services.AddSingleton(typeof(IBuildAgent), buildAgent); + } + } +} diff --git a/src/GitVersion.BuildAgents/PublicAPI.Shipped.txt b/src/GitVersion.BuildAgents/PublicAPI.Shipped.txt new file mode 100644 index 0000000000..271d1babf9 --- /dev/null +++ b/src/GitVersion.BuildAgents/PublicAPI.Shipped.txt @@ -0,0 +1,4 @@ +#nullable enable +GitVersion.Agents.GitVersionBuildAgentsModule +GitVersion.Agents.GitVersionBuildAgentsModule.GitVersionBuildAgentsModule() -> void +GitVersion.Agents.GitVersionBuildAgentsModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void diff --git a/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt b/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt new file mode 100644 index 0000000000..7dc5c58110 --- /dev/null +++ b/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationExtensionsTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationExtensionsTests.cs new file mode 100644 index 0000000000..97e225f752 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationExtensionsTests.cs @@ -0,0 +1,58 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Git; + +namespace GitVersion.Core.Tests.Configuration; + +[TestFixture] +public class ConfigurationExtensionsTests : TestBase +{ + [TestCase("release/2.0.0", + "refs/heads/release/2.0.0", "release/2.0.0", "release/2.0.0", + true, false, false, false, true)] + [TestCase("upstream/release/2.0.0", + "refs/heads/upstream/release/2.0.0", "upstream/release/2.0.0", "upstream/release/2.0.0", + true, false, false, false, false)] + [TestCase("origin/release/2.0.0", + "refs/heads/origin/release/2.0.0", "origin/release/2.0.0", "origin/release/2.0.0", + true, false, false, false, false)] + [TestCase("refs/remotes/upstream/release/2.0.0", + "refs/remotes/upstream/release/2.0.0", "upstream/release/2.0.0", "upstream/release/2.0.0", + false, false, true, false, false)] + [TestCase("refs/remotes/origin/release/2.0.0", + "refs/remotes/origin/release/2.0.0", "origin/release/2.0.0", "release/2.0.0", + false, false, true, false, true)] + public void EnsureIsReleaseBranchWithReferenceNameWorksAsExpected(string branchName, string expectedCanonical, string expectedFriendly, string expectedWithoutOrigin, + bool expectedIsLocalBranch, bool expectedIsPullRequest, bool expectedIsRemoteBranch, bool expectedIsTag, bool expectedIsReleaseBranch) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + var actual = ReferenceName.FromBranchName(branchName); + var isReleaseBranch = configuration.IsReleaseBranch(actual); + + actual.Canonical.ShouldBe(expectedCanonical); + actual.Friendly.ShouldBe(expectedFriendly); + actual.WithoutOrigin.ShouldBe(expectedWithoutOrigin); + actual.IsLocalBranch.ShouldBe(expectedIsLocalBranch); + actual.IsPullRequest.ShouldBe(expectedIsPullRequest); + actual.IsRemoteBranch.ShouldBe(expectedIsRemoteBranch); + actual.IsTag.ShouldBe(expectedIsTag); + isReleaseBranch.ShouldBe(expectedIsReleaseBranch); + } + + [TestCase("feature/sc-1000/Description", @"^features?[\/-](?.+)", "{BranchName}", "sc-1000-Description")] + [TestCase("feature/sc-1000/Description", @"^features?[\/-](?sc-\d+)[-\/].+", "{StoryNo}", "sc-1000")] + public void EnsureGetBranchSpecificLabelWorksAsExpected(string branchName, string regularExpression, string label, string expectedLabel) + { + var configuration = GitFlowConfigurationBuilder.New + .WithoutBranches() + .WithBranch(branchName, builder => builder + .WithLabel(label) + .WithRegularExpression(regularExpression)) + .Build(); + + var effectiveConfiguration = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName(branchName)); + var actual = effectiveConfiguration.GetBranchSpecificLabel(ReferenceName.FromBranchName(branchName), null); + actual.ShouldBe(expectedLabel); + } +} diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs new file mode 100644 index 0000000000..3035b49a8b --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs @@ -0,0 +1,276 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; +using GitVersion.Configuration.Tests.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; +using GitVersion.Logging; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace GitVersion.Core.Tests; + +[TestFixture] +public static class ConfigurationFileLocatorTests +{ + public class DefaultConfigFileLocatorTests : TestBase + { + private string repoPath; + private string workingPath; + private IFileSystem fileSystem; + private ConfigurationProvider configurationProvider; + private IConfigurationFileLocator configFileLocator; + + [SetUp] + public void Setup() + { + this.repoPath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "MyGitRepo"); + this.workingPath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "MyGitRepo", "Working"); + var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); + + var sp = ConfigureServices(services => services.AddSingleton(options)); + + this.fileSystem = sp.GetRequiredService(); + this.configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); + this.configFileLocator = sp.GetRequiredService(); + + ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); + } + + [TestCase(ConfigurationFileLocator.DefaultFileName, ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileName, ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileName, ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultFileName, ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName, ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName, ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName, ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName, ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted, ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted, ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted, ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted, ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted, ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted, ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted, ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted, ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + public void ThrowsExceptionOnAmbiguousConfigFileLocation(string repoConfigFile, string workingConfigFile) + { + using var repositoryConfigFilePath = this.fileSystem.SetupConfigFile(path: this.repoPath, fileName: repoConfigFile); + using var workingDirectoryConfigFilePath = this.fileSystem.SetupConfigFile(path: this.workingPath, fileName: workingConfigFile); + + var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + + var expectedMessage = $"Ambiguous configuration file selection from '{workingDirectoryConfigFilePath.Value}' and '{repositoryConfigFilePath.Value}'"; + exception.Message.ShouldBe(expectedMessage); + } + + [TestCase(ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + public void NoWarnOnGitVersionYmlFile(string configurationFile) + { + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, fileName: configurationFile); + + Should.NotThrow(() => this.configurationProvider.ProvideForDirectory(this.repoPath)); + } + + [TestCase(ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + public void NoWarnOnLowercasedGitVersionYmlFile(string configurationFile) + { + var lowercasedConfigurationFile = configurationFile.ToLower(); + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, fileName: lowercasedConfigurationFile); + + Should.NotThrow(() => this.configurationProvider.ProvideForDirectory(this.repoPath)); + } + + [Test] + public void NoWarnOnNoGitVersionYmlFile() => Should.NotThrow(() => this.configurationProvider.ProvideForDirectory(this.repoPath)); + } + + public class NamedConfigurationFileLocatorTests : TestBase + { + private string repoPath; + private string workingPath; + private IFileSystem fileSystem; + private IConfigurationFileLocator configFileLocator; + private GitVersionOptions gitVersionOptions; + private string ConfigFile => this.gitVersionOptions.ConfigurationInfo.ConfigurationFile!; + + [SetUp] + public void Setup() + { + this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = "my-config.yaml" } }; + this.repoPath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "MyGitRepo"); + this.workingPath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "MyGitRepo", "Working"); + + ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); + } + + [Test] + public void ThrowsExceptionOnAmbiguousConfigFileLocation() + { + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + using var repositoryConfigFilePath = this.fileSystem.SetupConfigFile(path: this.repoPath, fileName: ConfigFile); + using var workDirConfigFilePath = this.fileSystem.SetupConfigFile(path: this.workingPath, fileName: ConfigFile); + + var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + + var expectedMessage = $"Ambiguous configuration file selection from '{workDirConfigFilePath.Value}' and '{repositoryConfigFilePath.Value}'"; + exception.Message.ShouldBe(expectedMessage); + } + + [Test] + public void DoNotThrowWhenWorkingAndRepoPathsAreSame() + { + this.workingPath = this.repoPath; + + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + using var _ = this.fileSystem.SetupConfigFile(path: this.workingPath, fileName: ConfigFile); + + Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + } + + [Test] + public void DoNotThrowWhenWorkingAndRepoPathsAreSame_WithDifferentCasing() + { + this.workingPath = this.repoPath.ToLower(); + + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + using var _ = this.fileSystem.SetupConfigFile(path: this.workingPath, fileName: ConfigFile); + + Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + } + + [Test] + public void ReturnConfigurationFilePathIfCustomConfigurationIsSet() + { + this.workingPath = this.repoPath; + var configurationFilePath = FileSystemHelper.Path.Combine(this.workingPath, "Configuration", "CustomConfig.yaml"); + + this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = configurationFilePath } }; + + var serviceProvider = GetServiceProvider(this.gitVersionOptions); + this.fileSystem = serviceProvider.GetRequiredService(); + + using var _ = this.fileSystem.SetupConfigFile( + path: FileSystemHelper.Path.Combine(this.workingPath, "Configuration"), fileName: "CustomConfig.yaml" + ); + this.configFileLocator = serviceProvider.GetRequiredService(); + + var config = this.configFileLocator.GetConfigurationFile(this.workingPath); + config.ShouldBe(configurationFilePath); + } + + [TestCase(null)] + [TestCase("")] + [TestCase(" ")] + [TestCase("Configuration/CustomConfig2.yaml")] + public void ReturnConfigurationFilePathIfCustomConfigurationIsSet_InvalidConfigurationFilePaths(string? configFile) + { + this.workingPath = this.repoPath; + + this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = configFile } }; + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + + var config = this.configFileLocator.GetConfigurationFile(this.workingPath); + config.ShouldBe(null); + } + + [Test] + public void DoNotThrowWhenConfigFileIsInSubDirectoryOfRepoPath() + { + this.workingPath = this.repoPath; + + this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = "./src/my-config.yaml" } }; + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + using var _ = this.fileSystem.SetupConfigFile(path: this.workingPath, fileName: ConfigFile); + + Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + } + + [Test] + public void NoWarnOnCustomYmlFile() + { + var stringLogger = string.Empty; + + var logAppender = new TestLogAppender(Action); + var log = new Log(logAppender); + + var sp = GetServiceProvider(this.gitVersionOptions, log); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + using var _ = this.fileSystem.SetupConfigFile(path: null, fileName: ConfigFile); + + var configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); + + configurationProvider.ProvideForDirectory(this.repoPath); + stringLogger.ShouldMatch("No configuration file found, using default configuration"); + return; + + void Action(string info) => stringLogger = info; + } + + [Test] + public void NoWarnOnCustomYmlFileOutsideRepoPath() + { + var stringLogger = string.Empty; + + var logAppender = new TestLogAppender(Action); + var log = new Log(logAppender); + + var sp = GetServiceProvider(this.gitVersionOptions, log); + this.configFileLocator = sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + var path = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "unrelatedPath"); + using var _ = this.fileSystem.SetupConfigFile(path: path, fileName: ConfigFile); + + var configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); + + configurationProvider.ProvideForDirectory(this.repoPath); + stringLogger.ShouldMatch("No configuration file found, using default configuration"); + return; + + void Action(string info) => stringLogger = info; + } + + [Test] + public void ThrowsExceptionOnCustomYmlFileDoesNotExist() + { + var sp = GetServiceProvider(this.gitVersionOptions); + this.configFileLocator = sp.GetRequiredService(); + + var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); + + var configurationFile = this.gitVersionOptions.ConfigurationInfo.ConfigurationFile; + var workingPathFileConfig = FileSystemHelper.Path.Combine(this.workingPath, configurationFile); + var repoPathFileConfig = FileSystemHelper.Path.Combine(this.repoPath, configurationFile); + var expectedMessage = $"The configuration file was not found at '{workingPathFileConfig}' or '{repoPathFileConfig}'"; + exception.Message.ShouldBe(expectedMessage); + } + + private static IServiceProvider GetServiceProvider(GitVersionOptions gitVersionOptions, ILog? log = null) => + ConfigureServices(services => + { + if (log != null) services.AddSingleton(log); + services.AddSingleton(Options.Create(gitVersionOptions)); + }); + } +} diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt new file mode 100644 index 0000000000..dd44250ac5 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -0,0 +1,167 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + develop: + mode: ContinuousDelivery + label: alpha + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-target: true + track-merge-message: true + regex: ^dev(elop)?(ment)?$ + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: true + is-release-branch: false + is-main-branch: false + pre-release-weight: 0 + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Minor + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-target: false + regex: ^releases?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - develop + - main + - release + - support + - hotfix + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - develop + - main + - release + - feature + - support + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + hotfix: + mode: ManualDeployment + label: beta + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + support: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + regex: ^support[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: true + regex: (?.+) + source-branches: + - main + - develop + - release + - feature + - pull-request + - hotfix + - support + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs new file mode 100644 index 0000000000..9ce9311f5b --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs @@ -0,0 +1,490 @@ +using System.IO.Abstractions; +using System.Runtime.CompilerServices; +using GitVersion.Configuration; +using GitVersion.Configuration.Tests.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.VersionCalculation; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace GitVersion.Core.Tests; + +[TestFixture] +public class ConfigurationProviderTests : TestBase +{ + private string repoPath; + private ConfigurationProvider configurationProvider; + private IFileSystem fileSystem; + + [SetUp] + public void Setup() + { + this.repoPath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "MyGitRepo"); + var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); + var sp = ConfigureServices(services => services.AddSingleton(options)); + this.configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); + this.fileSystem = sp.GetRequiredService(); + + ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); + } + + [Test] + public void OverwritesDefaultsWithProvidedConfig() + { + var defaultConfiguration = this.configurationProvider.ProvideForDirectory(this.repoPath); + const string text = """ + next-version: 2.0.0 + branches: + develop: + increment: Major + mode: ContinuousDelivery + label: dev + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.NextVersion.ShouldBe("2.0.0"); + configuration.Branches.ShouldNotBeNull(); + + var developConfiguration = configuration.Branches["develop"]; + developConfiguration.Increment.ShouldBe(IncrementStrategy.Major); + developConfiguration.Increment.ShouldNotBe(defaultConfiguration.Branches["develop"].Increment); + developConfiguration.DeploymentMode.ShouldBe(DeploymentMode.ContinuousDelivery); + developConfiguration.DeploymentMode.ShouldNotBe(defaultConfiguration.Branches["feature"].DeploymentMode); + developConfiguration.Label.ShouldBe("dev"); + } + + [Test] + public void CombineVersionStrategyConfigNextAndTaggedCommit() + { + // Arrange + const string text = "strategies: [ConfiguredNextVersion, TaggedCommit]"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + // Act + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + // Assert + configuration.VersionStrategy.ShouldBe(VersionStrategies.ConfiguredNextVersion | VersionStrategies.TaggedCommit); + } + + [Test] + public void CanRemoveLabel() + { + const string text = + """ + next-version: 2.0.0 + branches: + release: + label: "" + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.NextVersion.ShouldBe("2.0.0"); + configuration.Branches["release"].Label.ShouldBe(string.Empty); + } + + [Test] + public void RegexIsRequired() + { + const string text = """ + next-version: 2.0.0 + branches: + bug: + label: bugfix + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var ex = Should.Throw(() => this.configurationProvider.ProvideForDirectory(this.repoPath)); + ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'regex'{FileSystemHelper.Path.NewLine}" + + "See https://gitversion.net/docs/reference/configuration for more info"); + } + + [Test(Description = "This test proves the configuration validation will fail early with a helpful message when a branch listed in source-branches has no configuration.")] + public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsMissing() + { + const string text = """ + branches: + bug: + regex: 'bug[\/-]' + label: bugfix + source-branches: [notconfigured] + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var ex = Should.Throw(() => this.configurationProvider.ProvideForDirectory(this.repoPath)); + ex.Message.ShouldBe($"Branch configuration 'bug' defines these 'source-branches' that are not configured: '[notconfigured]'{FileSystemHelper.Path.NewLine}" + + "See https://gitversion.net/docs/reference/configuration for more info"); + } + + [Test(Description = "Well-known branches may not be present in the configuration file. This test confirms the validation check succeeds when the source-branches configuration contain these well-known branches.")] + [TestCase(ConfigurationConstants.MainBranchKey)] + [TestCase(ConfigurationConstants.DevelopBranchKey)] + public void SourceBranchesValidationShouldSucceedForWellKnownBranches(string wellKnownBranchKey) + { + var text = $""" + branches: + bug: + regex: 'bug[\/-]' + label: bugfix + source-branches: [{wellKnownBranchKey}] + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["bug"].SourceBranches.ShouldBe([wellKnownBranchKey]); + } + + [Test] + public void CanProvideConfigForNewBranch() + { + const string text = """ + next-version: 2.0.0 + branches: + bug: + regex: 'bug[\/-]' + label: bugfix + source-branches: [] + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["bug"].RegularExpression.ShouldBe(@"bug[\/-]"); + configuration.Branches["bug"].Label.ShouldBe("bugfix"); + } + + [Test] + public void NextVersionCanBeInteger() + { + const string text = "next-version: 2"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.NextVersion.ShouldBe("2.0"); + } + + [Test] + public void NextVersionCanHaveEnormousMinorVersion() + { + const string text = "next-version: 2.118998723"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.NextVersion.ShouldBe("2.118998723"); + } + + [Test] + public void NextVersionCanHavePatch() + { + const string text = "next-version: 2.12.654651698"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.NextVersion.ShouldBe("2.12.654651698"); + } + + [Test] + [MethodImpl(MethodImplOptions.NoInlining)] + public void CanWriteOutEffectiveConfiguration() + { + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + new ConfigurationSerializer().Serialize(configuration).ShouldMatchApproved(); + } + + [Test] + public void CanUpdateAssemblyInformationalVersioningScheme() + { + const string text = """ + assembly-versioning-scheme: MajorMinor + assembly-file-versioning-scheme: MajorMinorPatch + assembly-informational-format: '{NugetVersion}' + """; + + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor); + configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); + configuration.AssemblyInformationalFormat.ShouldBe("{NugetVersion}"); + } + + [Test] + public void CanUpdateAssemblyInformationalVersioningSchemeWithMultipleVariables() + { + const string text = """ + assembly-versioning-scheme: MajorMinor + assembly-file-versioning-scheme: MajorMinorPatch + assembly-informational-format: '{Major}.{Minor}.{Patch}' + """; + + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor); + configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); + configuration.AssemblyInformationalFormat.ShouldBe("{Major}.{Minor}.{Patch}"); + } + + [Test] + public void CanUpdateAssemblyInformationalVersioningSchemeWithFullSemVer() + { + const string text = """ + assembly-versioning-scheme: MajorMinorPatch + assembly-file-versioning-scheme: MajorMinorPatch + assembly-informational-format: '{FullSemVer}' + mode: ContinuousDelivery + next-version: 5.3.0 + branches: {} + """; + + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); + configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); + configuration.AssemblyInformationalFormat.ShouldBe("{FullSemVer}"); + } + + [Test] + public void CanReadDefaultDocument() + { + const string text = ""; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); + configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); + configuration.AssemblyInformationalFormat.ShouldBe(null); + configuration.Branches["develop"].Label.ShouldBe("alpha"); + configuration.Branches["release"].Label.ShouldBe("beta"); + configuration.TagPrefixPattern.ShouldBe(RegexPatterns.Configuration.DefaultTagPrefixRegexPattern); + configuration.NextVersion.ShouldBe(null); + } + + [Test] + public void VerifyAliases() + { + var configuration = typeof(GitVersionConfiguration); + var propertiesMissingAlias = configuration.GetProperties() + .Where(p => p.GetCustomAttribute() == null + && p.GetCustomAttribute() == null + && p.GetCustomAttribute() == null) + .Select(p => p.Name); + + propertiesMissingAlias.ShouldBeEmpty(); + } + + [Test] + public void NoWarnOnGitVersionYmlFile() + { + const string text = ""; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + var stringLogger = string.Empty; + + var logAppender = new TestLogAppender(Action); + var log = new Log(logAppender); + + var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); + var sp = ConfigureServices(services => + { + services.AddSingleton(options); + services.AddSingleton(log); + }); + this.configurationProvider = (ConfigurationProvider)sp.GetRequiredService(); + + this.configurationProvider.ProvideForDirectory(this.repoPath); + + var filePath = FileSystemHelper.Path.Combine(this.repoPath, ConfigurationFileLocator.DefaultFileName); + stringLogger.ShouldContain($"Using configuration file '{filePath}'"); + return; + + void Action(string info) => stringLogger = info; + } + + [Test] + public void ShouldUseSpecifiedSourceBranchesForDevelop() + { + const string text = """ + next-version: 2.0.0 + branches: + develop: + mode: ContinuousDeployment + source-branches: ['develop'] + label: dev + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["develop"].SourceBranches.ShouldBe(["develop"]); + } + + [Test] + public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForDevelop() + { + const string text = """ + next-version: 2.0.0 + branches: + develop: + mode: ContinuousDeployment + label: dev + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["develop"].SourceBranches.ShouldBe(["main"]); + } + + [Test] + public void ShouldUseSpecifiedSourceBranchesForFeature() + { + const string text = """ + next-version: 2.0.0 + branches: + feature: + mode: ContinuousDeployment + source-branches: ['develop', 'release'] + label: dev + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["feature"].SourceBranches.ShouldBe(["develop", "release"]); + } + + [Test] + public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForFeature() + { + const string text = """ + next-version: 2.0.0 + branches: + feature: + mode: ContinuousDeployment + label: dev + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.Branches["feature"].SourceBranches.ShouldBe( + ["develop", MainBranch, "release", "support", "hotfix"]); + } + + [Test] + public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() + { + const string text = """ + next-version: 1.2.3 + tag-prefix: custom-tag-prefix-from-yml + """; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + + var expectedConfig = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.3") + .WithTagPrefixPattern("custom-tag-prefix-from-yml") + .Build(); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.AssemblyVersioningScheme.ShouldBe(expectedConfig.AssemblyVersioningScheme); + configuration.AssemblyFileVersioningScheme.ShouldBe(expectedConfig.AssemblyFileVersioningScheme); + configuration.AssemblyInformationalFormat.ShouldBe(expectedConfig.AssemblyInformationalFormat); + configuration.AssemblyVersioningFormat.ShouldBe(expectedConfig.AssemblyVersioningFormat); + configuration.AssemblyFileVersioningFormat.ShouldBe(expectedConfig.AssemblyFileVersioningFormat); + configuration.TagPrefixPattern.ShouldBe(expectedConfig.TagPrefixPattern); + configuration.NextVersion.ShouldBe(expectedConfig.NextVersion); + configuration.MajorVersionBumpMessage.ShouldBe(expectedConfig.MajorVersionBumpMessage); + configuration.MinorVersionBumpMessage.ShouldBe(expectedConfig.MinorVersionBumpMessage); + configuration.PatchVersionBumpMessage.ShouldBe(expectedConfig.PatchVersionBumpMessage); + configuration.NoBumpMessage.ShouldBe(expectedConfig.NoBumpMessage); + configuration.TagPreReleaseWeight.ShouldBe(expectedConfig.TagPreReleaseWeight); + configuration.CommitDateFormat.ShouldBe(expectedConfig.CommitDateFormat); + configuration.MergeMessageFormats.ShouldBe(expectedConfig.MergeMessageFormats); + configuration.UpdateBuildNumber.ShouldBe(expectedConfig.UpdateBuildNumber); + + configuration.Ignore.ShouldBeEquivalentTo(expectedConfig.Ignore); + + configuration.Branches.Keys.ShouldBe(expectedConfig.Branches.Keys); + + foreach (var branch in configuration.Branches.Keys) + { + configuration.Branches[branch].ShouldBeEquivalentTo(expectedConfig.Branches[branch]); + } + } + + [Test] + public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile() + { + const string text = ""; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.TagPrefixPattern.ShouldBe(RegexPatterns.Configuration.DefaultTagPrefixRegexPattern); + } + + [Test] + public void ShouldUseTagPrefixFromConfigFileWhenProvided() + { + const string text = "tag-prefix: custom-tag-prefix-from-yml"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); + + configuration.TagPrefixPattern.ShouldBe("custom-tag-prefix-from-yml"); + } + + [Test] + public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPrefixSetAtYmlFile) + { + var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : ""; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var overrideConfiguration = new Dictionary + { + { "tag-prefix", "tag-prefix-from-override-configuration" } + }; + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); + + configuration.TagPrefixPattern.ShouldBe("tag-prefix-from-override-configuration"); + } + + [Test] + public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig() + { + const string text = ""; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var overrideConfiguration = new Dictionary + { + { "next-version", "1.0.0" } + }; + + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); + + configuration.TagPrefixPattern.ShouldBe(RegexPatterns.Configuration.DefaultTagPrefixRegexPattern); + } + + [Test] + public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig() + { + const string text = "tag-prefix: custom-tag-prefix-from-yml"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var overrideConfiguration = new Dictionary + { + { "next-version", "1.0.0" } + }; + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); + + configuration.TagPrefixPattern.ShouldBe("custom-tag-prefix-from-yml"); + } + + [Test] + public void ShouldOverrideTagPrefixFromConfigFileWhenSetInOverrideConfig() + { + const string text = "tag-prefix: custom-tag-prefix-from-yml"; + using var _ = this.fileSystem.SetupConfigFile(path: this.repoPath, text: text); + var overrideConfiguration = new Dictionary + { + { "tag-prefix", "custom-tag-prefix-from-console" } + }; + var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); + + configuration.TagPrefixPattern.ShouldBe("custom-tag-prefix-from-console"); + } +} diff --git a/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs b/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs new file mode 100644 index 0000000000..dafc7c5ce0 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs @@ -0,0 +1,27 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; + +namespace GitVersion.Configuration.Tests.Configuration; + +public static class Extensions +{ + public static IDisposable SetupConfigFile(this IFileSystem fileSystem, string? path = null, string fileName = ConfigurationFileLocator.DefaultFileName, string text = "") + { + if (path.IsNullOrEmpty()) + { + path = FileSystemHelper.Path.GetRepositoryTempPath(); + } + + var fullPath = FileSystemHelper.Path.Combine(path, fileName); + var directory = FileSystemHelper.Path.GetDirectoryName(fullPath); + if (!fileSystem.Directory.Exists(directory)) + { + fileSystem.Directory.CreateDirectory(directory); + } + + fileSystem.File.WriteAllText(fullPath, text); + + return Disposable.Create(fullPath, () => fileSystem.File.Delete(fullPath)); + } +} diff --git a/src/GitVersion.Configuration.Tests/Configuration/IgnoreConfigurationTests.cs b/src/GitVersion.Configuration.Tests/Configuration/IgnoreConfigurationTests.cs new file mode 100644 index 0000000000..7d16ba2289 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Configuration/IgnoreConfigurationTests.cs @@ -0,0 +1,82 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using YamlDotNet.Core; + +namespace GitVersion.Core.Tests.Configuration; + +[TestFixture] +public class IgnoreConfigurationTests : TestBase +{ + private readonly ConfigurationSerializer serializer = new(); + + [Test] + public void CanDeserialize() + { + const string yaml = + """ + ignore: + sha: [b6c0c9fda88830ebcd563e500a5a7da5a1658e98] + commits-before: 2015-10-23T12:23:15 + """; + + var configuration = serializer.ReadConfiguration(yaml); + + configuration.ShouldNotBeNull(); + configuration.Ignore.ShouldNotBeNull(); + configuration.Ignore.Shas.ShouldNotBeEmpty(); + configuration.Ignore.Shas.ShouldBe(["b6c0c9fda88830ebcd563e500a5a7da5a1658e98"]); + configuration.Ignore.Before.ShouldBe(DateTimeOffset.Parse("2015-10-23T12:23:15")); + } + + [Test] + public void ShouldSupportsOtherSequenceFormat() + { + const string yaml = + """ + ignore: + sha: + - b6c0c9fda88830ebcd563e500a5a7da5a1658e98 + - 6c19c7c219ecf8dbc468042baefa73a1b213e8b1 + """; + + var configuration = serializer.ReadConfiguration(yaml); + + configuration.ShouldNotBeNull(); + configuration.Ignore.ShouldNotBeNull(); + configuration.Ignore.Shas.ShouldNotBeEmpty(); + configuration.Ignore.Shas.ShouldBe(["b6c0c9fda88830ebcd563e500a5a7da5a1658e98", "6c19c7c219ecf8dbc468042baefa73a1b213e8b1"]); + } + + [Test] + public void WhenNotInConfigShouldHaveDefaults() + { + const string yaml = "next-version: 1.0"; + + var configuration = serializer.ReadConfiguration(yaml); + + configuration.ShouldNotBeNull(); + configuration.Ignore.ShouldNotBeNull(); + configuration.Ignore.Shas.ShouldBeEmpty(); + configuration.Ignore.Before.ShouldBe(null); + } + + [Test] + public void WhenBadDateFormatShouldFail() + { + const string yaml = + """ + ignore: + commits-before: bad format date + """; + + Should.Throw(() => serializer.ReadConfiguration(yaml)); + } + + [Test] + public void NewInstanceShouldBeEmpty() + { + var ignoreConfig = new IgnoreConfiguration(); + + ignoreConfig.IsEmpty.ShouldBeTrue(); + } +} diff --git a/src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj b/src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj new file mode 100644 index 0000000000..fdfd126300 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + diff --git a/src/GitVersion.Configuration.Tests/Workflows/WorkflowsTests.cs b/src/GitVersion.Configuration.Tests/Workflows/WorkflowsTests.cs new file mode 100644 index 0000000000..801d5239c4 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Workflows/WorkflowsTests.cs @@ -0,0 +1,36 @@ +namespace GitVersion.Configuration.Tests.Configuration; + +[TestFixture] +public class WorkflowsTests +{ + private readonly ConfigurationSerializer serializer = new(); + + private static readonly object[][] Workflows = + [ + ["GitFlow/v1", GitFlowConfigurationBuilder.New], + ["GitHubFlow/v1", GitHubFlowConfigurationBuilder.New], + ["TrunkBased/preview1", TrunkBasedConfigurationBuilder.New] + ]; + + [Test(Description = "This test is to ensure that the configuration for workflow is up to date")] + [TestCaseSource(nameof(Workflows))] + public void CheckWorkflowsAreUpdated(string workflow, IConfigurationBuilder configurationBuilder) + { + var configuration = configurationBuilder.Build(); + + var serializedConfiguration = serializer.Serialize(configuration); + var segments = workflow.Split("/"); + var folderName = segments[0]; + var fileName = segments[^1]; + + serializedConfiguration.ShouldMatchApproved(builder => builder + .WithFilenameGenerator((_, _, type, extension) => FilenameGenerator(fileName, type, extension)) + .WithFileExtension("yml") + .SubFolder($"approved/{folderName}")); + } + + private static string FilenameGenerator(string fileName, string type, string ext) => + type == "approved" + ? $"{fileName}.{ext}" + : $"{fileName}.{type}.{ext}"; +} diff --git a/src/GitVersion.Configuration.Tests/Workflows/approved/GitFlow/v1.yml b/src/GitVersion.Configuration.Tests/Workflows/approved/GitFlow/v1.yml new file mode 100644 index 0000000000..dd44250ac5 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Workflows/approved/GitFlow/v1.yml @@ -0,0 +1,167 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + develop: + mode: ContinuousDelivery + label: alpha + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-target: true + track-merge-message: true + regex: ^dev(elop)?(ment)?$ + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: true + is-release-branch: false + is-main-branch: false + pre-release-weight: 0 + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Minor + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-target: false + regex: ^releases?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - develop + - main + - release + - support + - hotfix + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - develop + - main + - release + - feature + - support + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + hotfix: + mode: ManualDeployment + label: beta + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + - support + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + support: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + regex: ^support[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: true + regex: (?.+) + source-branches: + - main + - develop + - release + - feature + - pull-request + - hotfix + - support + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/src/GitVersion.Configuration.Tests/Workflows/approved/GitHubFlow/v1.yml b/src/GitVersion.Configuration.Tests/Workflows/approved/GitHubFlow/v1.yml new file mode 100644 index 0000000000..be7da3a729 --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Workflows/approved/GitHubFlow/v1.yml @@ -0,0 +1,116 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- Fallback +- ConfiguredNextVersion +- MergeMessage +- TaggedCommit +- TrackReleaseBranches +- VersionInBranchName +branches: + main: + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + release: + mode: ManualDeployment + label: beta + increment: Patch + prevent-increment: + of-merged-branch: true + when-branch-merged: false + when-current-commit-tagged: false + track-merge-target: false + track-merge-message: true + regex: ^releases?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + feature: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + - release + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - release + - feature + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + mode: ManualDeployment + label: '{BranchName}' + increment: Inherit + prevent-increment: + when-current-commit-tagged: false + track-merge-message: false + regex: (?.+) + source-branches: + - main + - release + - feature + - pull-request + is-source-branch-for: [] + is-main-branch: false +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/src/GitVersion.Configuration.Tests/Workflows/approved/TrunkBased/preview1.yml b/src/GitVersion.Configuration.Tests/Workflows/approved/TrunkBased/preview1.yml new file mode 100644 index 0000000000..c261444d9f --- /dev/null +++ b/src/GitVersion.Configuration.Tests/Workflows/approved/TrunkBased/preview1.yml @@ -0,0 +1,101 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +tag-prefix: '[vV]?' +version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* +major-version-bump-message: \+semver:\s?(breaking|major) +minor-version-bump-message: \+semver:\s?(feature|minor) +patch-version-bump-message: \+semver:\s?(fix|patch) +no-bump-message: \+semver:\s?(none|skip) +tag-pre-release-weight: 60000 +commit-date-format: yyyy-MM-dd +merge-message-formats: {} +update-build-number: true +semantic-version-format: Strict +strategies: +- ConfiguredNextVersion +- Mainline +branches: + main: + mode: ContinuousDeployment + label: '' + increment: Patch + prevent-increment: + of-merged-branch: true + track-merge-target: false + track-merge-message: true + regex: ^master$|^main$ + source-branches: [] + is-source-branch-for: [] + tracks-release-branches: false + is-release-branch: false + is-main-branch: true + pre-release-weight: 55000 + feature: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Minor + prevent-increment: + when-current-commit-tagged: false + track-merge-message: true + regex: ^features?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-main-branch: false + pre-release-weight: 30000 + hotfix: + mode: ContinuousDelivery + label: '{BranchName}' + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: ^hotfix(es)?[\/-](?.+) + source-branches: + - main + is-source-branch-for: [] + is-release-branch: true + is-main-branch: false + pre-release-weight: 30000 + pull-request: + mode: ContinuousDelivery + label: PullRequest{Number} + increment: Inherit + prevent-increment: + of-merged-branch: true + when-current-commit-tagged: false + track-merge-message: true + regex: ^(pull-requests|pull|pr)[\/-](?\d*) + source-branches: + - main + - feature + - hotfix + is-source-branch-for: [] + pre-release-weight: 30000 + unknown: + increment: Patch + prevent-increment: + when-current-commit-tagged: false + regex: (?.+) + source-branches: + - main + is-source-branch-for: [] + pre-release-weight: 30000 +ignore: + sha: [] + paths: [] +mode: ContinuousDelivery +label: '{BranchName}' +increment: Inherit +prevent-increment: + of-merged-branch: false + when-branch-merged: false + when-current-commit-tagged: true +track-merge-target: false +track-merge-message: true +commit-message-incrementing: Enabled +regex: '' +source-branches: [] +is-source-branch-for: [] +tracks-release-branches: false +is-release-branch: false +is-main-branch: false diff --git a/src/GitVersion.Configuration/Attributes/JsonPropertyDefaultAttribute.cs b/src/GitVersion.Configuration/Attributes/JsonPropertyDefaultAttribute.cs new file mode 100644 index 0000000000..375a8ca093 --- /dev/null +++ b/src/GitVersion.Configuration/Attributes/JsonPropertyDefaultAttribute.cs @@ -0,0 +1,45 @@ +namespace GitVersion.Configuration.Attributes; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +public sealed class JsonPropertyDefaultAttribute : JsonAttribute +{ + /// + /// Initializes a new instance of with the specified default property value. + /// + /// The default value of the property. + public JsonPropertyDefaultAttribute(string? value) => Value = value ?? "null"; + + /// + public JsonPropertyDefaultAttribute(bool value) : this(value ? "true" : "false") { } + + /// + /// The Enum value is converted to string, preferring the symbol name over the numeral if possible. + public JsonPropertyDefaultAttribute(SemanticVersionFormat value) : this(value.ToString()) { } + /// + public JsonPropertyDefaultAttribute(AssemblyVersioningScheme value) : this(value.ToString()) { } + /// + public JsonPropertyDefaultAttribute(AssemblyFileVersioningScheme value) : this(value.ToString()) { } + + /// + /// Depending on the Type of the boxed value, the resulting string will be automatically enclosed with single-quotes. If the boxed value is NOT a string and is converted to a string from a numeric , object, array, boolean, or null-only type, then it will NOT be enclosed with single-quotes. + public JsonPropertyDefaultAttribute(object? boxedValue) + { + if (boxedValue is not null) + { + var type = boxedValue.GetType(); + var typedObj = Convert.ChangeType(boxedValue, type); + Value = typedObj.ToString() ?? string.Empty; + if (Value == type.ToString()) + Value = JsonSerializer.Serialize(typedObj, type); + } + else + { + Value = "null"; + } + } + + /// + /// The description of the property. + /// + public string Value { get; } +} diff --git a/src/GitVersion.Configuration/Attributes/JsonPropertyDescriptionAttribute.cs b/src/GitVersion.Configuration/Attributes/JsonPropertyDescriptionAttribute.cs new file mode 100644 index 0000000000..5fdc9de548 --- /dev/null +++ b/src/GitVersion.Configuration/Attributes/JsonPropertyDescriptionAttribute.cs @@ -0,0 +1,14 @@ +#if GITVERSION_CONFIGURATION +namespace GitVersion.Configuration.Attributes; +#elif GITVERSION_OUTPUT +namespace GitVersion.Output.Attributes; +#endif + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +public sealed class JsonPropertyDescriptionAttribute(string description) : JsonAttribute +{ + /// + /// The description of the property. + /// + public string Description { get; } = description; +} diff --git a/src/GitVersion.Configuration/Attributes/JsonPropertyFormatAttribute.cs b/src/GitVersion.Configuration/Attributes/JsonPropertyFormatAttribute.cs new file mode 100644 index 0000000000..86cbd6358f --- /dev/null +++ b/src/GitVersion.Configuration/Attributes/JsonPropertyFormatAttribute.cs @@ -0,0 +1,41 @@ +namespace GitVersion.Configuration.Attributes; + +/// +/// The format keyword allows for basic semantic identification of certain kinds of string values that are commonly used. For example, because JSON doesn't have a "DateTime" type, dates need to be encoded as strings. format allows the schema author to indicate that the string value should be interpreted as a date. By default, format is just an annotation and does not affect validation. +/// Optionally, validator implementations can [...] enable format to function as an assertion rather than just an annotation. +/// +/// +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +public sealed class JsonPropertyFormatAttribute(Format format) : JsonAttribute +{ + /// + /// The format of the string. + /// + public Format Format { get; } = format; +} + +/// +/// Enum bindings for Json.Schema.Formats of JsonSchema.Net 5.2.7 +/// +public enum Format +{ + Date, + DateTime, + Duration, + Email, + Hostname, + IdnEmail, + IdnHostname, + Ipv4, + Ipv6, + Iri, + IriReference, + JsonPointer, + Regex, + RelativeJsonPointer, + Time, + Uri, + UriReference, + UriTemplate, + Uuid +} diff --git a/src/GitVersion.Configuration/BranchConfiguration.cs b/src/GitVersion.Configuration/BranchConfiguration.cs new file mode 100644 index 0000000000..699f67fcd5 --- /dev/null +++ b/src/GitVersion.Configuration/BranchConfiguration.cs @@ -0,0 +1,129 @@ +using GitVersion.Configuration.Attributes; +using GitVersion.Extensions; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal record BranchConfiguration : IBranchConfiguration +{ + [JsonPropertyName("mode")] + [JsonPropertyDescription("The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.")] + public DeploymentMode? DeploymentMode { get; internal init; } + + [JsonPropertyName("label")] + [JsonPropertyDescription("The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).")] + public string? Label { get; internal init; } + + [JsonPropertyName("increment")] + [JsonPropertyDescription("The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.")] + public IncrementStrategy Increment { get; internal init; } + + [JsonIgnore] + IPreventIncrementConfiguration IBranchConfiguration.PreventIncrement => PreventIncrement; + + [JsonPropertyName("prevent-increment")] + [JsonPropertyDescription("The prevent increment configuration section.")] + public PreventIncrementConfiguration PreventIncrement { get; internal init; } = new(); + + [JsonPropertyName("track-merge-target")] + [JsonPropertyDescription("Strategy which will look for tagged merge commits directly off the current branch.")] + public bool? TrackMergeTarget { get; internal init; } + + [JsonPropertyName("track-merge-message")] + [JsonPropertyDescription("This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.")] + public bool? TrackMergeMessage { get; internal init; } + + [JsonPropertyName("commit-message-incrementing")] + [JsonPropertyDescription("Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.")] + public CommitMessageIncrementMode? CommitMessageIncrementing { get; internal init; } + + [JsonPropertyName("regex")] + [JsonPropertyDescription("The regular expression pattern to use to match this branch.")] + [JsonPropertyFormat(Format.Regex)] + public string? RegularExpression { get; internal init; } + + [JsonIgnore] + string? IBranchConfiguration.RegularExpression => RegularExpression; + + [JsonPropertyName("source-branches")] + [JsonPropertyDescription("The source branches for this branch.")] + public HashSet SourceBranches { get; internal init; } = []; + + [JsonIgnore] + IReadOnlyCollection IBranchConfiguration.SourceBranches => SourceBranches; + + [JsonPropertyName("is-source-branch-for")] + [JsonPropertyDescription("The branches that this branch is a source branch.")] + public HashSet IsSourceBranchFor { get; internal init; } = []; + + [JsonIgnore] + IReadOnlyCollection IBranchConfiguration.IsSourceBranchFor => IsSourceBranchFor; + + [JsonPropertyName("tracks-release-branches")] + [JsonPropertyDescription("Indicates this branch configuration represents develop in GitFlow.")] + public bool? TracksReleaseBranches { get; internal init; } + + [JsonPropertyName("is-release-branch")] + [JsonPropertyDescription("Indicates this branch configuration represents a release branch in GitFlow.")] + public bool? IsReleaseBranch { get; internal init; } + + [JsonPropertyName("is-main-branch")] + [JsonPropertyDescription("When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.")] + public bool? IsMainBranch { get; internal init; } + + [JsonPropertyName("pre-release-weight")] + [JsonPropertyDescription("Provides a way to translate the PreReleaseLabel to a number.")] + public int? PreReleaseWeight { get; internal init; } + + public virtual IBranchConfiguration Inherit(IBranchConfiguration configuration) + { + configuration.NotNull(); + + return new BranchConfiguration(this) + { + Increment = Increment == IncrementStrategy.Inherit ? configuration.Increment : Increment, + DeploymentMode = DeploymentMode ?? configuration.DeploymentMode, + Label = Label ?? configuration.Label, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = PreventIncrement.OfMergedBranch ?? configuration.PreventIncrement.OfMergedBranch, + WhenBranchMerged = PreventIncrement.WhenBranchMerged ?? configuration.PreventIncrement.WhenBranchMerged, + WhenCurrentCommitTagged = PreventIncrement.WhenCurrentCommitTagged ?? configuration.PreventIncrement.WhenCurrentCommitTagged + }, + TrackMergeTarget = TrackMergeTarget ?? configuration.TrackMergeTarget, + TrackMergeMessage = TrackMergeMessage ?? configuration.TrackMergeMessage, + CommitMessageIncrementing = CommitMessageIncrementing ?? configuration.CommitMessageIncrementing, + RegularExpression = RegularExpression ?? configuration.RegularExpression, + TracksReleaseBranches = TracksReleaseBranches ?? configuration.TracksReleaseBranches, + IsReleaseBranch = IsReleaseBranch ?? configuration.IsReleaseBranch, + IsMainBranch = IsMainBranch ?? configuration.IsMainBranch, + PreReleaseWeight = PreReleaseWeight ?? configuration.PreReleaseWeight + }; + } + + public virtual IBranchConfiguration Inherit(EffectiveConfiguration configuration) + { + configuration.NotNull(); + + return new BranchConfiguration(this) + { + Increment = Increment == IncrementStrategy.Inherit ? configuration.Increment : Increment, + DeploymentMode = DeploymentMode ?? configuration.DeploymentMode, + Label = Label ?? configuration.Label, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = PreventIncrement.OfMergedBranch ?? configuration.PreventIncrementOfMergedBranch, + WhenBranchMerged = PreventIncrement.WhenBranchMerged ?? configuration.PreventIncrementWhenBranchMerged, + WhenCurrentCommitTagged = PreventIncrement.WhenCurrentCommitTagged ?? configuration.PreventIncrementWhenCurrentCommitTagged + }, + TrackMergeTarget = TrackMergeTarget ?? configuration.TrackMergeTarget, + TrackMergeMessage = TrackMergeMessage ?? configuration.TrackMergeMessage, + CommitMessageIncrementing = CommitMessageIncrementing ?? configuration.CommitMessageIncrementing, + RegularExpression = RegularExpression ?? configuration.RegularExpression, + TracksReleaseBranches = TracksReleaseBranches ?? configuration.TracksReleaseBranches, + IsReleaseBranch = IsReleaseBranch ?? configuration.IsReleaseBranch, + IsMainBranch = IsMainBranch ?? configuration.IsMainBranch, + PreReleaseWeight = PreReleaseWeight ?? configuration.PreReleaseWeight + }; + } +} diff --git a/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs new file mode 100644 index 0000000000..c45a5625bd --- /dev/null +++ b/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs @@ -0,0 +1,182 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal class BranchConfigurationBuilder +{ + public static BranchConfigurationBuilder New => new(); + + private DeploymentMode? deploymentMode; + private string? label; + private IncrementStrategy increment; + private bool? preventIncrementOfMergedBranch; + private bool? preventIncrementWhenBranchMerged; + private bool? preventIncrementWhenCurrentCommitTagged; + private bool? trackMergeTarget; + private bool? trackMergeMessage; + private CommitMessageIncrementMode? commitMessageIncrementing; + private string? regularExpression; + private HashSet sourceBranches = []; + private HashSet isSourceBranchFor = []; + private bool? tracksReleaseBranches; + private bool? isReleaseBranch; + private bool? isMainBranch; + private int? preReleaseWeight; + + private BranchConfigurationBuilder() + { + } + + public virtual BranchConfigurationBuilder WithDeploymentMode(DeploymentMode? value) + { + this.deploymentMode = value; + return this; + } + + public virtual BranchConfigurationBuilder WithLabel(string? value) + { + this.label = value; + return this; + } + + public virtual BranchConfigurationBuilder WithIncrement(IncrementStrategy value) + { + this.increment = value; + return this; + } + + public virtual BranchConfigurationBuilder WithPreventIncrementOfMergedBranch(bool? value) + { + this.preventIncrementOfMergedBranch = value; + return this; + } + + public virtual BranchConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value) + { + this.preventIncrementWhenBranchMerged = value; + return this; + } + + public virtual BranchConfigurationBuilder WithPreventIncrementWhenCurrentCommitTagged(bool? value) + { + this.preventIncrementWhenCurrentCommitTagged = value; + return this; + } + + public virtual BranchConfigurationBuilder WithTrackMergeTarget(bool? value) + { + this.trackMergeTarget = value; + return this; + } + + public virtual BranchConfigurationBuilder WithTrackMergeMessage(bool? value) + { + this.trackMergeMessage = value; + return this; + } + + public virtual BranchConfigurationBuilder WithCommitMessageIncrementing(CommitMessageIncrementMode? value) + { + this.commitMessageIncrementing = value; + return this; + } + + public virtual BranchConfigurationBuilder WithRegularExpression([StringSyntax(StringSyntaxAttribute.Regex)] string? value) + { + this.regularExpression = value; + return this; + } + + public virtual BranchConfigurationBuilder WithSourceBranches(IEnumerable values) + { + WithSourceBranches([.. values]); + return this; + } + + public virtual BranchConfigurationBuilder WithSourceBranches(params string[] values) + { + this.sourceBranches = [.. values]; + return this; + } + + public virtual BranchConfigurationBuilder WithIsSourceBranchFor(IEnumerable values) + { + WithIsSourceBranchFor([.. values]); + return this; + } + + public virtual BranchConfigurationBuilder WithIsSourceBranchFor(params string[] values) + { + this.isSourceBranchFor = [.. values]; + return this; + } + + public virtual BranchConfigurationBuilder WithTracksReleaseBranches(bool? value) + { + this.tracksReleaseBranches = value; + return this; + } + + public virtual BranchConfigurationBuilder WithIsReleaseBranch(bool? value) + { + this.isReleaseBranch = value; + return this; + } + + public virtual BranchConfigurationBuilder WithIsMainBranch(bool? value) + { + this.isMainBranch = value; + return this; + } + + public virtual BranchConfigurationBuilder WithPreReleaseWeight(int? value) + { + this.preReleaseWeight = value; + return this; + } + + public virtual BranchConfigurationBuilder WithConfiguration(IBranchConfiguration value) + { + WithDeploymentMode(value.DeploymentMode); + WithLabel(value.Label); + WithIncrement(value.Increment); + WithPreventIncrementOfMergedBranch(value.PreventIncrement.OfMergedBranch); + WithPreventIncrementWhenBranchMerged(value.PreventIncrement.WhenBranchMerged); + WithPreventIncrementWhenCurrentCommitTagged(value.PreventIncrement.WhenCurrentCommitTagged); + WithTrackMergeTarget(value.TrackMergeTarget); + WithTrackMergeMessage(value.TrackMergeMessage); + WithCommitMessageIncrementing(value.CommitMessageIncrementing); + WithRegularExpression(value.RegularExpression); + WithTracksReleaseBranches(value.TracksReleaseBranches); + WithIsReleaseBranch(value.IsReleaseBranch); + WithIsMainBranch(value.IsMainBranch); + WithPreReleaseWeight(value.PreReleaseWeight); + WithSourceBranches(value.SourceBranches); + WithIsSourceBranchFor(value.IsSourceBranchFor); + return this; + } + + public IBranchConfiguration Build() => new BranchConfiguration + { + DeploymentMode = deploymentMode, + Label = label, + Increment = increment, + RegularExpression = regularExpression, + TracksReleaseBranches = tracksReleaseBranches, + TrackMergeTarget = trackMergeTarget, + TrackMergeMessage = trackMergeMessage, + CommitMessageIncrementing = commitMessageIncrementing, + IsMainBranch = isMainBranch, + IsReleaseBranch = isReleaseBranch, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = preventIncrementOfMergedBranch, + WhenBranchMerged = preventIncrementWhenBranchMerged, + WhenCurrentCommitTagged = preventIncrementWhenCurrentCommitTagged + }, + PreReleaseWeight = preReleaseWeight, + SourceBranches = sourceBranches, + IsSourceBranchFor = isSourceBranchFor + }; +} diff --git a/src/GitVersion.Configuration/Builders/ConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/ConfigurationBuilder.cs new file mode 100644 index 0000000000..c3fc245451 --- /dev/null +++ b/src/GitVersion.Configuration/Builders/ConfigurationBuilder.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Configuration; + +internal sealed class ConfigurationBuilder : ConfigurationBuilderBase +{ + public static ConfigurationBuilder New => new(); +} diff --git a/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs b/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs new file mode 100644 index 0000000000..95785bc048 --- /dev/null +++ b/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs @@ -0,0 +1,486 @@ +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal abstract class ConfigurationBuilderBase : IConfigurationBuilder + where TConfigurationBuilder : ConfigurationBuilderBase +{ + private AssemblyVersioningScheme? assemblyVersioningScheme; + private AssemblyFileVersioningScheme? assemblyFileVersioningScheme; + private string? assemblyInformationalFormat; + private string? assemblyVersioningFormat; + private string? assemblyFileVersioningFormat; + private string? tagPrefix; + private string? versionInBranchPattern; + private string? nextVersion; + private string? majorVersionBumpMessage; + private string? minorVersionBumpMessage; + private string? patchVersionBumpMessage; + private string? noBumpMessage; + private int? tagPreReleaseWeight; + private IgnoreConfiguration ignore; + private string? commitDateFormat; + private bool updateBuildNumber; + private SemanticVersionFormat semanticVersionFormat; + private VersionStrategies[] versionStrategies; + private Dictionary mergeMessageFormats = []; + private readonly List> overrides = []; + private readonly Dictionary branchConfigurationBuilders = []; + private DeploymentMode? versioningMode; + private string? label; + private IncrementStrategy increment = IncrementStrategy.Inherit; + private bool? preventIncrementOfMergedBranch; + private bool? preventIncrementWhenBranchMerged; + private bool? preventIncrementWhenCurrentCommitTagged; + private bool? trackMergeTarget; + private bool? trackMergeMessage; + private CommitMessageIncrementMode? commitMessageIncrementing; + private string? regularExpression; + private bool? tracksReleaseBranches; + private bool? isReleaseBranch; + private bool? isMainBranch; + private int? preReleaseWeight; + + protected readonly BranchMetaData MainBranch = new() + { + Name = ConfigurationConstants.MainBranchKey, + RegexPattern = RegexPatterns.Configuration.MainBranchRegexPattern + }; + + protected readonly BranchMetaData DevelopBranch = new() + { + Name = ConfigurationConstants.DevelopBranchKey, + RegexPattern = RegexPatterns.Configuration.DevelopBranchRegexPattern + }; + + protected readonly BranchMetaData ReleaseBranch = new() + { + Name = ConfigurationConstants.ReleaseBranchKey, + RegexPattern = RegexPatterns.Configuration.ReleaseBranchRegexPattern + }; + + protected readonly BranchMetaData FeatureBranch = new() + { + Name = ConfigurationConstants.FeatureBranchKey, + RegexPattern = RegexPatterns.Configuration.FeatureBranchRegexPattern + }; + + protected readonly BranchMetaData PullRequestBranch = new() + { + Name = ConfigurationConstants.PullRequestBranchKey, + RegexPattern = RegexPatterns.Configuration.PullRequestBranchRegexPattern + }; + + protected readonly BranchMetaData HotfixBranch = new() + { + Name = ConfigurationConstants.HotfixBranchKey, + RegexPattern = RegexPatterns.Configuration.HotfixBranchRegexPattern + }; + + protected readonly BranchMetaData SupportBranch = new() + { + Name = ConfigurationConstants.SupportBranchKey, + RegexPattern = RegexPatterns.Configuration.SupportBranchRegexPattern + }; + + protected readonly BranchMetaData UnknownBranch = new() + { + Name = ConfigurationConstants.UnknownBranchKey, + RegexPattern = RegexPatterns.Configuration.UnknownBranchRegexPattern + }; + + protected ConfigurationBuilderBase() + { + if (GetType() != typeof(TConfigurationBuilder)) + { + throw new ArgumentException("The generic type parameter is not equal to the instance type."); + } + } + + public TConfigurationBuilder WithAssemblyVersioningScheme(AssemblyVersioningScheme? value) + { + this.assemblyVersioningScheme = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithAssemblyFileVersioningScheme(AssemblyFileVersioningScheme? value) + { + this.assemblyFileVersioningScheme = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithAssemblyInformationalFormat(string? value) + { + this.assemblyInformationalFormat = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithAssemblyVersioningFormat(string? value) + { + this.assemblyVersioningFormat = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithAssemblyFileVersioningFormat(string? value) + { + this.assemblyFileVersioningFormat = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithTagPrefixPattern(string? value) + { + this.tagPrefix = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithVersionInBranchPattern(string? value) + { + this.versionInBranchPattern = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithNextVersion(string? value) + { + this.nextVersion = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithMajorVersionBumpMessage(string? value) + { + this.majorVersionBumpMessage = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithMinorVersionBumpMessage(string? value) + { + this.minorVersionBumpMessage = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithPatchVersionBumpMessage(string? value) + { + this.patchVersionBumpMessage = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithNoBumpMessage(string? value) + { + this.noBumpMessage = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithTagPreReleaseWeight(int? value) + { + this.tagPreReleaseWeight = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithIgnoreConfiguration(IIgnoreConfiguration value) + { + this.ignore = (IgnoreConfiguration)value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithCommitDateFormat(string? value) + { + this.commitDateFormat = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithUpdateBuildNumber(bool value) + { + this.updateBuildNumber = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithSemanticVersionFormat(SemanticVersionFormat value) + { + this.semanticVersionFormat = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithVersionStrategy(VersionStrategies value) + { + this.versionStrategies = [.. Enum.GetValues().Where(element => element != VersionStrategies.None && value.HasFlag(element))]; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithVersionStrategies(params VersionStrategies[] values) + { + this.versionStrategies = values; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithMergeMessageFormats(IReadOnlyDictionary value) + { + this.mergeMessageFormats = new(value); + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithoutBranches() + { + this.branchConfigurationBuilders.Clear(); + return (TConfigurationBuilder)this; + } + + public BranchConfigurationBuilder WithBranch(string value) + => this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New); + + public BranchConfigurationBuilder WithBranch(string value, BranchConfigurationBuilder builder) + => this.branchConfigurationBuilders.GetOrAdd(value, () => builder); + + public TConfigurationBuilder WithBranch(string value, Action action) + { + var result = this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New); + action(result); + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithDeploymentMode(DeploymentMode? value) + { + this.versioningMode = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithLabel(string? value) + { + this.label = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithIncrement(IncrementStrategy value) + { + this.increment = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithPreventIncrementOfMergedBranch(bool? value) + { + this.preventIncrementOfMergedBranch = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value) + { + this.preventIncrementWhenBranchMerged = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithPreventIncrementWhenCurrentCommitTagged(bool? value) + { + this.preventIncrementWhenCurrentCommitTagged = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithTrackMergeTarget(bool? value) + { + this.trackMergeTarget = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithTrackMergeMessage(bool? value) + { + this.trackMergeMessage = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithCommitMessageIncrementing(CommitMessageIncrementMode? value) + { + this.commitMessageIncrementing = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithRegularExpression(string? value) + { + this.regularExpression = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithTracksReleaseBranches(bool? value) + { + this.tracksReleaseBranches = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithIsReleaseBranch(bool? value) + { + this.isReleaseBranch = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithIsMainBranch(bool? value) + { + this.isMainBranch = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithPreReleaseWeight(int? value) + { + this.preReleaseWeight = value; + return (TConfigurationBuilder)this; + } + + public TConfigurationBuilder WithConfiguration(IGitVersionConfiguration value) + { + WithAssemblyVersioningScheme(value.AssemblyVersioningScheme); + WithAssemblyFileVersioningScheme(value.AssemblyFileVersioningScheme); + WithAssemblyInformationalFormat(value.AssemblyInformationalFormat); + WithAssemblyVersioningFormat(value.AssemblyVersioningFormat); + WithAssemblyFileVersioningFormat(value.AssemblyFileVersioningFormat); + WithTagPrefixPattern(value.TagPrefixPattern); + WithVersionInBranchPattern(value.VersionInBranchPattern); + WithNextVersion(value.NextVersion); + WithMajorVersionBumpMessage(value.MajorVersionBumpMessage); + WithMinorVersionBumpMessage(value.MinorVersionBumpMessage); + WithPatchVersionBumpMessage(value.PatchVersionBumpMessage); + WithNoBumpMessage(value.NoBumpMessage); + WithTagPreReleaseWeight(value.TagPreReleaseWeight); + WithIgnoreConfiguration(value.Ignore); + WithCommitDateFormat(value.CommitDateFormat); + WithUpdateBuildNumber(value.UpdateBuildNumber); + WithSemanticVersionFormat(value.SemanticVersionFormat); + WithVersionStrategy(value.VersionStrategy); + WithMergeMessageFormats(value.MergeMessageFormats); + foreach (var (name, branchConfiguration) in value.Branches) + { + WithBranch(name).WithConfiguration(branchConfiguration); + } + WithDeploymentMode(value.DeploymentMode); + WithLabel(value.Label); + WithIncrement(value.Increment); + WithPreventIncrementOfMergedBranch(value.PreventIncrement.OfMergedBranch); + WithPreventIncrementWhenBranchMerged(value.PreventIncrement.WhenBranchMerged); + WithPreventIncrementWhenCurrentCommitTagged(value.PreventIncrement.WhenCurrentCommitTagged); + WithTrackMergeTarget(value.TrackMergeTarget); + WithTrackMergeMessage(value.TrackMergeMessage); + WithCommitMessageIncrementing(value.CommitMessageIncrementing); + WithRegularExpression(value.RegularExpression); + WithTracksReleaseBranches(value.TracksReleaseBranches); + WithIsReleaseBranch(value.IsReleaseBranch); + WithIsMainBranch(value.IsMainBranch); + WithPreReleaseWeight(value.PreReleaseWeight); + return (TConfigurationBuilder)this; + } + + public void AddOverride(IReadOnlyDictionary value) + { + if (value.Any()) + { + this.overrides.Add(value); + } + } + + public virtual IGitVersionConfiguration Build() + { + Dictionary branches = []; + foreach (var (name, branchConfigurationBuilder) in this.branchConfigurationBuilders) + { + branches.Add(name, (BranchConfiguration)branchConfigurationBuilder.Build()); + } + + IGitVersionConfiguration configuration = new GitVersionConfiguration + { + AssemblyVersioningScheme = this.assemblyVersioningScheme, + AssemblyFileVersioningScheme = this.assemblyFileVersioningScheme, + AssemblyInformationalFormat = this.assemblyInformationalFormat, + AssemblyVersioningFormat = this.assemblyVersioningFormat, + AssemblyFileVersioningFormat = this.assemblyFileVersioningFormat, + TagPrefixPattern = this.tagPrefix, + VersionInBranchPattern = this.versionInBranchPattern, + NextVersion = this.nextVersion, + MajorVersionBumpMessage = this.majorVersionBumpMessage, + MinorVersionBumpMessage = this.minorVersionBumpMessage, + PatchVersionBumpMessage = this.patchVersionBumpMessage, + NoBumpMessage = this.noBumpMessage, + TagPreReleaseWeight = this.tagPreReleaseWeight, + Ignore = this.ignore, + CommitDateFormat = this.commitDateFormat, + UpdateBuildNumber = this.updateBuildNumber, + SemanticVersionFormat = this.semanticVersionFormat, + VersionStrategies = versionStrategies, + Branches = branches, + MergeMessageFormats = this.mergeMessageFormats, + DeploymentMode = this.versioningMode, + Label = this.label, + Increment = this.increment, + RegularExpression = this.regularExpression, + TracksReleaseBranches = this.tracksReleaseBranches, + TrackMergeTarget = this.trackMergeTarget, + TrackMergeMessage = this.trackMergeMessage, + CommitMessageIncrementing = this.commitMessageIncrementing, + IsMainBranch = this.isMainBranch, + IsReleaseBranch = this.isReleaseBranch, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = this.preventIncrementOfMergedBranch, + WhenBranchMerged = this.preventIncrementWhenBranchMerged, + WhenCurrentCommitTagged = this.preventIncrementWhenCurrentCommitTagged + }, + PreReleaseWeight = this.preReleaseWeight + }; + + if (this.overrides.Count != 0) + { + ConfigurationHelper configurationHelper = new(configuration); + foreach (var item in this.overrides) + { + configurationHelper.Override(item); + } + configuration = configurationHelper.Configuration; + } + + FinalizeConfiguration(configuration); + ValidateConfiguration(configuration); + + return configuration; + } + + private static void FinalizeConfiguration(IGitVersionConfiguration configuration) + { + foreach (var (name, branchConfiguration) in configuration.Branches) + { + FinalizeBranchConfiguration(configuration, name, branchConfiguration); + } + } + + private static void FinalizeBranchConfiguration(IGitVersionConfiguration configuration, string branchName, + IBranchConfiguration branchConfiguration) + { + var branches = configuration.Branches; + foreach (var targetBranchName in branchConfiguration.IsSourceBranchFor) + { + var targetBranchConfiguration = (BranchConfiguration)branches[targetBranchName]; + targetBranchConfiguration.SourceBranches.Add(branchName); + } + } + + private static void ValidateConfiguration(IGitVersionConfiguration configuration) + { + foreach (var (name, branchConfiguration) in configuration.Branches) + { + var helpUrl = $"{FileSystemHelper.Path.NewLine}See https://gitversion.net/docs/reference/configuration for more info"; + + if (branchConfiguration.RegularExpression == null) + { + throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'regex'{helpUrl}"); + } + + var sourceBranches = branchConfiguration.SourceBranches ?? throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'source-branches'{helpUrl}"); + var missingSourceBranches = sourceBranches.Where(sb => !configuration.Branches.ContainsKey(sb)).ToArray(); + if (missingSourceBranches.Length != 0) + { + throw new ConfigurationException($"Branch configuration '{name}' defines these 'source-branches' that are not configured: '[{string.Join(",", missingSourceBranches)}]'{helpUrl}"); + } + } + } + + protected record BranchMetaData + { + public string Name { get; init; } + + public string RegexPattern { get; init; } + } +} diff --git a/src/GitVersion.Configuration/Builders/EmptyConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/EmptyConfigurationBuilder.cs new file mode 100644 index 0000000000..b5431ee613 --- /dev/null +++ b/src/GitVersion.Configuration/Builders/EmptyConfigurationBuilder.cs @@ -0,0 +1,22 @@ +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal sealed class EmptyConfigurationBuilder : ConfigurationBuilderBase +{ + public static EmptyConfigurationBuilder New => new(); + + private EmptyConfigurationBuilder() + { + GitVersionConfiguration configuration = new() + { + DeploymentMode = DeploymentMode.ContinuousDelivery, + AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, + AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, + CommitDateFormat = "yyyy-MM-dd", + CommitMessageIncrementing = CommitMessageIncrementMode.Enabled, + TagPreReleaseWeight = 0 + }; + WithConfiguration(configuration); + } +} diff --git a/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs new file mode 100644 index 0000000000..b45967ac4c --- /dev/null +++ b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs @@ -0,0 +1,212 @@ +using GitVersion.Core; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal sealed class GitFlowConfigurationBuilder : ConfigurationBuilderBase +{ + public static GitFlowConfigurationBuilder New => new(); + + private GitFlowConfigurationBuilder() + { + WithConfiguration(new GitVersionConfiguration + { + AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme, + AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme, + CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat, + MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorRegexPattern, + MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorRegexPattern, + NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpRegexPattern, + PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchRegexPattern, + SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat, + VersionStrategies = ConfigurationConstants.DefaultVersionStrategies, + TagPrefixPattern = RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, + VersionInBranchPattern = RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern, + TagPreReleaseWeight = ConfigurationConstants.DefaultTagPreReleaseWeight, + UpdateBuildNumber = ConfigurationConstants.DefaultUpdateBuildNumber, + DeploymentMode = DeploymentMode.ContinuousDelivery, + RegularExpression = string.Empty, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit, + CommitMessageIncrementing = CommitMessageIncrementMode.Enabled, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = false, + WhenBranchMerged = false, + WhenCurrentCommitTagged = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + TracksReleaseBranches = false, + IsReleaseBranch = false, + IsMainBranch = false + }); + + WithBranch(DevelopBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Minor, + DeploymentMode = DeploymentMode.ContinuousDelivery, + RegularExpression = DevelopBranch.RegexPattern, + SourceBranches = [this.MainBranch.Name], + Label = "alpha", + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + TrackMergeTarget = true, + TrackMergeMessage = true, + TracksReleaseBranches = true, + IsMainBranch = false, + IsReleaseBranch = false, + PreReleaseWeight = 0 + }); + + WithBranch(MainBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Patch, + RegularExpression = MainBranch.RegexPattern, + SourceBranches = [], + Label = string.Empty, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + TracksReleaseBranches = false, + IsMainBranch = true, + IsReleaseBranch = false, + PreReleaseWeight = 55000 + }); + + WithBranch(ReleaseBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Minor, + DeploymentMode = DeploymentMode.ManualDeployment, + RegularExpression = ReleaseBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name, + this.SupportBranch.Name + ], + Label = "beta", + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true, + WhenCurrentCommitTagged = false + }, + TrackMergeTarget = false, + TracksReleaseBranches = false, + IsMainBranch = false, + IsReleaseBranch = true, + PreReleaseWeight = 30000 + }); + + WithBranch(FeatureBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Inherit, + RegularExpression = FeatureBranch.RegexPattern, + DeploymentMode = DeploymentMode.ManualDeployment, + SourceBranches = + [ + this.DevelopBranch.Name, + this.MainBranch.Name, + this.ReleaseBranch.Name, + this.SupportBranch.Name, + this.HotfixBranch.Name + ], + Label = ConfigurationConstants.BranchNamePlaceholder, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + TrackMergeMessage = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(PullRequestBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Inherit, + RegularExpression = PullRequestBranch.RegexPattern, + DeploymentMode = DeploymentMode.ContinuousDelivery, + SourceBranches = + [ + this.DevelopBranch.Name, + this.MainBranch.Name, + this.ReleaseBranch.Name, + this.FeatureBranch.Name, + this.SupportBranch.Name, + this.HotfixBranch.Name + ], + Label = $"PullRequest{ConfigurationConstants.PullRequestNumberPlaceholder}", + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true, + WhenCurrentCommitTagged = false + }, + TrackMergeMessage = true, + PreReleaseWeight = 30000 + }); + + WithBranch(HotfixBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Inherit, + RegularExpression = HotfixBranch.RegexPattern, + DeploymentMode = DeploymentMode.ManualDeployment, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + SourceBranches = + [ + this.MainBranch.Name, + this.SupportBranch.Name + ], + Label = "beta", + IsReleaseBranch = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(SupportBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Patch, + RegularExpression = SupportBranch.RegexPattern, + SourceBranches = [this.MainBranch.Name], + Label = string.Empty, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true + }, + TrackMergeTarget = false, + TracksReleaseBranches = false, + IsMainBranch = true, + IsReleaseBranch = false, + PreReleaseWeight = 55000 + }); + + WithBranch(UnknownBranch.Name).WithConfiguration(new BranchConfiguration + { + RegularExpression = UnknownBranch.RegexPattern, + DeploymentMode = DeploymentMode.ManualDeployment, + Increment = IncrementStrategy.Inherit, + SourceBranches = + [ + this.MainBranch.Name, + this.DevelopBranch.Name, + this.ReleaseBranch.Name, + this.FeatureBranch.Name, + this.PullRequestBranch.Name, + this.HotfixBranch.Name, + this.SupportBranch.Name + ], + Label = ConfigurationConstants.BranchNamePlaceholder, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = true + }, + IsMainBranch = false + }); + } +} diff --git a/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs new file mode 100644 index 0000000000..3a95c130d4 --- /dev/null +++ b/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs @@ -0,0 +1,149 @@ +using GitVersion.Core; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal sealed class GitHubFlowConfigurationBuilder : ConfigurationBuilderBase +{ + public static GitHubFlowConfigurationBuilder New => new(); + + private GitHubFlowConfigurationBuilder() + { + WithConfiguration(new GitVersionConfiguration + { + AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme, + AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme, + CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat, + MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorRegexPattern, + MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorRegexPattern, + NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpRegexPattern, + PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchRegexPattern, + SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat, + VersionStrategies = ConfigurationConstants.DefaultVersionStrategies, + TagPrefixPattern = RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, + VersionInBranchPattern = RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern, + TagPreReleaseWeight = ConfigurationConstants.DefaultTagPreReleaseWeight, + UpdateBuildNumber = ConfigurationConstants.DefaultUpdateBuildNumber, + DeploymentMode = DeploymentMode.ContinuousDelivery, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = false, + WhenBranchMerged = false, + WhenCurrentCommitTagged = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + CommitMessageIncrementing = CommitMessageIncrementMode.Enabled, + RegularExpression = string.Empty, + TracksReleaseBranches = false, + IsReleaseBranch = false, + IsMainBranch = false + }); + + WithBranch(MainBranch.Name).WithConfiguration(new BranchConfiguration + { + Label = string.Empty, + Increment = IncrementStrategy.Patch, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + RegularExpression = MainBranch.RegexPattern, + SourceBranches = [], + TracksReleaseBranches = false, + IsReleaseBranch = false, + IsMainBranch = true, + PreReleaseWeight = 55000 + }); + + WithBranch(ReleaseBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ManualDeployment, + Label = "beta", + Increment = IncrementStrategy.Patch, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true, + WhenBranchMerged = false, + WhenCurrentCommitTagged = false + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + RegularExpression = ReleaseBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name + ], + TracksReleaseBranches = false, + IsReleaseBranch = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(FeatureBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ManualDeployment, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + RegularExpression = FeatureBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name, + this.ReleaseBranch.Name + ], + TrackMergeMessage = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(PullRequestBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ContinuousDelivery, + Label = $"PullRequest{ConfigurationConstants.PullRequestNumberPlaceholder}", + Increment = IncrementStrategy.Inherit, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true, + WhenCurrentCommitTagged = false + }, + RegularExpression = PullRequestBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name, + this.ReleaseBranch.Name, + this.FeatureBranch.Name + ], + TrackMergeMessage = true, + PreReleaseWeight = 30000 + }); + + WithBranch(UnknownBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ManualDeployment, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + RegularExpression = UnknownBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name, + this.ReleaseBranch.Name, + this.FeatureBranch.Name, + this.PullRequestBranch.Name + ], + TrackMergeMessage = false, + IsMainBranch = false + }); + } +} diff --git a/src/GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs new file mode 100644 index 0000000000..204a83f10e --- /dev/null +++ b/src/GitVersion.Configuration/Builders/IgnoreConfigurationBuilder.cs @@ -0,0 +1,40 @@ +namespace GitVersion.Configuration; + +internal sealed class IgnoreConfigurationBuilder +{ + public static IgnoreConfigurationBuilder New => new(); + + private DateTimeOffset? before; + + private HashSet shas = []; + + public IgnoreConfigurationBuilder WithBefore(DateTimeOffset? value) + { + this.before = value; + return this; + } + + public IgnoreConfigurationBuilder WithShas(IEnumerable values) + { + WithShas(new HashSet(values)); + return this; + } + + public IgnoreConfigurationBuilder WithShas(params string[] values) + { + WithShas(new HashSet(values)); + return this; + } + + public IgnoreConfigurationBuilder WithShas(HashSet value) + { + this.shas = value; + return this; + } + + public IIgnoreConfiguration Build() => new IgnoreConfiguration + { + Before = before, + Shas = shas + }; +} diff --git a/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs new file mode 100644 index 0000000000..608bcc1533 --- /dev/null +++ b/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs @@ -0,0 +1,141 @@ +using GitVersion.Core; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal sealed class TrunkBasedConfigurationBuilder : ConfigurationBuilderBase +{ + public static TrunkBasedConfigurationBuilder New => new(); + + private TrunkBasedConfigurationBuilder() + { + WithConfiguration(new GitVersionConfiguration + { + AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme, + AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme, + CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat, + MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorRegexPattern, + MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorRegexPattern, + NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpRegexPattern, + PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchRegexPattern, + SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat, + VersionStrategies = [ + VersionStrategies.ConfiguredNextVersion, + VersionStrategies.Mainline + ], + TagPrefixPattern = RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, + VersionInBranchPattern = RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern, + TagPreReleaseWeight = ConfigurationConstants.DefaultTagPreReleaseWeight, + UpdateBuildNumber = ConfigurationConstants.DefaultUpdateBuildNumber, + DeploymentMode = DeploymentMode.ContinuousDelivery, + RegularExpression = string.Empty, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit, + CommitMessageIncrementing = CommitMessageIncrementMode.Enabled, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = false, + WhenBranchMerged = false, + WhenCurrentCommitTagged = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + TracksReleaseBranches = false, + IsReleaseBranch = false, + IsMainBranch = false + }); + + WithBranch(MainBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ContinuousDeployment, + Label = string.Empty, + Increment = IncrementStrategy.Patch, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true + }, + TrackMergeTarget = false, + TrackMergeMessage = true, + RegularExpression = MainBranch.RegexPattern, + SourceBranches = [], + TracksReleaseBranches = false, + IsReleaseBranch = false, + IsMainBranch = true, + PreReleaseWeight = 55000 + }); + + WithBranch(FeatureBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ContinuousDelivery, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Minor, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + RegularExpression = FeatureBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name + ], + TrackMergeMessage = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(HotfixBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ContinuousDelivery, + Label = ConfigurationConstants.BranchNamePlaceholder, + Increment = IncrementStrategy.Patch, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + RegularExpression = HotfixBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name + ], + IsReleaseBranch = true, + IsMainBranch = false, + PreReleaseWeight = 30000 + }); + + WithBranch(PullRequestBranch.Name).WithConfiguration(new BranchConfiguration + { + DeploymentMode = DeploymentMode.ContinuousDelivery, + Label = $"PullRequest{ConfigurationConstants.PullRequestNumberPlaceholder}", + Increment = IncrementStrategy.Inherit, + PreventIncrement = new PreventIncrementConfiguration + { + OfMergedBranch = true, + WhenCurrentCommitTagged = false + }, + RegularExpression = PullRequestBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name, + this.FeatureBranch.Name, + this.HotfixBranch.Name + ], + TrackMergeMessage = true, + PreReleaseWeight = 30000 + }); + + WithBranch(UnknownBranch.Name).WithConfiguration(new BranchConfiguration + { + Increment = IncrementStrategy.Patch, + PreventIncrement = new PreventIncrementConfiguration + { + WhenCurrentCommitTagged = false + }, + RegularExpression = UnknownBranch.RegexPattern, + SourceBranches = + [ + this.MainBranch.Name + ], + PreReleaseWeight = 30000 + }); + } +} diff --git a/src/GitVersion.Configuration/ConfigurationException.cs b/src/GitVersion.Configuration/ConfigurationException.cs new file mode 100644 index 0000000000..971809ace9 --- /dev/null +++ b/src/GitVersion.Configuration/ConfigurationException.cs @@ -0,0 +1,22 @@ +namespace GitVersion.Configuration; + +[Serializable] +public class ConfigurationException : GitVersionException +{ + public ConfigurationException(string msg) + : base(msg) + { + } + + public ConfigurationException(string message, Exception innerException) : base(message, innerException) + { + } + + public ConfigurationException(string messageFormat, params object[] args) : base(messageFormat, args) + { + } + + public ConfigurationException() + { + } +} diff --git a/src/GitVersion.Configuration/ConfigurationFileLocator.cs b/src/GitVersion.Configuration/ConfigurationFileLocator.cs new file mode 100644 index 0000000000..489c39e1f1 --- /dev/null +++ b/src/GitVersion.Configuration/ConfigurationFileLocator.cs @@ -0,0 +1,99 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.Logging; +using Microsoft.Extensions.Options; + +namespace GitVersion.Configuration; + +internal class ConfigurationFileLocator( + IFileSystem fileSystem, + ILog log, + IOptions options) + : IConfigurationFileLocator +{ + public const string DefaultFileName = "GitVersion.yml"; + public const string DefaultAlternativeFileName = "GitVersion.yaml"; + public const string DefaultFileNameDotted = $".{DefaultFileName}"; + public const string DefaultAlternativeFileNameDotted = $".{DefaultAlternativeFileName}"; + + private readonly string[] SupportedConfigFileNames = + [ + DefaultFileName, + DefaultAlternativeFileName, + DefaultFileNameDotted, + DefaultAlternativeFileNameDotted + ]; + + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ILog log = log.NotNull(); + private readonly IOptions options = options.NotNull(); + + private string? ConfigurationFile => options.Value.ConfigurationInfo.ConfigurationFile; + + public void Verify(string? workingDirectory, string? projectRootDirectory) + { + if (FileSystemHelper.Path.IsPathRooted(this.ConfigurationFile)) return; + if (FileSystemHelper.Path.Equal(workingDirectory, projectRootDirectory)) return; + WarnAboutAmbiguousConfigFileSelection(workingDirectory, projectRootDirectory); + } + + public string? GetConfigurationFile(string? directoryPath) + { + var customConfigurationFile = GetCustomConfigurationFilePathIfEligable(directoryPath); + if (!string.IsNullOrWhiteSpace(customConfigurationFile)) + { + this.log.Info($"Found configuration file at '{customConfigurationFile}'"); + return customConfigurationFile; + } + + if (string.IsNullOrWhiteSpace(directoryPath) || !fileSystem.Directory.Exists(directoryPath)) + { + return null; + } + + var files = fileSystem.Directory.GetFiles(directoryPath); + foreach (var fileName in this.SupportedConfigFileNames) + { + this.log.Debug($"Trying to find configuration file {fileName} at '{directoryPath}'"); + var matchingFile = files.FirstOrDefault(file => string.Equals(FileSystemHelper.Path.GetFileName(file), fileName, StringComparison.OrdinalIgnoreCase)); + if (matchingFile == null) continue; + this.log.Info($"Found configuration file at '{matchingFile}'"); + return matchingFile; + } + + return null; + } + + private string? GetCustomConfigurationFilePathIfEligable(string? directoryPath) + { + if (string.IsNullOrWhiteSpace(this.ConfigurationFile)) return null; + var configurationFilePath = this.ConfigurationFile; + if (!string.IsNullOrWhiteSpace(directoryPath)) + { + configurationFilePath = FileSystemHelper.Path.Combine(directoryPath, this.ConfigurationFile); + } + + return this.fileSystem.File.Exists(configurationFilePath) ? configurationFilePath : null; + } + + private void WarnAboutAmbiguousConfigFileSelection(string? workingDirectory, string? projectRootDirectory) + { + var workingConfigFile = GetConfigurationFile(workingDirectory); + var projectRootConfigFile = GetConfigurationFile(projectRootDirectory); + + var hasConfigInWorkingDirectory = workingConfigFile is not null; + var hasConfigInProjectRootDirectory = projectRootConfigFile is not null; + + if (hasConfigInProjectRootDirectory && hasConfigInWorkingDirectory) + { + throw new WarningException($"Ambiguous configuration file selection from '{workingConfigFile}' and '{projectRootConfigFile}'"); + } + + if (hasConfigInProjectRootDirectory || hasConfigInWorkingDirectory || this.SupportedConfigFileNames.Any(entry => entry.Equals(this.ConfigurationFile, StringComparison.OrdinalIgnoreCase))) return; + + workingConfigFile = FileSystemHelper.Path.Combine(workingDirectory, this.ConfigurationFile); + projectRootConfigFile = FileSystemHelper.Path.Combine(projectRootDirectory, this.ConfigurationFile); + throw new WarningException($"The configuration file was not found at '{workingConfigFile}' or '{projectRootConfigFile}'"); + } +} diff --git a/src/GitVersion.Configuration/ConfigurationHelper.cs b/src/GitVersion.Configuration/ConfigurationHelper.cs new file mode 100644 index 0000000000..0410558782 --- /dev/null +++ b/src/GitVersion.Configuration/ConfigurationHelper.cs @@ -0,0 +1,98 @@ +using GitVersion.Extensions; + +namespace GitVersion.Configuration; + +internal class ConfigurationHelper +{ + private static ConfigurationSerializer Serializer => new(); + private string Yaml => this.yaml ??= this.dictionary == null + ? Serializer.Serialize(this.configuration!) + : Serializer.Serialize(this.dictionary); + private string? yaml; + + internal IReadOnlyDictionary Dictionary + { + get + { + if (this.dictionary != null) return this.dictionary; + this.yaml ??= Serializer.Serialize(this.configuration!); + this.dictionary = Serializer.Deserialize>(this.yaml); + return this.dictionary; + } + } + private IReadOnlyDictionary? dictionary; + + public IGitVersionConfiguration Configuration => this.configuration ??= Serializer.Deserialize(Yaml); + private IGitVersionConfiguration? configuration; + + internal ConfigurationHelper(string yaml) => this.yaml = yaml.NotNull(); + + internal ConfigurationHelper(IReadOnlyDictionary dictionary) => this.dictionary = dictionary.NotNull(); + + public ConfigurationHelper(IGitVersionConfiguration configuration) => this.configuration = configuration.NotNull(); + + public void Override(IReadOnlyDictionary value) + { + value.NotNull(); + + if (!value.Any()) return; + var map = Dictionary.ToDictionary(element => element.Key, element => element.Value); + Merge(map, value); + this.dictionary = map; + this.yaml = null; + this.configuration = null; + } + + private static void Merge(IDictionary dictionary, IReadOnlyDictionary anotherDictionary) + { + foreach (var item in dictionary) + { + switch (item.Value) + { + case IDictionary anotherDictionaryValue: + { + if (anotherDictionary.TryGetValue(item.Key, out var value) && value is IReadOnlyDictionary dictionaryValue) + { + Merge(anotherDictionaryValue, dictionaryValue); + } + + break; + } + case null or string or IList: + { + if (anotherDictionary.TryGetValue(item.Key, out var value)) + { + dictionary[item.Key] = value; + } + + break; + } + } + } + + foreach (var item in anotherDictionary) + { + switch (item.Value) + { + case IReadOnlyDictionary when dictionary.ContainsKey(item.Key): + continue; + case IReadOnlyDictionary dictionaryValue: + { + Dictionary anotherDictionaryValue = []; + Merge(anotherDictionaryValue, dictionaryValue); + dictionary.Add(item.Key, anotherDictionaryValue); + break; + } + case null or string or IList: + { + if (!dictionary.ContainsKey(item.Key)) + { + dictionary.Add(item.Key, item.Value); + } + + break; + } + } + } + } +} diff --git a/src/GitVersion.Configuration/ConfigurationProvider.cs b/src/GitVersion.Configuration/ConfigurationProvider.cs new file mode 100644 index 0000000000..644e1656cc --- /dev/null +++ b/src/GitVersion.Configuration/ConfigurationProvider.cs @@ -0,0 +1,108 @@ +using System.IO.Abstractions; +using GitVersion.Configuration.Workflows; +using GitVersion.Extensions; +using GitVersion.Logging; +using Microsoft.Extensions.Options; +using YamlDotNet.Core; + +namespace GitVersion.Configuration; + +internal class ConfigurationProvider( + IConfigurationFileLocator configFileLocator, + IFileSystem fileSystem, + ILog log, + IConfigurationSerializer configurationSerializer, + IOptions options) + : IConfigurationProvider +{ + private readonly IConfigurationFileLocator configFileLocator = configFileLocator.NotNull(); + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ILog log = log.NotNull(); + private readonly IConfigurationSerializer configurationSerializer = configurationSerializer.NotNull(); + private readonly IOptions options = options.NotNull(); + + public IGitVersionConfiguration Provide(IReadOnlyDictionary? overrideConfiguration) + { + var gitVersionOptions = this.options.Value; + var workingDirectory = gitVersionOptions.WorkingDirectory; + var projectRootDirectory = this.fileSystem.FindGitDir(workingDirectory)?.WorkingTreeDirectory; + + var configurationFile = this.configFileLocator.GetConfigurationFile(workingDirectory) + ?? this.configFileLocator.GetConfigurationFile(projectRootDirectory); + + return configurationFile is not null + ? ProvideConfiguration(configurationFile, overrideConfiguration) + : ProvideForDirectory(null, overrideConfiguration); + } + + internal IGitVersionConfiguration ProvideForDirectory(string? workingDirectory, + IReadOnlyDictionary? overrideConfiguration = null) + { + var configFilePath = this.configFileLocator.GetConfigurationFile(workingDirectory); + return ProvideConfiguration(configFilePath, overrideConfiguration); + } + + private IGitVersionConfiguration ProvideConfiguration(string? configFile, + IReadOnlyDictionary? overrideConfiguration = null) + { + var overrideConfigurationFromFile = ReadOverrideConfiguration(configFile); + + var workflow = GetWorkflow(overrideConfiguration, overrideConfigurationFromFile); + + IConfigurationBuilder configurationBuilder = (workflow is null) + ? GitFlowConfigurationBuilder.New + : ConfigurationBuilder.New; + + var overrideConfigurationFromWorkflow = WorkflowManager.GetOverrideConfiguration(workflow); + foreach (var item in new[] { overrideConfigurationFromWorkflow, overrideConfigurationFromFile, overrideConfiguration }) + { + if (item is not null) configurationBuilder.AddOverride(item); + } + + try + { + return configurationBuilder.Build(); + } + catch (YamlException exception) + { + var baseException = exception.GetBaseException(); + throw new WarningException( + $"Could not build the configuration instance because following exception occurred: '{baseException.Message}' " + + "Please ensure that the /overrideconfig parameters are correct and the configuration file is in the correct format." + ); + } + } + + private Dictionary? ReadOverrideConfiguration(string? configFilePath) + { + if (configFilePath == null) + { + this.log.Info("No configuration file found, using default configuration"); + return null; + } + + if (!this.fileSystem.File.Exists(configFilePath)) + { + this.log.Info($"Configuration file '{configFilePath}' not found"); + return null; + } + + this.log.Info($"Using configuration file '{configFilePath}'"); + var content = fileSystem.File.ReadAllText(configFilePath); + return configurationSerializer.Deserialize>(content); + } + + private static string? GetWorkflow(IReadOnlyDictionary? overrideConfiguration, IReadOnlyDictionary? overrideConfigurationFromFile) + { + string? workflow = null; + foreach (var item in new[] { overrideConfigurationFromFile, overrideConfiguration }) + { + if (item?.TryGetValue("workflow", out var value) == true && value != null) + { + workflow = (string)value; + } + } + + return workflow; + } +} diff --git a/src/GitVersion.Configuration/ConfigurationSerializer.cs b/src/GitVersion.Configuration/ConfigurationSerializer.cs new file mode 100644 index 0000000000..5517252772 --- /dev/null +++ b/src/GitVersion.Configuration/ConfigurationSerializer.cs @@ -0,0 +1,46 @@ +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; +using YamlDotNet.Serialization.TypeInspectors; + +namespace GitVersion.Configuration; + +internal class ConfigurationSerializer : IConfigurationSerializer +{ + private static IDeserializer Deserializer => new DeserializerBuilder() + .WithNamingConvention(HyphenatedNamingConvention.Instance) + .WithTypeConverter(VersionStrategiesConverter.Instance) + .WithTypeInspector(inspector => new JsonPropertyNameInspector(inspector)) + .Build(); + + private static ISerializer Serializer => new SerializerBuilder() + .ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitNull) + .WithTypeInspector(inspector => new JsonPropertyNameInspector(inspector)) + .WithNamingConvention(HyphenatedNamingConvention.Instance).Build(); + + public T Deserialize(string input) => Deserializer.Deserialize(input); + public string Serialize(object graph) => Serializer.Serialize(graph); + public IGitVersionConfiguration? ReadConfiguration(string input) => Deserialize(input); + + private sealed class JsonPropertyNameInspector(ITypeInspector innerTypeDescriptor) : TypeInspectorSkeleton + { + public override string GetEnumName(Type enumType, string name) => innerTypeDescriptor.GetEnumName(enumType, name); + + public override string GetEnumValue(object enumValue) => innerTypeDescriptor.GetEnumValue(enumValue); + + public override IEnumerable GetProperties(Type type, object? container) => + innerTypeDescriptor.GetProperties(type, container) + .Where(p => p.GetCustomAttribute() == null) + .Select(IPropertyDescriptor (p) => + { + var descriptor = new PropertyDescriptor(p); + var member = p.GetCustomAttribute(); + if (member is not null) + { + descriptor.Name = member.Name; + } + + return descriptor; + }) + .OrderBy(p => p.Order); + } +} diff --git a/src/GitVersion.Configuration/GitVersion.Configuration.csproj b/src/GitVersion.Configuration/GitVersion.Configuration.csproj new file mode 100644 index 0000000000..f4a84de083 --- /dev/null +++ b/src/GitVersion.Configuration/GitVersion.Configuration.csproj @@ -0,0 +1,35 @@ + + + + GITVERSION_CONFIGURATION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/GitVersion.Configuration/GitVersionConfiguration.cs b/src/GitVersion.Configuration/GitVersionConfiguration.cs new file mode 100644 index 0000000000..6e3a49bf9c --- /dev/null +++ b/src/GitVersion.Configuration/GitVersionConfiguration.cs @@ -0,0 +1,146 @@ +using System.Globalization; +using GitVersion.Configuration.Attributes; +using GitVersion.Core; +using GitVersion.VersionCalculation; +using static GitVersion.Configuration.ConfigurationConstants; + +namespace GitVersion.Configuration; + +internal sealed record GitVersionConfiguration : BranchConfiguration, IGitVersionConfiguration +{ + [JsonPropertyName("workflow")] + [JsonPropertyDescription("The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'")] + public string? Workflow { get; internal init; } + + [JsonPropertyName("assembly-versioning-scheme")] + [JsonPropertyDescription($"The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to '{NameOfDefaultAssemblyVersioningScheme}'.")] + [JsonPropertyDefault(DefaultAssemblyVersioningScheme)] + public AssemblyVersioningScheme? AssemblyVersioningScheme { get; internal init; } + + [JsonPropertyName("assembly-file-versioning-scheme")] + [JsonPropertyDescription($"The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to '{NameOfDefaultAssemblyFileVersioningScheme}'.")] + [JsonPropertyDefault(DefaultAssemblyFileVersioningScheme)] + public AssemblyFileVersioningScheme? AssemblyFileVersioningScheme { get; internal init; } + + [JsonPropertyName("assembly-informational-format")] + [JsonPropertyDescription($"Specifies the format of AssemblyInformationalVersion. Defaults to '{DefaultAssemblyInformationalFormat}'.")] + [JsonPropertyDefault($"'{DefaultAssemblyInformationalFormat}'")] + public string? AssemblyInformationalFormat { get; internal init; } + + [JsonPropertyName("assembly-versioning-format")] + [JsonPropertyDescription("Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.")] + public string? AssemblyVersioningFormat { get; internal init; } + + [JsonPropertyName("assembly-file-versioning-format")] + [JsonPropertyDescription("Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.")] + public string? AssemblyFileVersioningFormat { get; internal init; } + + [JsonPropertyName("tag-prefix")] + [JsonPropertyDescription($"A regular expression which is used to trim Git tags before processing. Defaults to '{RegexPatterns.Configuration.DefaultTagPrefixRegexPattern}'")] + [JsonPropertyDefault(RegexPatterns.Configuration.DefaultTagPrefixRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? TagPrefixPattern { get; internal init; } + + [JsonPropertyName("version-in-branch-pattern")] + [JsonPropertyDescription($"A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '{RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern}'.")] + [JsonPropertyDefault(RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? VersionInBranchPattern { get; internal init; } + + [JsonPropertyName("next-version")] + [JsonPropertyDescription("Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes")] + public string? NextVersion + { + get => nextVersion; + internal init => + nextVersion = int.TryParse(value, NumberStyles.Any, NumberFormatInfo.InvariantInfo, out var major) + ? $"{major}.0" + : value; + } + private string? nextVersion; + + [JsonPropertyName("major-version-bump-message")] + [JsonPropertyDescription($"The regular expression to match commit messages with to perform a major version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultMajorRegexPattern}'")] + [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultMajorRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? MajorVersionBumpMessage { get; internal init; } + + [JsonPropertyName("minor-version-bump-message")] + [JsonPropertyDescription($"The regular expression to match commit messages with to perform a minor version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultMinorRegexPattern}'")] + [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultMinorRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? MinorVersionBumpMessage { get; internal init; } + + [JsonPropertyName("patch-version-bump-message")] + [JsonPropertyDescription($"The regular expression to match commit messages with to perform a patch version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultPatchRegexPattern}'")] + [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultPatchRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? PatchVersionBumpMessage { get; internal init; } + + [JsonPropertyName("no-bump-message")] + [JsonPropertyDescription($"Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '{RegexPatterns.VersionCalculation.DefaultNoBumpRegexPattern}'")] + [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultNoBumpRegexPattern)] + [JsonPropertyFormat(Format.Regex)] + public string? NoBumpMessage { get; internal init; } + + [JsonPropertyName("tag-pre-release-weight")] + [JsonPropertyDescription($"The pre-release weight in case of tagged commits. Defaults to {StringDefaultTagPreReleaseWeight}.")] + public int? TagPreReleaseWeight { get; internal init; } + + [JsonPropertyName("commit-date-format")] + [JsonPropertyDescription($"The format to use when calculating the commit date. Defaults to '{DefaultCommitDateFormat}'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).")] + [JsonPropertyDefault(DefaultCommitDateFormat)] + [System.Diagnostics.CodeAnalysis.StringSyntax("DateTimeFormat")] + public string? CommitDateFormat { get; internal init; } + + [JsonPropertyName("merge-message-formats")] + [JsonPropertyDescription("Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.")] + public Dictionary MergeMessageFormats { get; internal init; } = []; + + [JsonIgnore] + IReadOnlyDictionary IGitVersionConfiguration.MergeMessageFormats => MergeMessageFormats; + + [JsonPropertyName("update-build-number")] + [JsonPropertyDescription($"Whether to update the build number in the project file. Defaults to {StringDefaultUpdateBuildNumber}.")] + [JsonPropertyDefault(DefaultUpdateBuildNumber)] + public bool UpdateBuildNumber { get; internal init; } = DefaultUpdateBuildNumber; + + [JsonPropertyName("semantic-version-format")] + [JsonPropertyDescription($"Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to '{StringDefaultSemanticVersionFormat}'.")] + [JsonPropertyDefault(DefaultSemanticVersionFormat)] + public SemanticVersionFormat SemanticVersionFormat { get; internal init; } + + [JsonIgnore] + VersionStrategies IGitVersionConfiguration.VersionStrategy => VersionStrategies.Length == 0 + ? VersionCalculation.VersionStrategies.None : VersionStrategies.Aggregate((one, another) => one | another); + + [JsonPropertyName("strategies")] + [JsonPropertyDescription($"Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: '{nameof(VersionCalculation.VersionStrategies.ConfiguredNextVersion)}', '{nameof(VersionCalculation.VersionStrategies.MergeMessage)}', '{nameof(VersionCalculation.VersionStrategies.TaggedCommit)}', '{nameof(VersionCalculation.VersionStrategies.TrackReleaseBranches)}', '{nameof(VersionCalculation.VersionStrategies.VersionInBranchName)}' and '{nameof(VersionCalculation.VersionStrategies.Mainline)}'.")] + public VersionStrategies[] VersionStrategies { get; internal init; } = []; + + [JsonIgnore] + IReadOnlyDictionary IGitVersionConfiguration.Branches + => Branches.ToDictionary(element => element.Key, IBranchConfiguration (element) => element.Value); + + [JsonPropertyName("branches")] + [JsonPropertyDescription("The header for all the individual branch configuration.")] + public Dictionary Branches { get; internal init; } = []; + + [JsonIgnore] + IIgnoreConfiguration IGitVersionConfiguration.Ignore => Ignore; + + [JsonPropertyName("ignore")] + [JsonPropertyDescription("The header property for the ignore configuration.")] + public IgnoreConfiguration Ignore { get; internal init; } = new(); + + public override IBranchConfiguration Inherit(IBranchConfiguration configuration) => throw new NotSupportedException(); + + public override IBranchConfiguration Inherit(EffectiveConfiguration configuration) => throw new NotSupportedException(); + + public IBranchConfiguration GetEmptyBranchConfiguration() => new BranchConfiguration + { + RegularExpression = string.Empty, + Label = BranchNamePlaceholder, + Increment = IncrementStrategy.Inherit + }; +} diff --git a/src/GitVersion.Configuration/GitVersionConfigurationModule.cs b/src/GitVersion.Configuration/GitVersionConfigurationModule.cs new file mode 100644 index 0000000000..684b0a8b78 --- /dev/null +++ b/src/GitVersion.Configuration/GitVersionConfigurationModule.cs @@ -0,0 +1,15 @@ +using GitVersion.VersionCalculation.Caching; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Configuration; + +public class GitVersionConfigurationModule : IGitVersionModule +{ + public void RegisterTypes(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } +} diff --git a/src/GitVersion.Configuration/IgnoreConfiguration.cs b/src/GitVersion.Configuration/IgnoreConfiguration.cs new file mode 100644 index 0000000000..4ea9d6d86e --- /dev/null +++ b/src/GitVersion.Configuration/IgnoreConfiguration.cs @@ -0,0 +1,35 @@ +using System.Collections.ObjectModel; +using GitVersion.Configuration.Attributes; + +namespace GitVersion.Configuration; + +internal record IgnoreConfiguration : IIgnoreConfiguration +{ + [JsonIgnore] + public DateTimeOffset? Before { get; init; } + + [JsonPropertyName("commits-before")] + [JsonPropertyDescription("Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.")] + [JsonPropertyFormat(Format.DateTime)] + public string? BeforeString + { + get => Before?.ToString("yyyy-MM-ddTHH:mm:ssZ"); + init => Before = value is null ? null : DateTimeOffset.Parse(value); + } + + [JsonIgnore] + IReadOnlySet IIgnoreConfiguration.Shas => Shas; + + [JsonPropertyName("sha")] + [JsonPropertyDescription("A sequence of SHAs to be excluded from the version calculations.")] + public HashSet Shas { get; init; } = []; + + IReadOnlyCollection IIgnoreConfiguration.Paths => Paths; + + [JsonPropertyName("paths")] + [JsonPropertyDescription("A sequence of file paths to be excluded from the version calculations.")] + public Collection Paths { get; init; } = []; + + [JsonIgnore] + public bool IsEmpty => Before == null && Shas.Count == 0 && Paths.Count == 0; +} diff --git a/src/GitVersion.Configuration/PreventIncrementConfiguration.cs b/src/GitVersion.Configuration/PreventIncrementConfiguration.cs new file mode 100644 index 0000000000..757647293b --- /dev/null +++ b/src/GitVersion.Configuration/PreventIncrementConfiguration.cs @@ -0,0 +1,18 @@ +using GitVersion.Configuration.Attributes; + +namespace GitVersion.Configuration; + +internal class PreventIncrementConfiguration : IPreventIncrementConfiguration +{ + [JsonPropertyName("of-merged-branch")] + [JsonPropertyDescription("Prevent increment when branch merged.")] + public bool? OfMergedBranch { get; internal init; } + + [JsonPropertyName("when-branch-merged")] + [JsonPropertyDescription("Prevent increment when branch merged.")] + public bool? WhenBranchMerged { get; internal init; } + + [JsonPropertyName("when-current-commit-tagged")] + [JsonPropertyDescription("This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.")] + public bool? WhenCurrentCommitTagged { get; internal init; } +} diff --git a/src/GitVersion.Configuration/PublicAPI.Shipped.txt b/src/GitVersion.Configuration/PublicAPI.Shipped.txt new file mode 100644 index 0000000000..66f6115d77 --- /dev/null +++ b/src/GitVersion.Configuration/PublicAPI.Shipped.txt @@ -0,0 +1,43 @@ +#nullable enable +GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Date = 0 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.DateTime = 1 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Duration = 2 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Email = 3 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Hostname = 4 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.IdnEmail = 5 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.IdnHostname = 6 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Ipv4 = 7 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Ipv6 = 8 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Iri = 9 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.IriReference = 10 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.JsonPointer = 11 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Regex = 12 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.RelativeJsonPointer = 13 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Time = 14 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Uri = 15 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.UriReference = 16 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.UriTemplate = 17 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.Format.Uuid = 18 -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(bool value) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(GitVersion.Configuration.AssemblyFileVersioningScheme value) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(GitVersion.Configuration.AssemblyVersioningScheme value) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(GitVersion.SemanticVersionFormat value) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(object? boxedValue) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.JsonPropertyDefaultAttribute(string? value) -> void +GitVersion.Configuration.Attributes.JsonPropertyDefaultAttribute.Value.get -> string! +GitVersion.Configuration.Attributes.JsonPropertyDescriptionAttribute +GitVersion.Configuration.Attributes.JsonPropertyDescriptionAttribute.Description.get -> string! +GitVersion.Configuration.Attributes.JsonPropertyDescriptionAttribute.JsonPropertyDescriptionAttribute(string! description) -> void +GitVersion.Configuration.Attributes.JsonPropertyFormatAttribute +GitVersion.Configuration.Attributes.JsonPropertyFormatAttribute.Format.get -> GitVersion.Configuration.Attributes.Format +GitVersion.Configuration.Attributes.JsonPropertyFormatAttribute.JsonPropertyFormatAttribute(GitVersion.Configuration.Attributes.Format format) -> void +GitVersion.Configuration.ConfigurationException +GitVersion.Configuration.ConfigurationException.ConfigurationException() -> void +GitVersion.Configuration.ConfigurationException.ConfigurationException(string! message, System.Exception! innerException) -> void +GitVersion.Configuration.ConfigurationException.ConfigurationException(string! messageFormat, params object![]! args) -> void +GitVersion.Configuration.ConfigurationException.ConfigurationException(string! msg) -> void +GitVersion.Configuration.GitVersionConfigurationModule +GitVersion.Configuration.GitVersionConfigurationModule.GitVersionConfigurationModule() -> void +GitVersion.Configuration.GitVersionConfigurationModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void diff --git a/src/GitVersion.Configuration/PublicAPI.Unshipped.txt b/src/GitVersion.Configuration/PublicAPI.Unshipped.txt new file mode 100644 index 0000000000..7dc5c58110 --- /dev/null +++ b/src/GitVersion.Configuration/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.Configuration/VersionStrategiesConverter.cs b/src/GitVersion.Configuration/VersionStrategiesConverter.cs new file mode 100644 index 0000000000..9f82f82c70 --- /dev/null +++ b/src/GitVersion.Configuration/VersionStrategiesConverter.cs @@ -0,0 +1,54 @@ +using GitVersion.VersionCalculation; +using YamlDotNet.Core; +using YamlDotNet.Core.Events; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; + +namespace GitVersion.Configuration; + +internal class VersionStrategiesConverter : IYamlTypeConverter +{ + public static readonly IYamlTypeConverter Instance = new VersionStrategiesConverter(); + + public bool Accepts(Type type) => type == typeof(VersionStrategies[]); + + public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer) + { + List strategies = []; + + if (parser.TryConsume(out _)) + { + while (!parser.TryConsume(out _)) + { + var data = parser.Consume().Value; + + var strategy = Enum.Parse(data); + strategies.Add(strategy); + } + } + else + { + var data = parser.Consume().Value; + + var deserializer = new DeserializerBuilder() + .WithNamingConvention(UnderscoredNamingConvention.Instance) + .Build(); + + strategies = deserializer.Deserialize>(data); + } + + return strategies.ToArray(); + } + + public void WriteYaml(IEmitter emitter, object? value, Type type, ObjectSerializer serializer) + { + var strategies = (VersionStrategies[])value!; + + var s = new SerializerBuilder() + .JsonCompatible() + .Build(); + var data = s.Serialize(strategies); + + emitter.Emit(new Scalar(data)); + } +} diff --git a/src/GitVersion.Configuration/Workflows/WorkflowManager.cs b/src/GitVersion.Configuration/Workflows/WorkflowManager.cs new file mode 100644 index 0000000000..a9f42ff5d5 --- /dev/null +++ b/src/GitVersion.Configuration/Workflows/WorkflowManager.cs @@ -0,0 +1,28 @@ +using GitVersion.Extensions; + +namespace GitVersion.Configuration.Workflows; + +internal static class WorkflowManager +{ + private static readonly string ResourceNameTemplate = DetermineResourceNameTemplate(); + private static ConfigurationSerializer Serializer => new(); + + private static string DetermineResourceNameTemplate() + { + var fullClassName = typeof(WorkflowManager).FullName!; + var resourceNamePrefix = fullClassName[..(fullClassName.Length - nameof(WorkflowManager).Length - 1)]; + return $"{resourceNamePrefix}.{{0}}.yml"; + } + + public static IReadOnlyDictionary? GetOverrideConfiguration(string? workflow) + { + if (string.IsNullOrEmpty(workflow)) return null; + + var resourceName = GetResourceName(workflow); + var embeddedResource = resourceName.ReadAsStringFromEmbeddedResource(typeof(WorkflowManager).Assembly); + return Serializer.Deserialize>(embeddedResource); + } + + private static string GetResourceName(string workflow) + => ResourceNameTemplate.Replace("{0}", workflow.Replace('/', '.')); +} diff --git a/src/GitVersion.Core.Tests/BuildAgents/ContinuaCiTests.cs b/src/GitVersion.Core.Tests/BuildAgents/ContinuaCiTests.cs deleted file mode 100644 index 5b9f177eb2..0000000000 --- a/src/GitVersion.Core.Tests/BuildAgents/ContinuaCiTests.cs +++ /dev/null @@ -1,24 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Core.Tests.Helpers; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; - -namespace GitVersion.Core.Tests.BuildAgents; - -[TestFixture] -public class ContinuaCiTests : TestBase -{ - private IServiceProvider sp; - - [SetUp] - public void SetUp() => this.sp = ConfigureServices(services => services.AddSingleton()); - - [Test] - public void GenerateBuildVersion() - { - var buildServer = this.sp.GetRequiredService(); - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); - var continuaCiVersion = buildServer.GenerateSetVersionMessage(vars); - Assert.AreEqual("@@continua[setBuildVersion value='0.0.0-Beta4.7']", continuaCiVersion); - } -} diff --git a/src/GitVersion.Core.Tests/BuildAgents/GitLabCiTests.cs b/src/GitVersion.Core.Tests/BuildAgents/GitLabCiTests.cs deleted file mode 100644 index 18f9809406..0000000000 --- a/src/GitVersion.Core.Tests/BuildAgents/GitLabCiTests.cs +++ /dev/null @@ -1,89 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Helpers; -using GitVersion.VersionCalculation; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.BuildAgents; - -[TestFixture] -public class GitLabCiTests : TestBase -{ - private GitLabCi buildServer; - private IServiceProvider sp; - - [SetUp] - public void SetUp() - { - this.sp = ConfigureServices(services => services.AddSingleton()); - this.buildServer = this.sp.GetRequiredService(); - } - - [Test] - public void GenerateSetVersionMessageReturnsVersionAsIsAlthoughThisIsNotUsedByJenkins() - { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); - this.buildServer.GenerateSetVersionMessage(vars).ShouldBe("0.0.0-Beta4.7"); - } - - [Test] - public void GenerateMessageTest() - { - var generatedParameterMessages = this.buildServer.GenerateSetParameterMessage("name", "value"); - generatedParameterMessages.Length.ShouldBe(1); - generatedParameterMessages[0].ShouldBe("GitVersion_name=value"); - } - - [Test] - public void WriteAllVariablesToTheTextWriter() - { - var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - assemblyLocation.ShouldNotBeNull(); - var f = PathHelper.Combine(assemblyLocation, "jenkins_this_file_should_be_deleted.properties"); - - try - { - AssertVariablesAreWrittenToFile(f); - } - finally - { - File.Delete(f); - } - } - - private void AssertVariablesAreWrittenToFile(string file) - { - var writes = new List(); - var semanticVersion = new SemanticVersion - { - Major = 1, - Minor = 2, - Patch = 3, - PreReleaseTag = "beta1", - BuildMetaData = "5" - }; - - semanticVersion.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - semanticVersion.BuildMetaData.Sha = "commitSha"; - - var config = new TestEffectiveConfiguration(); - var variableProvider = this.sp.GetRequiredService(); - - var variables = variableProvider.GetVariablesFor(semanticVersion, config, false); - - this.buildServer.WithPropertyFile(file); - - this.buildServer.WriteIntegration(writes.Add, variables); - - writes[1].ShouldBe("1.2.3-beta.1+5"); - - File.Exists(file).ShouldBe(true); - - var props = File.ReadAllText(file); - - props.ShouldContain("GitVersion_Major=1"); - props.ShouldContain("GitVersion_Minor=2"); - } -} diff --git a/src/GitVersion.Core.Tests/BuildAgents/MyGetTests.cs b/src/GitVersion.Core.Tests/BuildAgents/MyGetTests.cs deleted file mode 100644 index 7c0fd58948..0000000000 --- a/src/GitVersion.Core.Tests/BuildAgents/MyGetTests.cs +++ /dev/null @@ -1,41 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Core.Tests.Helpers; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; - -namespace GitVersion.Core.Tests.BuildAgents; - -[TestFixture] -public class MyGetTests : TestBase -{ - private MyGet buildServer; - - [SetUp] - public void SetUp() - { - var sp = ConfigureServices(services => services.AddSingleton()); - this.buildServer = sp.GetRequiredService(); - } - - [Test] - public void DevelopBranch() - { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); - var message = this.buildServer.GenerateSetVersionMessage(vars); - Assert.AreEqual(null, message); - } - - [Test] - public void EscapeValues() - { - var message = this.buildServer.GenerateSetParameterMessage("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); - Assert.AreEqual("##myget[setParameter name='GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']", message[0]); - } - - [Test] - public void BuildNumber() - { - var message = this.buildServer.GenerateSetParameterMessage("LegacySemVerPadded", "0.8.0-unstable568"); - Assert.AreEqual("##myget[buildNumber '0.8.0-unstable568']", message[1]); - } -} diff --git a/src/GitVersion.Core.Tests/BuildAgents/TeamCityTests.cs b/src/GitVersion.Core.Tests/BuildAgents/TeamCityTests.cs deleted file mode 100644 index 92151edc47..0000000000 --- a/src/GitVersion.Core.Tests/BuildAgents/TeamCityTests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Core.Tests.Helpers; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; - -namespace GitVersion.Core.Tests.BuildAgents; - -[TestFixture] -public class TeamCityTests : TestBase -{ - private TeamCity buildServer; - - [SetUp] - public void SetUp() - { - var sp = ConfigureServices(services => services.AddSingleton()); - this.buildServer = sp.GetRequiredService(); - } - - [Test] - public void DevelopBranch() - { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); - var tcVersion = this.buildServer.GenerateSetVersionMessage(vars); - Assert.AreEqual("##teamcity[buildNumber '0.0.0-Unstable4']", tcVersion); - } - - [Test] - public void EscapeValues() - { - var tcVersion = this.buildServer.GenerateSetParameterMessage("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'"); - Assert.AreEqual("##teamcity[setParameter name='GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']", tcVersion[0]); - Assert.AreEqual("##teamcity[setParameter name='system.GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']", tcVersion[1]); - } -} diff --git a/src/GitVersion.Core.Tests/Model/CommitDateTests.cs b/src/GitVersion.Core.Tests/CommitDateTests.cs similarity index 86% rename from src/GitVersion.Core.Tests/Model/CommitDateTests.cs rename to src/GitVersion.Core.Tests/CommitDateTests.cs index 34b89a9d4d..2b0d94ebd6 100644 --- a/src/GitVersion.Core.Tests/Model/CommitDateTests.cs +++ b/src/GitVersion.Core.Tests/CommitDateTests.cs @@ -1,5 +1,5 @@ +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; namespace GitVersion.Core.Tests; @@ -26,8 +26,8 @@ public void CommitDateFormatTest(string format, string expectedOutcome) { BuildMetaData = semanticVersionBuildMetaData // assume time zone is UTC }; - var configuration = new TestEffectiveConfiguration(commitDateFormat: format); - var formatValues = new SemanticVersionFormatValues(semanticVersion, configuration); + var configuration = EmptyConfigurationBuilder.New.WithCommitDateFormat(format).Build(); + var formatValues = new SemanticVersionFormatValues(semanticVersion, configuration, 0); Assert.That(formatValues.CommitDate, Is.EqualTo(expectedOutcome)); } diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigExtensionsTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigExtensionsTests.cs deleted file mode 100644 index afb2f94eec..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/ConfigExtensionsTests.cs +++ /dev/null @@ -1,30 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.Configuration; - -[TestFixture] -public class ConfigExtensionsTests : TestBase -{ - [Test] - public void GetReleaseBranchConfigReturnsAllReleaseBranches() - { - var config = new Config() - { - Branches = new Dictionary - { - { "foo", new BranchConfig { Name = "foo" } }, - { "bar", new BranchConfig { Name = "bar", IsReleaseBranch = true } }, - { "baz", new BranchConfig { Name = "baz", IsReleaseBranch = true } } - } - }; - - var result = config.GetReleaseBranchConfig(); - - result.Count.ShouldBe(2); - result.ShouldNotContain(b => b.Key == "foo"); - } -} diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt deleted file mode 100644 index c3749b2a40..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ /dev/null @@ -1,119 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -assembly-file-versioning-scheme: MajorMinorPatch -mode: ContinuousDelivery -tag-prefix: '[vV]' -continuous-delivery-fallback-tag: ci -major-version-bump-message: '\+semver:\s?(breaking|major)' -minor-version-bump-message: '\+semver:\s?(feature|minor)' -patch-version-bump-message: '\+semver:\s?(fix|patch)' -no-bump-message: '\+semver:\s?(none|skip)' -legacy-semver-padding: 4 -build-metadata-padding: 4 -commits-since-version-source-padding: 4 -tag-pre-release-weight: 60000 -commit-message-incrementing: Enabled -branches: - develop: - mode: ContinuousDeployment - tag: alpha - increment: Minor - prevent-increment-of-merged-branch-version: false - track-merge-target: true - regex: ^dev(elop)?(ment)?$ - source-branches: [] - tracks-release-branches: true - is-release-branch: false - is-mainline: false - pre-release-weight: 0 - main: - mode: ContinuousDelivery - tag: '' - increment: Patch - prevent-increment-of-merged-branch-version: true - track-merge-target: false - regex: ^master$|^main$ - source-branches: - - develop - - release - tracks-release-branches: false - is-release-branch: false - is-mainline: true - pre-release-weight: 55000 - release: - mode: ContinuousDelivery - tag: beta - increment: None - prevent-increment-of-merged-branch-version: true - track-merge-target: false - regex: ^releases?[/-] - source-branches: - - develop - - main - - support - - release - tracks-release-branches: false - is-release-branch: true - is-mainline: false - pre-release-weight: 30000 - feature: - mode: ContinuousDelivery - tag: '{BranchName}' - increment: Inherit - regex: ^features?[/-] - source-branches: - - develop - - main - - release - - feature - - support - - hotfix - pre-release-weight: 30000 - pull-request: - mode: ContinuousDelivery - tag: PullRequest - increment: Inherit - tag-number-pattern: '[/-](?\d+)' - regex: ^(pull|pull\-requests|pr)[/-] - source-branches: - - develop - - main - - release - - feature - - support - - hotfix - pre-release-weight: 30000 - hotfix: - mode: ContinuousDelivery - tag: beta - increment: Patch - prevent-increment-of-merged-branch-version: false - track-merge-target: false - regex: ^hotfix(es)?[/-] - source-branches: - - release - - main - - support - - hotfix - tracks-release-branches: false - is-release-branch: false - is-mainline: false - pre-release-weight: 30000 - support: - mode: ContinuousDelivery - tag: '' - increment: Patch - prevent-increment-of-merged-branch-version: true - track-merge-target: false - regex: ^support[/-] - source-branches: - - main - tracks-release-branches: false - is-release-branch: false - is-mainline: true - pre-release-weight: 55000 -ignore: - sha: [] -increment: Inherit -commit-date-format: yyyy-MM-dd -merge-message-formats: {} -update-build-number: true diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs deleted file mode 100644 index bb7b4cefd8..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs +++ /dev/null @@ -1,506 +0,0 @@ -using System.Runtime.CompilerServices; -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NUnit.Framework; -using Shouldly; -using YamlDotNet.Serialization; - -namespace GitVersion.Core.Tests; - -[TestFixture] -public class ConfigProviderTests : TestBase -{ - private const string DefaultRepoPath = @"c:\MyGitRepo"; - - private string repoPath; - private IConfigProvider configProvider; - private IFileSystem fileSystem; - - [SetUp] - public void Setup() - { - this.repoPath = DefaultRepoPath; - var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); - var sp = ConfigureServices(services => services.AddSingleton(options)); - this.configProvider = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - } - - [Test] - public void OverwritesDefaultsWithProvidedConfig() - { - var defaultConfig = this.configProvider.Provide(this.repoPath); - const string text = @" -next-version: 2.0.0 -branches: - develop: - mode: ContinuousDeployment - tag: dev"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.NextVersion.ShouldBe("2.0.0"); - config.Branches.ShouldNotBeNull(); - config.Branches["develop"].Increment.ShouldBe(defaultConfig.Branches["develop"].Increment); - config.Branches["develop"].VersioningMode.ShouldBe(defaultConfig.Branches["develop"].VersioningMode); - config.Branches["develop"].Tag.ShouldBe("dev"); - } - - [Test] - public void AllBranchesModeWhenUsingMainline() - { - const string text = "mode: Mainline"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - var branches = config.Branches.Select(x => x.Value); - branches.All(branch => branch.VersioningMode == VersioningMode.Mainline).ShouldBe(true); - } - - [Test] - public void CanRemoveTag() - { - const string text = @" -next-version: 2.0.0 -branches: - release: - tag: """""; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.NextVersion.ShouldBe("2.0.0"); - config.Branches["release"].Tag.ShouldBe(string.Empty); - } - - [Test] - public void RegexIsRequired() - { - const string text = @" -next-version: 2.0.0 -branches: - bug: - tag: bugfix"; - SetupConfigFileContent(text); - var ex = Should.Throw(() => this.configProvider.Provide(this.repoPath)); - ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'regex'{System.Environment.NewLine}" + - "See https://gitversion.net/docs/reference/configuration for more info"); - } - - [Test] - public void SourceBranchIsRequired() - { - const string text = @" -next-version: 2.0.0 -branches: - bug: - regex: 'bug[/-]' - tag: bugfix"; - SetupConfigFileContent(text); - var ex = Should.Throw(() => this.configProvider.Provide(this.repoPath)); - ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'source-branches'{System.Environment.NewLine}" + - "See https://gitversion.net/docs/reference/configuration for more info"); - } - - [Test(Description = "This test proves the configuration validation will fail early with a helpful message when a branch listed in source-branches has no configuration.")] - public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsMissing() - { - const string text = @" -branches: - bug: - regex: 'bug[/-]' - tag: bugfix - source-branches: [notconfigured]"; - SetupConfigFileContent(text); - var ex = Should.Throw(() => this.configProvider.Provide(this.repoPath)); - ex.Message.ShouldBe($"Branch configuration 'bug' defines these 'source-branches' that are not configured: '[notconfigured]'{System.Environment.NewLine}" + - "See https://gitversion.net/docs/reference/configuration for more info"); - } - - [Test(Description = "Well-known branches may not be present in the configuration file. This test confirms the validation check succeeds when the source-branches configuration contain these well-known branches.")] - [TestCase(Config.MainBranchKey)] - [TestCase(Config.DevelopBranchKey)] - public void SourceBranchesValidationShouldSucceedForWellKnownBranches(string wellKnownBranchKey) - { - var text = $@" -branches: - bug: - regex: 'bug[/-]' - tag: bugfix - source-branches: [{wellKnownBranchKey}]"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["bug"].SourceBranches.ShouldBe(new List { wellKnownBranchKey }); - } - - [Test] - public void CanProvideConfigForNewBranch() - { - const string text = @" -next-version: 2.0.0 -branches: - bug: - regex: 'bug[/-]' - tag: bugfix - source-branches: []"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["bug"].Regex.ShouldBe("bug[/-]"); - config.Branches["bug"].Tag.ShouldBe("bugfix"); - } - - [Test] - public void MasterConfigReplacedWithMain() - { - const string text = @" -next-version: 2.0.0 -branches: - master: - regex: '^master$|^main$' - tag: beta"; - SetupConfigFileContent(text); - - var config = this.configProvider.Provide(this.repoPath); - - config.Branches[MainBranch].Regex.ShouldBe("^master$|^main$"); - config.Branches[MainBranch].Tag.ShouldBe("beta"); - } - - [Test] - public void MasterConfigReplacedWithMainInSourceBranches() - { - const string text = @" -next-version: 2.0.0 -branches: - breaking: - regex: breaking[/] - mode: ContinuousDeployment - increment: Major - source-branches: ['master'] - is-release-branch: false"; - SetupConfigFileContent(text); - - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["breaking"].Regex.ShouldBe("breaking[/]"); - config.Branches["breaking"].SourceBranches.ShouldHaveSingleItem(); - config.Branches["breaking"].SourceBranches?.ShouldContain(MainBranch); - } - - [Test] - public void NextVersionCanBeInteger() - { - const string text = "next-version: 2"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.NextVersion.ShouldBe("2.0"); - } - - [Test] - public void NextVersionCanHaveEnormousMinorVersion() - { - const string text = "next-version: 2.118998723"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.NextVersion.ShouldBe("2.118998723"); - } - - [Test] - public void NextVersionCanHavePatch() - { - const string text = "next-version: 2.12.654651698"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.NextVersion.ShouldBe("2.12.654651698"); - } - - [Test] - [MethodImpl(MethodImplOptions.NoInlining)] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CanWriteOutEffectiveConfiguration() - { - var config = this.configProvider.Provide(this.repoPath); - - config.ToString().ShouldMatchApproved(); - } - - [Test] - public void CanUpdateAssemblyInformationalVersioningScheme() - { - const string text = @" -assembly-versioning-scheme: MajorMinor -assembly-file-versioning-scheme: MajorMinorPatch -assembly-informational-format: '{NugetVersion}'"; - - SetupConfigFileContent(text); - - var config = this.configProvider.Provide(this.repoPath); - config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor); - config.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); - config.AssemblyInformationalFormat.ShouldBe("{NugetVersion}"); - } - - [Test] - public void CanUpdateAssemblyInformationalVersioningSchemeWithMultipleVariables() - { - const string text = @" -assembly-versioning-scheme: MajorMinor -assembly-file-versioning-scheme: MajorMinorPatch -assembly-informational-format: '{Major}.{Minor}.{Patch}'"; - - SetupConfigFileContent(text); - - var config = this.configProvider.Provide(this.repoPath); - config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor); - config.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); - config.AssemblyInformationalFormat.ShouldBe("{Major}.{Minor}.{Patch}"); - } - - - [Test] - public void CanUpdateAssemblyInformationalVersioningSchemeWithFullSemVer() - { - const string text = @"assembly-versioning-scheme: MajorMinorPatch -assembly-file-versioning-scheme: MajorMinorPatch -assembly-informational-format: '{FullSemVer}' -mode: ContinuousDelivery -next-version: 5.3.0 -branches: {}"; - - SetupConfigFileContent(text); - - var config = this.configProvider.Provide(this.repoPath); - config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); - config.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); - config.AssemblyInformationalFormat.ShouldBe("{FullSemVer}"); - } - - [Test] - public void CanReadDefaultDocument() - { - const string text = ""; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); - config.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); - config.AssemblyInformationalFormat.ShouldBe(null); - config.Branches["develop"].Tag.ShouldBe("alpha"); - config.Branches["release"].Tag.ShouldBe("beta"); - config.TagPrefix.ShouldBe(Config.DefaultTagPrefix); - config.NextVersion.ShouldBe(null); - } - - [Test] - public void VerifyAliases() - { - var config = typeof(Config); - var propertiesMissingAlias = config.GetProperties() - .Where(p => p.GetCustomAttribute() == null) - .Where(p => p.GetCustomAttribute(typeof(YamlMemberAttribute)) == null) - .Select(p => p.Name); - - propertiesMissingAlias.ShouldBeEmpty(); - } - - [Test] - public void NoWarnOnGitVersionYmlFile() - { - SetupConfigFileContent(string.Empty); - - var stringLogger = string.Empty; - void Action(string info) => stringLogger = info; - - var logAppender = new TestLogAppender(Action); - var log = new Log(logAppender); - - var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); - var sp = ConfigureServices(services => - { - services.AddSingleton(options); - services.AddSingleton(log); - }); - this.configProvider = sp.GetRequiredService(); - - this.configProvider.Provide(this.repoPath); - - stringLogger.Length.ShouldBe(0); - } - - private void SetupConfigFileContent(string text, string fileName = ConfigFileLocator.DefaultFileName) => SetupConfigFileContent(text, fileName, this.repoPath); - - private void SetupConfigFileContent(string text, string fileName, string path) - { - var fullPath = PathHelper.Combine(path, fileName); - this.fileSystem.WriteAllText(fullPath, text); - } - - [Test] - public void ShouldUseSpecifiedSourceBranchesForDevelop() - { - const string text = @" -next-version: 2.0.0 -branches: - develop: - mode: ContinuousDeployment - source-branches: ['develop'] - tag: dev"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["develop"].SourceBranches.ShouldBe(new List { "develop" }); - } - - [Test] - public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForDevelop() - { - const string text = @" -next-version: 2.0.0 -branches: - develop: - mode: ContinuousDeployment - tag: dev"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["develop"].SourceBranches.ShouldBe(new List()); - } - - [Test] - public void ShouldUseSpecifiedSourceBranchesForFeature() - { - const string text = @" -next-version: 2.0.0 -branches: - feature: - mode: ContinuousDeployment - source-branches: ['develop', 'release'] - tag: dev"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["feature"].SourceBranches.ShouldBe(new List { "develop", "release" }); - } - - [Test] - public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForFeature() - { - const string text = @" -next-version: 2.0.0 -branches: - feature: - mode: ContinuousDeployment - tag: dev"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.Branches["feature"].SourceBranches.ShouldBe( - new List { "develop", MainBranch, "release", "feature", "support", "hotfix" }); - } - - [Test] - public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() - { - const string text = @" -next-version: 1.2.3 -tag-prefix: custom-tag-prefix-from-yml"; - SetupConfigFileContent(text); - - var expectedConfig = this.configProvider.Provide(this.repoPath); - var overridenConfig = this.configProvider.Provide(this.repoPath, new Config()); - - overridenConfig.AssemblyVersioningScheme.ShouldBe(expectedConfig.AssemblyVersioningScheme); - overridenConfig.AssemblyFileVersioningScheme.ShouldBe(expectedConfig.AssemblyFileVersioningScheme); - overridenConfig.AssemblyInformationalFormat.ShouldBe(expectedConfig.AssemblyInformationalFormat); - overridenConfig.AssemblyVersioningFormat.ShouldBe(expectedConfig.AssemblyVersioningFormat); - overridenConfig.AssemblyFileVersioningFormat.ShouldBe(expectedConfig.AssemblyFileVersioningFormat); - overridenConfig.VersioningMode.ShouldBe(expectedConfig.VersioningMode); - overridenConfig.TagPrefix.ShouldBe(expectedConfig.TagPrefix); - overridenConfig.ContinuousDeploymentFallbackTag.ShouldBe(expectedConfig.ContinuousDeploymentFallbackTag); - overridenConfig.NextVersion.ShouldBe(expectedConfig.NextVersion); - overridenConfig.MajorVersionBumpMessage.ShouldBe(expectedConfig.MajorVersionBumpMessage); - overridenConfig.MinorVersionBumpMessage.ShouldBe(expectedConfig.MinorVersionBumpMessage); - overridenConfig.PatchVersionBumpMessage.ShouldBe(expectedConfig.PatchVersionBumpMessage); - overridenConfig.NoBumpMessage.ShouldBe(expectedConfig.NoBumpMessage); - overridenConfig.LegacySemVerPadding.ShouldBe(expectedConfig.LegacySemVerPadding); - overridenConfig.BuildMetaDataPadding.ShouldBe(expectedConfig.BuildMetaDataPadding); - overridenConfig.CommitsSinceVersionSourcePadding.ShouldBe(expectedConfig.CommitsSinceVersionSourcePadding); - overridenConfig.TagPreReleaseWeight.ShouldBe(expectedConfig.TagPreReleaseWeight); - overridenConfig.CommitMessageIncrementing.ShouldBe(expectedConfig.CommitMessageIncrementing); - overridenConfig.Increment.ShouldBe(expectedConfig.Increment); - overridenConfig.CommitDateFormat.ShouldBe(expectedConfig.CommitDateFormat); - overridenConfig.MergeMessageFormats.ShouldBe(expectedConfig.MergeMessageFormats); - overridenConfig.UpdateBuildNumber.ShouldBe(expectedConfig.UpdateBuildNumber); - - overridenConfig.Ignore.ShouldBeEquivalentTo(expectedConfig.Ignore); - - overridenConfig.Branches.Keys.ShouldBe(expectedConfig.Branches.Keys); - - foreach (var branch in overridenConfig.Branches.Keys) - { - overridenConfig.Branches[branch].ShouldBeEquivalentTo(expectedConfig.Branches[branch]); - } - } - - [Test] - public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile() - { - const string text = ""; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.TagPrefix.ShouldBe(Config.DefaultTagPrefix); - } - - [Test] - public void ShouldUseTagPrefixFromConfigFileWhenProvided() - { - const string text = "tag-prefix: custom-tag-prefix-from-yml"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath); - - config.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); - } - - [Test] - public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPrefixSetAtYmlFile) - { - var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : ""; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath, new Config { TagPrefix = "tag-prefix-from-override-config" }); - - config.TagPrefix.ShouldBe("tag-prefix-from-override-config"); - } - - [Test] - public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig() - { - const string text = ""; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath, new Config { TagPrefix = null }); - - config.TagPrefix.ShouldBe(Config.DefaultTagPrefix); - } - - [Test] - public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig() - { - const string text = "tag-prefix: custom-tag-prefix-from-yml"; - SetupConfigFileContent(text); - var config = this.configProvider.Provide(this.repoPath, new Config { TagPrefix = null }); - - config.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); - } -} diff --git a/src/GitVersion.Core.Tests/Configuration/DefaultConfigFileLocatorTests.cs b/src/GitVersion.Core.Tests/Configuration/DefaultConfigFileLocatorTests.cs deleted file mode 100644 index 0ee6005603..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/DefaultConfigFileLocatorTests.cs +++ /dev/null @@ -1,228 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests; - -[TestFixture] -public class ConfigFileLocatorTests -{ - public class DefaultConfigFileLocatorTests : TestBase - { - private const string DefaultRepoPath = @"c:\MyGitRepo"; - private const string DefaultWorkingPath = @"c:\MyGitRepo\Working"; - - private string repoPath; - private string workingPath; - private IFileSystem fileSystem; - private IConfigProvider configurationProvider; - private IConfigFileLocator configFileLocator; - - [SetUp] - public void Setup() - { - this.repoPath = DefaultRepoPath; - this.workingPath = DefaultWorkingPath; - var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath }); - - var sp = ConfigureServices(services => services.AddSingleton(options)); - - this.fileSystem = sp.GetRequiredService(); - this.configurationProvider = sp.GetRequiredService(); - this.configFileLocator = sp.GetRequiredService(); - - ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - } - - [TestCase(ConfigFileLocator.DefaultFileName, ConfigFileLocator.DefaultFileName)] - public void ThrowsExceptionOnAmbiguousConfigFileLocation(string repoConfigFile, string workingConfigFile) - { - var repositoryConfigFilePath = SetupConfigFileContent(string.Empty, repoConfigFile, this.repoPath); - var workingDirectoryConfigFilePath = SetupConfigFileContent(string.Empty, workingConfigFile, this.workingPath); - - var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - - var expectedMessage = $"Ambiguous config file selection from '{workingDirectoryConfigFilePath}' and '{repositoryConfigFilePath}'"; - exception.Message.ShouldBe(expectedMessage); - } - - [Test] - public void NoWarnOnGitVersionYmlFile() - { - SetupConfigFileContent(string.Empty, ConfigFileLocator.DefaultFileName, this.repoPath); - - Should.NotThrow(() => this.configurationProvider.Provide(this.repoPath)); - } - - [Test] - public void NoWarnOnNoGitVersionYmlFile() => Should.NotThrow(() => this.configurationProvider.Provide(this.repoPath)); - - private string SetupConfigFileContent(string text, string fileName, string path) - { - var fullPath = PathHelper.Combine(path, fileName); - this.fileSystem.WriteAllText(fullPath, text); - - return fullPath; - } - } - - public class NamedConfigFileLocatorTests : TestBase - { - private const string DefaultRepoPath = @"c:\MyGitRepo"; - private const string DefaultWorkingPath = @"c:\MyGitRepo\Working"; - - private string repoPath; - private string workingPath; - private IFileSystem fileSystem; - private IConfigFileLocator configFileLocator; - private GitVersionOptions gitVersionOptions; - - [SetUp] - public void Setup() - { - this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigFile = "my-config.yaml" } }; - this.repoPath = DefaultRepoPath; - this.workingPath = DefaultWorkingPath; - - ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - } - - [Test] - public void ThrowsExceptionOnAmbiguousConfigFileLocation() - { - var sp = GetServiceProvider(this.gitVersionOptions); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - var repositoryConfigFilePath = SetupConfigFileContent(string.Empty, path: this.repoPath); - var workingDirectoryConfigFilePath = SetupConfigFileContent(string.Empty, path: this.workingPath); - - var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - - var expectedMessage = $"Ambiguous config file selection from '{workingDirectoryConfigFilePath}' and '{repositoryConfigFilePath}'"; - exception.Message.ShouldBe(expectedMessage); - } - - [Test] - public void DoNotThrowWhenWorkingAndRepoPathsAreSame() - { - this.workingPath = DefaultRepoPath; - - var sp = GetServiceProvider(this.gitVersionOptions); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - SetupConfigFileContent(string.Empty, path: this.workingPath); - - Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - } - - [Test] - public void DoNotThrowWhenWorkingAndRepoPathsAreSame_WithDifferentCasing() - { - this.workingPath = DefaultRepoPath.ToLower(); - - var sp = GetServiceProvider(this.gitVersionOptions); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - SetupConfigFileContent(string.Empty, path: this.workingPath); - - Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - } - - [Test] - public void DoNotThrowWhenConfigFileIsInSubDirectoryOfRepoPath() - { - this.workingPath = DefaultRepoPath; - - this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigFile = "./src/my-config.yaml" } }; - var sp = GetServiceProvider(this.gitVersionOptions); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - SetupConfigFileContent(string.Empty, path: this.workingPath); - - Should.NotThrow(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - } - - [Test] - public void NoWarnOnCustomYmlFile() - { - var stringLogger = string.Empty; - void Action(string info) => stringLogger = info; - - var logAppender = new TestLogAppender(Action); - var log = new Log(logAppender); - - var sp = GetServiceProvider(this.gitVersionOptions, log); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - SetupConfigFileContent(string.Empty); - - var configurationProvider = sp.GetRequiredService(); - - configurationProvider.Provide(this.repoPath); - stringLogger.Length.ShouldBe(0); - } - - [Test] - public void NoWarnOnCustomYmlFileOutsideRepoPath() - { - var stringLogger = string.Empty; - void Action(string info) => stringLogger = info; - - var logAppender = new TestLogAppender(Action); - var log = new Log(logAppender); - - var sp = GetServiceProvider(this.gitVersionOptions, log); - this.configFileLocator = sp.GetRequiredService(); - this.fileSystem = sp.GetRequiredService(); - - SetupConfigFileContent(string.Empty, path: @"c:\\Unrelated\\path"); - - var configurationProvider = sp.GetRequiredService(); - - configurationProvider.Provide(this.repoPath); - stringLogger.Length.ShouldBe(0); - } - - [Test] - public void ThrowsExceptionOnCustomYmlFileDoesNotExist() - { - var sp = GetServiceProvider(this.gitVersionOptions); - this.configFileLocator = sp.GetRequiredService(); - - var exception = Should.Throw(() => this.configFileLocator.Verify(this.workingPath, this.repoPath)); - - var workingPathFileConfig = PathHelper.Combine(this.workingPath, this.gitVersionOptions.ConfigInfo.ConfigFile); - var repoPathFileConfig = PathHelper.Combine(this.repoPath, this.gitVersionOptions.ConfigInfo.ConfigFile); - var expectedMessage = $"The configuration file was not found at '{workingPathFileConfig}' or '{repoPathFileConfig}'"; - exception.Message.ShouldBe(expectedMessage); - } - - private string SetupConfigFileContent(string text, string? fileName = null, string? path = null) - { - if (fileName.IsNullOrEmpty()) fileName = this.configFileLocator.FilePath; - var filePath = fileName; - if (!path.IsNullOrEmpty()) - filePath = PathHelper.Combine(path, filePath); - this.fileSystem.WriteAllText(filePath, text); - return filePath; - } - - private static IServiceProvider GetServiceProvider(GitVersionOptions gitVersionOptions, ILog? log = null) => - ConfigureServices(services => - { - if (log != null) services.AddSingleton(log); - services.AddSingleton(Options.Create(gitVersionOptions)); - }); - } -} diff --git a/src/GitVersion.Core.Tests/Configuration/IgnoreConfigTests.cs b/src/GitVersion.Core.Tests/Configuration/IgnoreConfigTests.cs deleted file mode 100644 index 4cc79f76f8..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/IgnoreConfigTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using NUnit.Framework; -using Shouldly; -using YamlDotNet.Core; - -namespace GitVersion.Core.Tests.Configuration; - -[TestFixture] -public class IgnoreConfigTests : TestBase -{ - [Test] - public void CanDeserialize() - { - const string yaml = @" -ignore: - sha: [b6c0c9fda88830ebcd563e500a5a7da5a1658e98] - commits-before: 2015-10-23T12:23:15 -"; - - using var reader = new StringReader(yaml); - var config = ConfigSerializer.Read(reader); - - config.Ignore.ShouldNotBeNull(); - config.Ignore.ShAs.ShouldNotBeEmpty(); - config.Ignore.ShAs.ShouldBe(new[] { "b6c0c9fda88830ebcd563e500a5a7da5a1658e98" }); - config.Ignore.Before.ShouldBe(DateTimeOffset.Parse("2015-10-23T12:23:15")); - } - - [Test] - public void ShouldSupportsOtherSequenceFormat() - { - const string yaml = @" -ignore: - sha: - - b6c0c9fda88830ebcd563e500a5a7da5a1658e98 - - 6c19c7c219ecf8dbc468042baefa73a1b213e8b1 -"; - - using var reader = new StringReader(yaml); - var config = ConfigSerializer.Read(reader); - - config.Ignore.ShouldNotBeNull(); - config.Ignore.ShAs.ShouldNotBeEmpty(); - config.Ignore.ShAs.ShouldBe(new[] { "b6c0c9fda88830ebcd563e500a5a7da5a1658e98", "6c19c7c219ecf8dbc468042baefa73a1b213e8b1" }); - } - - [Test] - public void WhenNotInConfigShouldHaveDefaults() - { - const string yaml = @" -next-version: 1.0 -"; - - using var reader = new StringReader(yaml); - var config = ConfigSerializer.Read(reader); - - config.Ignore.ShouldNotBeNull(); - config.Ignore.ShAs.ShouldBeEmpty(); - config.Ignore.Before.ShouldBe(null); - } - - [Test] - public void WhenBadDateFormatShouldFail() - { - const string yaml = @" -ignore: - commits-before: bad format date -"; - - using var reader = new StringReader(yaml); - Should.Throw(() => ConfigSerializer.Read(reader)); - } - - [Test] - public void NewInstanceShouldBeEmpty() - { - var ignoreConfig = new IgnoreConfig(); - - ignoreConfig.IsEmpty.ShouldBeTrue(); - } -} diff --git a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.CanSetNextVersion.approved.txt b/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.CanSetNextVersion.approved.txt deleted file mode 100644 index 0368e755e7..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.CanSetNextVersion.approved.txt +++ /dev/null @@ -1,5 +0,0 @@ -next-version: 2.0.0 -branches: {} -ignore: - sha: [] -merge-message-formats: {} diff --git a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs b/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs deleted file mode 100644 index cdef91bd81..0000000000 --- a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Runtime.InteropServices; -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Helpers; -using GitVersion.Logging; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.Init; - -[TestFixture] -public class InitScenarios : TestBase -{ - [SetUp] - public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - - [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CanSetNextVersion() - { - var workingDirectory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "c:\\proj" : "/proj"; - var options = Options.Create(new GitVersionOptions { WorkingDirectory = workingDirectory }); - - var sp = ConfigureServices(services => - { - services.AddSingleton(new TestConsole("3", "2.0.0", "0")); - services.AddSingleton(options); - }); - - var configurationProvider = sp.GetRequiredService(); - var fileSystem = sp.GetRequiredService(); - configurationProvider.Init(workingDirectory); - - fileSystem.ReadAllText(PathHelper.Combine(workingDirectory, "GitVersion.yml")).ShouldMatchApproved(); - } -} diff --git a/src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs b/src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs index 1fc72dac93..03eb85b522 100644 --- a/src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs +++ b/src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs @@ -1,8 +1,8 @@ +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NUnit.Framework; namespace GitVersion.Core.Tests; @@ -11,51 +11,23 @@ public class DynamicRepositoryTests : TestBase { private string? workDirectory; - private static void ClearReadOnly(DirectoryInfo parentDirectory) - { - parentDirectory.Attributes = FileAttributes.Normal; - foreach (var fi in parentDirectory.GetFiles()) - { - fi.Attributes = FileAttributes.Normal; - } - foreach (var di in parentDirectory.GetDirectories()) - { - ClearReadOnly(di); - } - } - - [OneTimeSetUp] - public void CreateTemporaryRepository() - { - // Note: we can't use guid because paths will be too long - this.workDirectory = PathHelper.Combine(Path.GetTempPath(), "GV"); - - // Clean directory upfront, some build agents are having troubles - if (Directory.Exists(this.workDirectory)) - { - var di = new DirectoryInfo(this.workDirectory); - ClearReadOnly(di); - - Directory.Delete(this.workDirectory, true); - } - - Directory.CreateDirectory(this.workDirectory); - } + [SetUp] + public void SetUp() => this.workDirectory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPathLegacy(), "GV"); - [OneTimeTearDown] - public void Cleanup() + [TearDown] + public void TearDown() { } // Note: use same name twice to see if changing commits works on same (cached) repository [NonParallelizable] - [TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "efddf2f92c539a9c27f1904d952dcab8fb955f0e", "5.8.2+56")] - [TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "2dc142a4a4df77db61a00d9fb7510b18b3c2c85a", "5.8.2+47")] + [TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "2dc142a4a4df77db61a00d9fb7510b18b3c2c85a", "5.8.2-47")] + [TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "efddf2f92c539a9c27f1904d952dcab8fb955f0e", "5.8.2-56")] public void FindsVersionInDynamicRepo(string name, string url, string targetBranch, string commitId, string expectedFullSemVer) { - var root = PathHelper.Combine(this.workDirectory, name); - var dynamicDirectory = PathHelper.Combine(root, "D"); // dynamic, keeping directory as short as possible - var workingDirectory = PathHelper.Combine(root, "W"); // working, keeping directory as short as possible + var root = FileSystemHelper.Path.Combine(this.workDirectory, name); + var dynamicDirectory = FileSystemHelper.Path.Combine(root, "D"); // dynamic, keeping directory as short as possible + var workingDirectory = FileSystemHelper.Path.Combine(root, "W"); // working, keeping directory as short as possible var gitVersionOptions = new GitVersionOptions { RepositoryInfo = @@ -65,23 +37,26 @@ public void FindsVersionInDynamicRepo(string name, string url, string targetBran TargetBranch = targetBranch, CommitId = commitId }, - Settings = { NoFetch = false }, + Settings = { NoFetch = false, NoCache = true }, WorkingDirectory = workingDirectory }; var options = Options.Create(gitVersionOptions); - Directory.CreateDirectory(dynamicDirectory); - Directory.CreateDirectory(workingDirectory); - var sp = ConfigureServices(services => services.AddSingleton(options)); + sp.DiscoverRepository(); + var gitPreparer = sp.GetRequiredService(); gitPreparer.Prepare(); + var fileSystem = sp.GetRequiredService(); + fileSystem.Directory.CreateDirectory(dynamicDirectory); + fileSystem.Directory.CreateDirectory(workingDirectory); + var gitVersionCalculator = sp.GetRequiredService(); var versionVariables = gitVersionCalculator.CalculateVersionVariables(); - Assert.AreEqual(expectedFullSemVer, versionVariables.FullSemVer); + Assert.That(versionVariables.FullSemVer, Is.EqualTo(expectedFullSemVer)); } } diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index 8655937572..b36c7ce0e7 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -1,16 +1,15 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Agents; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation.Cache; +using GitVersion.VersionCalculation.Caching; using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -20,7 +19,7 @@ public class GitVersionExecutorTests : TestBase { private IFileSystem fileSystem; private ILog log; - private IGitVersionCache gitVersionCache; + private GitVersionCacheProvider gitVersionCacheProvider; private IServiceProvider sp; [Test] @@ -30,18 +29,15 @@ public void CacheKeySameAfterReNormalizing() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; const string targetBranch = $"refs/head/{MainBranch}"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = targetBranch }, - WorkingDirectory = fixture.RepositoryPath, - Settings = { NoNormalize = false } - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = targetBranch }, WorkingDirectory = fixture.RepositoryPath, Settings = { NoNormalize = false } }; var environment = new TestEnvironment(); environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + sp.DiscoverRepository(); + var preparer = this.sp.GetRequiredService(); preparer.Prepare(); @@ -59,11 +55,7 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized() { const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = string.Empty - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = string.Empty }; Should.NotThrow(() => { this.sp = GetServiceProvider(gitVersionOptions); @@ -73,13 +65,11 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CacheKeyForWorktree() { using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); - var worktreePath = PathHelper.Combine(Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); + var worktreePath = GetWorktreePath(fixture); try { // create a branch and a new worktree for it @@ -88,66 +78,58 @@ public void CacheKeyForWorktree() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = MainBranch }, - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = MainBranch }, WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); + sp.DiscoverRepository(); + var preparer = this.sp.GetRequiredService(); preparer.Prepare(); - var cacheKey = this.sp.GetRequiredService().Create(null); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); cacheKey.Value.ShouldNotBeEmpty(); } finally { - DirectoryHelper.DeleteDirectory(worktreePath); + FileSystemHelper.Directory.DeleteDirectory(worktreePath); } } [Test] public void CacheFileExistsOnDisk() { - const string versionCacheFileContent = @" - Major: 4 - Minor: 10 - Patch: 3 - PreReleaseTag: test.19 - PreReleaseTagWithDash: -test.19 - PreReleaseLabel: test - PreReleaseLabelWithDash: -test - PreReleaseNumber: 19 - WeightedPreReleaseNumber: 19 - BuildMetaData: - BuildMetaDataPadded: - FullBuildMetaData: Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - MajorMinorPatch: 4.10.3 - SemVer: 4.10.3-test.19 - LegacySemVer: 4.10.3-test19 - LegacySemVerPadded: 4.10.3-test0019 - AssemblySemVer: 4.10.3.0 - AssemblySemFileVer: 4.10.3.0 - FullSemVer: 4.10.3-test.19 - InformationalVersion: 4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - BranchName: feature/test - EscapedBranchName: feature-test - Sha: dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - ShortSha: dd2a29af - NuGetVersionV2: 4.10.3-test0019 - NuGetVersion: 4.10.3-test0019 - NuGetPreReleaseTagV2: test0019 - NuGetPreReleaseTag: test0019 - VersionSourceSha: 4.10.2 - CommitsSinceVersionSource: 19 - CommitsSinceVersionSourcePadded: 0019 - CommitDate: 2015-11-10 - UncommittedChanges: 0 - "; + const string versionCacheFileContent = """ + { + "Major": 4, + "Minor": 10, + "Patch": 3, + "PreReleaseTag": "test.19", + "PreReleaseTagWithDash": "-test.19", + "PreReleaseLabel": "test", + "PreReleaseLabelWithDash": "-test", + "PreReleaseNumber": 19, + "WeightedPreReleaseNumber": 19, + "BuildMetaData": null, + "FullBuildMetaData": "Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "MajorMinorPatch": "4.10.3", + "SemVer": "4.10.3-test.19", + "AssemblySemVer": "4.10.3.0", + "AssemblySemFileVer": "4.10.3.0", + "FullSemVer": "4.10.3-test.19", + "InformationalVersion": "4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "BranchName": "feature/test", + "EscapedBranchName": "feature-test", + "Sha": "dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "ShortSha": "dd2a29af", + "VersionSourceSha": "4.10.2", + "CommitsSinceVersionSource": 19, + "CommitDate": "2015-11-10T00:00:00.000Z", + "UncommittedChanges": 0 + } + """; var stringBuilder = new StringBuilder(); - void Action(string s) => stringBuilder.AppendLine(s); var logAppender = new TestLogAppender(Action); this.log = new Log(logAppender); @@ -160,53 +142,54 @@ public void CacheFileExistsOnDisk() var gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions, this.log); var versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCacheProvider.GetCacheFileName(cacheKey); + + this.fileSystem.File.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); var logsMessages = stringBuilder.ToString(); - logsMessages.ShouldContain("Deserializing version variables from cache file", Case.Insensitive, logsMessages); + logsMessages.ShouldContain("Loading version variables from disk cache file", Case.Insensitive, logsMessages); + return; + + void Action(string s) => stringBuilder.AppendLine(s); } [Test] public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDynamicallyCalculatedWithoutSavingInCache() { - const string versionCacheFileContent = @" - Major: 4 - Minor: 10 - Patch: 3 - PreReleaseTag: test.19 - PreReleaseTagWithDash: -test.19 - PreReleaseLabel: test - PreReleaseLabelWithDash: -test - PreReleaseNumber: 19 - BuildMetaData: - BuildMetaDataPadded: - FullBuildMetaData: Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - MajorMinorPatch: 4.10.3 - SemVer: 4.10.3-test.19 - LegacySemVer: 4.10.3-test19 - LegacySemVerPadded: 4.10.3-test0019 - AssemblySemVer: 4.10.3.0 - AssemblySemFileVer: 4.10.3.0 - FullSemVer: 4.10.3-test.19 - InformationalVersion: 4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - BranchName: feature/test - EscapedBranchName: feature-test - Sha: dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - ShortSha: dd2a29af - NuGetVersionV2: 4.10.3-test0019 - NuGetVersion: 4.10.3-test0019 - NuGetPreReleaseTagV2: test0019 - NuGetPreReleaseTag: test0019 - CommitsSinceVersionSource: 19 - CommitsSinceVersionSourcePadded: 0019 - CommitDate: 2015-11-10 - UncommittedChanges: 0 - "; + const string versionCacheFileContent = """ + { + "Major": 4, + "Minor": 10, + "Patch": 3, + "PreReleaseTag": "test.19", + "PreReleaseTagWithDash": "-test.19", + "PreReleaseLabel": "test", + "PreReleaseLabelWithDash": "-test", + "PreReleaseNumber": 19, + "BuildMetaData": null, + "FullBuildMetaData": "Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "MajorMinorPatch": "4.10.3", + "SemVer": "4.10.3-test.19", + "AssemblySemVer": "4.10.3.0", + "AssemblySemFileVer": "4.10.3.0", + "FullSemVer": "4.10.3-test.19", + "InformationalVersion": "4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "BranchName": "feature/test", + "EscapedBranchName": "feature-test", + "Sha": "dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "ShortSha": "dd2a29af", + "CommitsSinceVersionSource": 19, + "CommitDate": "2015-11-10T00:00:00.000Z", + "UncommittedChanges": 0 + } + """; using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); @@ -215,31 +198,35 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn var gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions, this.log); var versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCacheProvider.GetCacheFileName(cacheKey); + this.fileSystem.File.WriteAllText(cacheFileName, versionCacheFileContent); - var cacheDirectory = this.gitVersionCache.GetCacheDirectory(); + var cacheDirectory = this.gitVersionCacheProvider.GetCacheDirectory(); var cacheDirectoryTimestamp = this.fileSystem.GetLastDirectoryWrite(cacheDirectory); - var config = new ConfigurationBuilder().Add(new Config { TagPrefix = "prefix" }).Build(); - gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, ConfigInfo = { OverrideConfig = config } }; + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefixPattern("prefix").Build(); + var overrideConfiguration = new ConfigurationHelper(configuration).Dictionary; + + gitVersionOptions = new() { WorkingDirectory = fixture.RepositoryPath, ConfigurationInfo = { OverrideConfiguration = overrideConfiguration } }; gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions); versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); var cachedDirectoryTimestampAfter = this.fileSystem.GetLastDirectoryWrite(cacheDirectory); - cachedDirectoryTimestampAfter.ShouldBe(cacheDirectoryTimestamp, "Cache was updated when override config was set"); + cachedDirectoryTimestampAfter.ShouldBe(cacheDirectoryTimestamp, "Cache was updated when override configuration was set"); } [Test] public void CacheFileIsMissing() { var stringBuilder = new StringBuilder(); - void Action(string s) => stringBuilder.AppendLine(s); var logAppender = new TestLogAppender(Action); this.log = new Log(logAppender); @@ -254,47 +241,47 @@ public void CacheFileIsMissing() gitVersionCalculator.CalculateVersionVariables(); var logsMessages = stringBuilder.ToString(); - logsMessages.ShouldContain("yml not found", Case.Insensitive, logsMessages); + logsMessages.ShouldMatch("(?s).*Cache file.*(?-s) not found.*"); + return; + + void Action(string s) => stringBuilder.AppendLine(s); } - [Test] - public void ConfigChangeInvalidatesCache() + [TestCase(ConfigurationFileLocator.DefaultFileName)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileName)] + [TestCase(ConfigurationFileLocator.DefaultFileNameDotted)] + [TestCase(ConfigurationFileLocator.DefaultAlternativeFileNameDotted)] + public void ConfigChangeInvalidatesCache(string configFileName) { - const string versionCacheFileContent = @" - Major: 4 - Minor: 10 - Patch: 3 - PreReleaseTag: test.19 - PreReleaseTagWithDash: -test.19 - PreReleaseLabel: test - PreReleaseLabelWithDash: -test - PreReleaseNumber: 19 - WeightedPreReleaseNumber: 19 - BuildMetaData: - BuildMetaDataPadded: - FullBuildMetaData: Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - MajorMinorPatch: 4.10.3 - SemVer: 4.10.3-test.19 - LegacySemVer: 4.10.3-test19 - LegacySemVerPadded: 4.10.3-test0019 - AssemblySemVer: 4.10.3.0 - AssemblySemFileVer: 4.10.3.0 - FullSemVer: 4.10.3-test.19 - InformationalVersion: 4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - BranchName: feature/test - EscapedBranchName: feature-test - Sha: dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - ShortSha: dd2a29af - NuGetVersionV2: 4.10.3-test0019 - NuGetVersion: 4.10.3-test0019 - NuGetPreReleaseTagV2: test0019 - NuGetPreReleaseTag: test0019 - VersionSourceSha: 4.10.2 - CommitsSinceVersionSource: 19 - CommitsSinceVersionSourcePadded: 0019 - CommitDate: 2015-11-10 - UncommittedChanges: 0 - "; + const string versionCacheFileContent = """ + { + "Major": 4, + "Minor": 10, + "Patch": 3, + "PreReleaseTag": "test.19", + "PreReleaseTagWithDash": "-test.19", + "PreReleaseLabel": "test", + "PreReleaseLabelWithDash": "-test", + "PreReleaseNumber": 19, + "WeightedPreReleaseNumber": 19, + "BuildMetaData": null, + "FullBuildMetaData": "Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "MajorMinorPatch": "4.10.3", + "SemVer": "4.10.3-test.19", + "AssemblySemVer": "4.10.3.0", + "AssemblySemFileVer": "4.10.3.0", + "FullSemVer": "4.10.3-test.19", + "InformationalVersion": "4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "BranchName": "feature/test", + "EscapedBranchName": "feature-test", + "Sha": "dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "ShortSha": "dd2a29af", + "VersionSourceSha": "4.10.2", + "CommitsSinceVersionSource": 19, + "CommitDate": "2015-11-10T00:00:00.000Z", + "UncommittedChanges": 0 + } + """; using var fixture = new EmptyRepositoryFixture(); @@ -305,16 +292,19 @@ public void ConfigChangeInvalidatesCache() var gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions); var versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); - versionVariables.FileName.ShouldNotBeNullOrEmpty(); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCacheProvider.GetCacheFileName(cacheKey); + + this.fileSystem.File.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); - var configPath = PathHelper.Combine(fixture.RepositoryPath, ConfigFileLocator.DefaultFileName); - this.fileSystem.WriteAllText(configPath, "next-version: 5.0"); + var configPath = FileSystemHelper.Path.Combine(fixture.RepositoryPath, configFileName); + this.fileSystem.File.WriteAllText(configPath, "next-version: 5.0.0"); gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions, fs: this.fileSystem); @@ -325,41 +315,35 @@ public void ConfigChangeInvalidatesCache() [Test] public void NoCacheBypassesCache() { - const string versionCacheFileContent = @" - Major: 4 - Minor: 10 - Patch: 3 - PreReleaseTag: test.19 - PreReleaseTagWithDash: -test.19 - PreReleaseLabel: test - PreReleaseLabelWithDash: -test - PreReleaseNumber: 19 - WeightedPreReleaseNumber: 19 - BuildMetaData: - BuildMetaDataPadded: - FullBuildMetaData: Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - MajorMinorPatch: 4.10.3 - SemVer: 4.10.3-test.19 - LegacySemVer: 4.10.3-test19 - LegacySemVerPadded: 4.10.3-test0019 - AssemblySemVer: 4.10.3.0 - AssemblySemFileVer: 4.10.3.0 - FullSemVer: 4.10.3-test.19 - InformationalVersion: 4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - BranchName: feature/test - EscapedBranchName: feature-test - Sha: dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f - ShortSha: dd2a29af - NuGetVersionV2: 4.10.3-test0019 - NuGetVersion: 4.10.3-test0019 - NuGetPreReleaseTagV2: test0019 - NuGetPreReleaseTag: test0019 - VersionSourceSha: 4.10.2 - CommitsSinceVersionSource: 19 - CommitsSinceVersionSourcePadded: 0019 - CommitDate: 2015-11-10 - UncommittedChanges: 0 - "; + const string versionCacheFileContent = """ + { + "Major": 4, + "Minor": 10, + "Patch": 3, + "PreReleaseTag": "test.19", + "PreReleaseTagWithDash": "-test.19", + "PreReleaseLabel": "test", + "PreReleaseLabelWithDash": "-test", + "PreReleaseNumber": 19, + "WeightedPreReleaseNumber": 19, + "BuildMetaData": null, + "FullBuildMetaData": "Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "MajorMinorPatch": "4.10.3", + "SemVer": "4.10.3-test.19", + "AssemblySemVer": "4.10.3.0", + "AssemblySemFileVer": "4.10.3.0", + "FullSemVer": "4.10.3-test.19", + "InformationalVersion": "4.10.3-test.19+Branch.feature/test.Sha.dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "BranchName": "feature/test", + "EscapedBranchName": "feature-test", + "Sha": "dd2a29aff0c948e1bdf3dabbe13e1576e70d5f9f", + "ShortSha": "dd2a29af", + "VersionSourceSha": "4.10.2", + "CommitsSinceVersionSource": 19, + "CommitDate": "2015-11-10T00:00:00.000Z", + "UncommittedChanges": 0 + } + """; using var fixture = new EmptyRepositoryFixture(); @@ -370,22 +354,25 @@ public void NoCacheBypassesCache() var versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); - versionVariables.FileName.ShouldNotBeNullOrEmpty(); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCacheProvider.GetCacheFileName(cacheKey); + + this.fileSystem.File.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); gitVersionOptions.Settings.NoCache = true; versionVariables = gitVersionCalculator.CalculateVersionVariables(); - versionVariables.AssemblySemVer.ShouldBe("0.1.0.0"); + versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); } [Test] public void WorkingDirectoryWithoutGit() { - var gitVersionOptions = new GitVersionOptions { WorkingDirectory = System.Environment.SystemDirectory }; + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = SysEnv.SystemDirectory }; var exception = Assert.Throws(() => { @@ -411,14 +398,12 @@ public void WorkingDirectoryWithoutCommits() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void GetProjectRootDirectoryWorkingDirectoryWithWorktree() { using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); - var worktreePath = PathHelper.Combine(Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); + var worktreePath = GetWorktreePath(fixture); try { // create a branch and a new worktree for it @@ -427,11 +412,7 @@ public void GetProjectRootDirectoryWorkingDirectoryWithWorktree() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); @@ -439,7 +420,7 @@ public void GetProjectRootDirectoryWorkingDirectoryWithWorktree() } finally { - DirectoryHelper.DeleteDirectory(worktreePath); + FileSystemHelper.Directory.DeleteDirectory(worktreePath); } } @@ -449,11 +430,7 @@ public void GetProjectRootDirectoryNoWorktree() using var fixture = new EmptyRepositoryFixture(); const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = fixture.RepositoryPath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = fixture.RepositoryPath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); @@ -467,59 +444,50 @@ public void GetDotGitDirectoryNoWorktree() { using var fixture = new EmptyRepositoryFixture(); - var gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = fixture.RepositoryPath - }; + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); - var expectedPath = PathHelper.Combine(fixture.RepositoryPath, ".git"); + var expectedPath = FileSystemHelper.Path.Combine(fixture.RepositoryPath, ".git"); repositoryInfo.DotGitDirectory.ShouldBe(expectedPath); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void GetDotGitDirectoryWorktree() { using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); - var worktreePath = PathHelper.Combine(Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); + var worktreePath = GetWorktreePath(fixture); try { // create a branch and a new worktree for it var repo = new Repository(fixture.RepositoryPath); repo.Worktrees.Add("worktree", worktreePath, false); - var gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); - var expectedPath = PathHelper.Combine(fixture.RepositoryPath, ".git"); + var expectedPath = FileSystemHelper.Path.Combine(fixture.RepositoryPath, ".git"); repositoryInfo.DotGitDirectory.ShouldBe(expectedPath); } finally { - DirectoryHelper.DeleteDirectory(worktreePath); + FileSystemHelper.Directory.DeleteDirectory(worktreePath); } } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionFromWorktreeHead() { // Setup + this.fileSystem = new FileSystem(); using var fixture = new EmptyRepositoryFixture(); - var repoDir = new DirectoryInfo(fixture.RepositoryPath); - var worktreePath = PathHelper.Combine(repoDir.Parent?.FullName, $"{repoDir.Name}-v1"); + var repoDir = fileSystem.DirectoryInfo.New(fixture.RepositoryPath); + var worktreePath = FileSystemHelper.Path.Combine(repoDir.Parent?.FullName, $"{repoDir.Name}-v1"); fixture.Repository.MakeATaggedCommit("v1.0.0"); var branchV1 = fixture.Repository.CreateBranch("support/1.0"); @@ -527,11 +495,11 @@ public void CalculateVersionFromWorktreeHead() fixture.Repository.MakeATaggedCommit("v2.0.0"); fixture.Repository.Worktrees.Add(branchV1.CanonicalName, "1.0", worktreePath, false); - using var worktreeFixture = new LocalRepositoryFixture(new Repository(worktreePath)); + using var worktreeFixture = new LocalRepositoryFixture(new(worktreePath)); var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreeFixture.RepositoryPath }; - var sut = GetGitVersionCalculator(gitVersionOptions); + var sut = GetGitVersionCalculator(gitVersionOptions, fs: this.fileSystem); // Execute var version = sut.CalculateVersionVariables(); @@ -543,8 +511,6 @@ public void CalculateVersionFromWorktreeHead() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTagged_ThrowException() { // Setup @@ -556,13 +522,16 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa fixture.LocalRepositoryFixture.Repository.CreateBranch("support/1.0"); fixture.LocalRepositoryFixture.Checkout(commit.Sha); - using var worktreeFixture = new LocalRepositoryFixture(new Repository(fixture.LocalRepositoryFixture.RepositoryPath)); + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreeFixture.RepositoryPath }; var environment = new TestEnvironment(); environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + var sut = sp.GetRequiredService(); // Execute & Verify @@ -571,8 +540,6 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagged_ReturnSemver() { // Setup @@ -585,13 +552,16 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagge fixture.LocalRepositoryFixture.ApplyTag("1.0.1"); fixture.LocalRepositoryFixture.Checkout(commit.Sha); - using var worktreeFixture = new LocalRepositoryFixture(new Repository(fixture.LocalRepositoryFixture.RepositoryPath)); + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreeFixture.RepositoryPath }; var environment = new TestEnvironment(); environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + var sut = sp.GetRequiredService(); // Execute @@ -603,13 +573,118 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagge version.Sha.ShouldBe(commits.First().Sha); } + [Test] + public void CalculateVersionVariables_ShallowFetch_ThrowException() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreeFixture.RepositoryPath }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + + var sut = sp.GetRequiredService(); + + // Execute & Verify + var exception = Assert.Throws(() => sut.CalculateVersionVariables()); + exception?.Message.ShouldBe("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + } + + [Test] + public void CalculateVersionVariables_ShallowFetch_WithAllowShallow_ShouldNotThrowException() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + var commits = worktreeFixture.Repository.Head.Commits; + version.Sha.ShouldBe(commits.First().Sha); + } + + [Test] + public void CalculateVersionVariables_WithLimitedCloneDepth_AndAllowShallowTrue_ShouldCalculateVersionCorrectly() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + fixture.LocalRepositoryFixture.Repository.MakeACommit("Initial commit"); + fixture.LocalRepositoryFixture.Repository.MakeATaggedCommit("1.0.0"); + var latestCommit = fixture.LocalRepositoryFixture.Repository.MakeACommit("+semver:major"); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + sp.DiscoverRepository(); + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + + // Verify that the correct commit is used + version.Sha.ShouldBe(latestCommit.Sha); + version.MajorMinorPatch.ShouldBe("2.0.0"); + + // Verify repository is still recognized as shallow + var repository = this.sp.GetRequiredService(); + repository.IsShallow.ShouldBeTrue("Repository should still be shallow after version calculation"); + } + + private string GetWorktreePath(EmptyRepositoryFixture fixture) + { + var worktreePath = FileSystemHelper.Path.Combine(this.fileSystem.Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); + return worktreePath; + } + private IGitVersionCalculateTool GetGitVersionCalculator(GitVersionOptions gitVersionOptions, ILog? logger = null, IGitRepository? repository = null, IFileSystem? fs = null) { this.sp = GetServiceProvider(gitVersionOptions, logger, repository, fs); this.fileSystem = this.sp.GetRequiredService(); this.log = this.sp.GetRequiredService(); - this.gitVersionCache = this.sp.GetRequiredService(); + this.gitVersionCacheProvider = (GitVersionCacheProvider)this.sp.GetRequiredService(); + + sp.DiscoverRepository(); return this.sp.GetRequiredService(); } @@ -620,9 +695,8 @@ private static IServiceProvider GetServiceProvider(GitVersionOptions gitVersionO services.AddSingleton(); services.AddSingleton(sp => { - var options = sp.GetRequiredService>(); var contextFactory = sp.GetRequiredService(); - return new Lazy(() => contextFactory.Create(options.Value)); + return new Lazy(() => contextFactory.Create()); }); if (log != null) services.AddSingleton(log); if (fileSystem != null) services.AddSingleton(fileSystem); @@ -630,6 +704,10 @@ private static IServiceProvider GetServiceProvider(GitVersionOptions gitVersionO if (environment != null) services.AddSingleton(environment); var options = Options.Create(gitVersionOptions); services.AddSingleton(options); - services.AddSingleton(RepositoryExtensions.ToGitRepositoryInfo(options)); + services.AddSingleton(sp => + { + var fs = sp.GetRequiredService(); + return new GitRepositoryInfo(fs, options); + }); }); } diff --git a/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs index 04e2569ed8..9f2d17b57d 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionToolDirectoryTests.cs @@ -1,9 +1,9 @@ +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NUnit.Framework; namespace GitVersion.Core.Tests; @@ -12,22 +12,25 @@ public class GitVersionTaskDirectoryTests : TestBase { private string gitDirectory; private string workDirectory; + private IFileSystem fileSystem; [SetUp] public void SetUp() { - this.workDirectory = PathHelper.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); - this.gitDirectory = Repository.Init(this.workDirectory).TrimEnd(Path.DirectorySeparatorChar); - Assert.NotNull(this.gitDirectory); + var sp = ConfigureServices(); + this.fileSystem = sp.GetRequiredService(); + this.workDirectory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), Guid.NewGuid().ToString()); + this.gitDirectory = Repository.Init(this.workDirectory).TrimEnd(FileSystemHelper.Path.DirectorySeparatorChar); + Assert.That(this.gitDirectory, Is.Not.Null); } [TearDown] - public void Cleanup() => Directory.Delete(this.workDirectory, true); + public void Cleanup() => this.fileSystem.Directory.Delete(this.workDirectory, true); [Test] public void FindsGitDirectory() { - try + var exception = Assert.Catch(() => { var options = Options.Create(new GitVersionOptions { WorkingDirectory = workDirectory, Settings = { NoFetch = true } }); @@ -36,23 +39,17 @@ public void FindsGitDirectory() var gitVersionCalculator = sp.GetRequiredService(); gitVersionCalculator.CalculateVersionVariables(); - } - catch (Exception ex) - { - // `RepositoryNotFoundException` means that it couldn't find the .git directory, - // any other exception means that the .git was found but there was some other issue that this test doesn't care about. - Assert.IsNotAssignableFrom(ex); - } + }); + exception.ShouldNotBeAssignableTo(); } - [Test] public void FindsGitDirectoryInParent() { - var childDir = PathHelper.Combine(this.workDirectory, "child"); - Directory.CreateDirectory(childDir); + var childDir = FileSystemHelper.Path.Combine(this.workDirectory, "child"); + this.fileSystem.Directory.CreateDirectory(childDir); - try + var exception = Assert.Catch(() => { var options = Options.Create(new GitVersionOptions { WorkingDirectory = childDir, Settings = { NoFetch = true } }); @@ -61,13 +58,7 @@ public void FindsGitDirectoryInParent() var gitVersionCalculator = sp.GetRequiredService(); gitVersionCalculator.CalculateVersionVariables(); - } - catch (Exception ex) - { - // TODO I think this test is wrong.. It throws a different exception - // `RepositoryNotFoundException` means that it couldn't find the .git directory, - // any other exception means that the .git was found but there was some other issue that this test doesn't care about. - Assert.IsNotAssignableFrom(ex); - } + }); + exception.ShouldNotBeAssignableTo(); } } diff --git a/src/GitVersion.Core.Tests/Core/RegexPatternTests.cs b/src/GitVersion.Core.Tests/Core/RegexPatternTests.cs new file mode 100644 index 0000000000..d56739de7f --- /dev/null +++ b/src/GitVersion.Core.Tests/Core/RegexPatternTests.cs @@ -0,0 +1,439 @@ +using System.Text.RegularExpressions; +using static GitVersion.Core.RegexPatterns.AssemblyVersion; + +namespace GitVersion.Core.Continuous.Tests +{ + public class RegexPatternsTests + { + [TestCase("/foo:", true, "/foo:")] + [TestCase("/bar:", true, "/bar:")] + [TestCase("foo:", false, null)] + public void SwitchArgumentRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Common.SwitchArgumentRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("https://user:pass@host/", true, "https://user:pass@")] + [TestCase("http://user:pass@host/", true, "http://user:pass@")] + [TestCase("ftp://user:pass@host", false, null)] + public void ObscurePasswordRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Common.ObscurePasswordRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("{env:FOO}", true, "{env:FOO}")] + [TestCase("{bar}", true, "{bar}")] + [TestCase("{env:FOO ?? \"fallback\"}", true, "{env:FOO ?? \"fallback\"}")] + [TestCase("{bar ?? fallback}", true, "{bar ?? fallback}")] + [TestCase("env:FOO", false, null)] + public void ExpandTokensRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Common.ExpandTokensRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("v", true, "v")] + [TestCase("V", true, "V")] + [TestCase("v1", true, "v")] + [TestCase("V2.0", true, "V")] + [TestCase("1", true, "")] + [TestCase("x", true, "")] + [TestCase("", true, "")] + public void DefaultTagPrefixRegex_MatchesExpected(string input, bool expected, string expectedCapture) + { + var match = RegexPatterns.Configuration.DefaultTagPrefixRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("v1.2.3", true, "v1.2.3")] + [TestCase("1.2", true, "1.2")] + [TestCase("main", false, null)] + public void DefaultVersionInBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.DefaultVersionInBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("main", true, "main")] + [TestCase("master", true, "master")] + [TestCase("develop", false, null)] + public void MainBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.MainBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("develop", true, "develop")] + [TestCase("development", true, "development")] + [TestCase("dev", true, "dev")] + [TestCase("main", false, null)] + public void DevelopBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.DevelopBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("release/1.0", true, "release/1.0")] + [TestCase("releases-2.0", true, "releases-2.0")] + [TestCase("feature/foo", false, null)] + public void ReleaseBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.ReleaseBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("feature/foo", true, "feature/foo")] + [TestCase("features-bar", true, "features-bar")] + [TestCase("hotfix/1.0", false, null)] + public void FeatureBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.FeatureBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("pull-requests/123", true, "pull-requests/123")] + [TestCase("pull-123", true, "pull-123")] + [TestCase("pr-456", true, "pr-456")] + [TestCase("main", false, null)] + public void PullRequestBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.PullRequestBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("hotfix/1.0", true, "hotfix/1.0")] + [TestCase("hotfixes-2.0", true, "hotfixes-2.0")] + [TestCase("support/1.0", false, null)] + public void HotfixBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.HotfixBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("support/1.0", true, "support/1.0")] + [TestCase("support-2.0", true, "support-2.0")] + [TestCase("main", false, null)] + public void SupportBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.SupportBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("any-branch", true, "any-branch")] + [TestCase("main", true, "main")] + public void UnknownBranchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Configuration.UnknownBranchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Merge branch 'feature/foo' into develop", true, "Merge branch 'feature/foo' into develop")] + [TestCase("Merge tag 'v1.0.0'", true, "Merge tag 'v1.0.0'")] + [TestCase("Finish feature/foo", false, null)] + public void DefaultMergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.DefaultMergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Finish feature/foo into develop", true, "Finish feature/foo into develop")] + [TestCase("Finish bugfix/bar", true, "Finish bugfix/bar")] + [TestCase("Merge branch 'feature/foo'", false, null)] + public void SmartGitMergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.SmartGitMergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Merge pull request #123 from repo from feature/foo to develop", true, "Merge pull request #123 from repo from feature/foo to develop")] + [TestCase("Merge pull request #1 in repo from bugfix/bar to main", true, "Merge pull request #1 in repo from bugfix/bar to main")] + [TestCase("Finish feature/foo", false, null)] + public void BitBucketPullMergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.BitBucketPullMergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Pull request #123\n\nMerge in repo from feature/foo to develop", true, "Pull request #123\n\nMerge in repo from feature/foo to develop")] + [TestCase("Pull request #1\n\nMerge in repo from bugfix/bar to main", true, "Pull request #1\n\nMerge in repo from bugfix/bar to main")] + [TestCase("Merge pull request #123 from repo from feature/foo to develop", false, null)] + public void BitBucketPullv7MergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.BitBucketPullv7MergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Merged in feature/foo (pull request #123)", true, "Merged in feature/foo (pull request #123)")] + [TestCase("Merged in bugfix/bar (pull request #1)", true, "Merged in bugfix/bar (pull request #1)")] + [TestCase("Merge pull request #123 from repo from feature/foo to develop", false, null)] + public void BitBucketCloudPullMergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.BitBucketCloudPullMergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("Merge pull request #123 from repo/feature/foo", false, null)] + [TestCase("Merge pull request #123 from feature/foo into develop", false, null)] + public void AzureDevOpsPullMergeMessageRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.MergeMessage.AzureDevOpsPullMergeMessageRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("[assembly: AssemblyVersion(\"1.0.0.0\")]", true, "[assembly: AssemblyVersion(\"1.0.0.0\")]")] + [TestCase("[assembly: AssemblyFileVersion(\"1.0.0.0\")]", true, "[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] + [TestCase("[assembly: AssemblyInformationalVersion(\"1.0.0.0\")]", true, "[assembly: AssemblyInformationalVersion(\"1.0.0.0\")]")] + [TestCase("random text", false, null)] + public void CsharpAssemblyAttributeRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Output.CsharpAssemblyAttributeRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("[]", true, "[]")] + [TestCase("[]", true, "[]")] + [TestCase("[]", true, "[]")] + [TestCase("random text", false, null)] + public void FsharpAssemblyAttributeRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Output.FsharpAssemblyAttributeRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("", true, "")] + [TestCase("", true, "")] + [TestCase("", true, "")] + [TestCase("random text", false, null)] + public void VisualBasicAssemblyAttributeRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.Output.VisualBasicAssemblyAttributeRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("+semver: major", true, "+semver: major")] + [TestCase("+semver: breaking", true, "+semver: breaking")] + [TestCase("+semver: minor", false, null)] + public void DefaultMajorRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.VersionCalculation.DefaultMajorRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("+semver: minor", true, "+semver: minor")] + [TestCase("+semver: feature", true, "+semver: feature")] + [TestCase("+semver: patch", false, null)] + public void DefaultMinorRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.VersionCalculation.DefaultMinorRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("+semver: patch", true, "+semver: patch")] + [TestCase("+semver: fix", true, "+semver: fix")] + [TestCase("+semver: none", false, null)] + public void DefaultPatchRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.VersionCalculation.DefaultPatchRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("+semver: none", true, "+semver: none")] + [TestCase("+semver: skip", true, "+semver: skip")] + [TestCase("+semver: patch", false, null)] + public void DefaultNoBumpRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.VersionCalculation.DefaultNoBumpRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("1.2.3", true, "1.2.3")] + [TestCase("1.2.3-alpha", true, "1.2.3-alpha")] + [TestCase("1.2", false, null)] + public void ParseStrictRegex_MatchesExpected(string input, bool expected, string? expectedCapture) + { + var match = RegexPatterns.SemanticVersion.ParseStrictRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("1.2.3", true, "1.2.3")] + [TestCase("1.2", true, "1.2")] + [TestCase("1", true, "1")] + [TestCase("1.2.3.4", true, "1.2.3.4")] + public void ParseLooseRegex_MatchesExpected(string input, bool expected, string expectedCapture) + { + var match = RegexPatterns.SemanticVersion.ParseLooseRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("123.BranchName.foo.Sha.abc", true, "123.BranchName.foo.Sha.abc")] + [TestCase("Branch.Name.develop", true, "Branch.Name.develop")] + [TestCase("random", true, "random")] + public void ParseBuildMetaDataRegex_MatchesExpected(string input, bool expected, string expectedCapture) + { + var match = RegexPatterns.SemanticVersion.ParseBuildMetaDataRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("meta-data", false, new string[0])] + [TestCase("meta_data", true, new[] { "_" })] + [TestCase("meta.data", false, new string[0])] + [TestCase("meta+data$", true, new[] { "+", "$" })] + [TestCase("m@e#t!a", true, new[] { "@", "#", "!" })] + public void FormatBuildMetaDataRegex_CapturesInvalidCharacters(string input, bool shouldMatch, string[] expectedCaptures) + { + var matches = RegexPatterns.SemanticVersion.FormatBuildMetaDataRegex().Matches(input); + + var matched = matches.Count > 0; + matched.ShouldBe(shouldMatch, $"Expected match: {shouldMatch}, but found {matches.Count} matches."); + + var captured = new List(); + foreach (Match m in matches) + captured.Add(m.Value); + + captured.ShouldBe(expectedCaptures); + } + + [TestCase("alpha.1", true, "alpha.1")] + [TestCase("beta", true, "beta")] + [TestCase("rc.2", true, "rc.2")] + public void ParsePreReleaseTagRegex_MatchesExpected(string input, bool expected, string expectedCapture) + { + var match = RegexPatterns.SemanticVersion.ParsePreReleaseTagRegex().Match(input); + match.Success.ShouldBe(expected); + if (expected) + match.Value.ShouldBe(expectedCapture); + } + + [TestCase("/* block comment */", true, "block", " block comment ")] + [TestCase("// line comment\r\n", true, "line", " line comment")] + [TestCase("\"string \\\"text\\\" inside\"", true, "str", "string \\\"text\\\" inside")] + [TestCase("int x = 5;", false, "", "")] + public void CSharpTriviaRegex_CapturesExpected(string input, bool expectedMatch, string expectedGroup, string expectedGroupValue) + { + var regex = CSharp.TriviaRegex(); + var match = regex.Match(input); + match.Success.ShouldBe(expectedMatch); + + if (expectedMatch && !string.IsNullOrEmpty(expectedGroup)) + { + // Match group 1: block, group 2: line, group 3: string + var groups = match.Groups; + var actualGroupValue = expectedGroup switch + { + "block" => groups[1].Success ? groups[1].Value : "", + "line" => groups[2].Success ? groups[2].Value : "", + "str" => groups[3].Success ? groups[3].Value : "", + _ => "" + }; + actualGroupValue.ShouldBe(expectedGroupValue); + } + } + + [TestCase("[assembly: AssemblyVersion()]", true)] + [TestCase("[assembly:AssemblyFileVersion()]", true)] + [TestCase("[assembly:System.Reflection.AssemblyInformationalVersion()]", true)] + [TestCase("[assembly: AssemblyTitle(\"App\")]", false)] + public void CSharpAttributeRegex_MatchesExpected(string input, bool expectedMatch) + { + var regex = CSharp.AttributeRegex(); + var match = regex.Match(input); + match.Success.ShouldBe(expectedMatch); + } + + [TestCase("/* block comment */", true, "block", " block comment ")] + [TestCase("// line comment\r\n", true, "line", " line comment")] + [TestCase("\"string \\\"text\\\" inside\"", true, "str", "string \\\"text\\\" inside")] + [TestCase("let x = 1", false, "", "")] + public void FSharpTriviaRegex_CapturesExpected(string input, bool expectedMatch, string expectedGroup, string expectedGroupValue) + { + var regex = FSharp.TriviaRegex(); + var match = regex.Match(input); + match.Success.ShouldBe(expectedMatch); + + if (expectedMatch && !string.IsNullOrEmpty(expectedGroup)) + { + var groups = match.Groups; + var actualGroupValue = expectedGroup switch + { + "block" => groups[1].Success ? groups[1].Value : "", + "line" => groups[2].Success ? groups[2].Value : "", + "str" => groups[3].Success ? groups[3].Value : "", + _ => "" + }; + actualGroupValue.ShouldBe(expectedGroupValue); + } + } + + [TestCase("[]", true)] + [TestCase("[]", true)] + [TestCase("[]", true)] + [TestCase("[]", false)] + [TestCase("[assembly: AssemblyVersion()]", false)] + public void FSharpAttributeRegex_MatchesExpected(string input, bool expectedMatch) + { + var regex = FSharp.AttributeRegex(); + var match = regex.Match(input); + match.Success.ShouldBe(expectedMatch); + } + } +} diff --git a/src/GitVersion.Core.Tests/Core/RepositoryExtensionsTests.cs b/src/GitVersion.Core.Tests/Core/RepositoryExtensionsTests.cs index 684d1224d1..5e9addaab6 100644 --- a/src/GitVersion.Core.Tests/Core/RepositoryExtensionsTests.cs +++ b/src/GitVersion.Core.Tests/Core/RepositoryExtensionsTests.cs @@ -1,6 +1,5 @@ using GitVersion.Core.Tests.Helpers; -using NSubstitute; -using NUnit.Framework; +using GitVersion.Git; namespace GitVersion.Core.Tests; @@ -35,16 +34,16 @@ private static IRemote MockRemote(IGitRepository repository) var branches = Substitute.For(); branches[branch.Name.Canonical].Returns(branch); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] { branch }).GetEnumerator()); + branches.MockCollectionReturn(branch); var reference = Substitute.For(); reference.Name.Returns(new ReferenceName("refs/heads/develop")); var references = Substitute.For(); references["develop"].Returns(reference); - references.GetEnumerator().Returns(_ => ((IEnumerable)new[] { reference }).GetEnumerator()); + references.MockCollectionReturn(reference); - repository.Refs.Returns(references); + repository.References.Returns(references); repository.Head.Returns(branch); repository.Branches.Returns(branches); return remote; diff --git a/src/GitVersion.Core.Tests/Core/RepositoryStoreTests.cs b/src/GitVersion.Core.Tests/Core/RepositoryStoreTests.cs index bd60860d71..9e58ad8bcb 100644 --- a/src/GitVersion.Core.Tests/Core/RepositoryStoreTests.cs +++ b/src/GitVersion.Core.Tests/Core/RepositoryStoreTests.cs @@ -1,11 +1,9 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.Git; using GitVersion.Logging; -using GitVersion.Model.Configuration; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -68,7 +66,7 @@ public void FindsCorrectMergeBaseForForwardMerge() var developMergeBase = gitRepoMetadataProvider.FindMergeBase(develop, release); - fixtureRepository.DumpGraph(Console.WriteLine); + fixtureRepository.DumpGraph(); releaseBranchMergeBase.ShouldBe(expectedReleaseMergeBase); developMergeBase.ShouldBe(expectedDevelopMergeBase); @@ -124,7 +122,7 @@ public void FindsCorrectMergeBaseForForwardMergeMovesOn() var developMergeBase = gitRepoMetadataProvider.FindMergeBase(develop, release); - fixtureRepository.DumpGraph(Console.WriteLine); + fixtureRepository.DumpGraph(); releaseBranchMergeBase.ShouldBe(expectedReleaseMergeBase); developMergeBase.ShouldBe(expectedDevelopMergeBase); @@ -199,7 +197,7 @@ public void FindsCorrectMergeBaseForMultipleForwardMerges() var developMergeBase = gitRepoMetadataProvider.FindMergeBase(develop, release); - fixtureRepository.DumpGraph(Console.WriteLine); + fixtureRepository.DumpGraph(); releaseBranchMergeBase.ShouldBe(expectedReleaseMergeBase); developMergeBase.ShouldBe(expectedDevelopMergeBase); @@ -212,11 +210,10 @@ public void GetBranchesContainingCommitThrowsDirectlyOnNullCommit() var fixtureRepository = fixture.Repository.ToGitRepository(); var gitRepoMetadataProvider = new RepositoryStore(this.log, fixtureRepository); - Assert.Throws(() => gitRepoMetadataProvider.GetBranchesContainingCommit(null)); + Assert.Throws(() => gitRepoMetadataProvider.GetBranchesContainingCommit(null!)); } [Test] - [Ignore("Needs more investigations.")] public void FindCommitBranchWasBranchedFromShouldReturnNullIfTheRemoteIsTheOnlySource() { using var fixture = new RemoteRepositoryFixture(); @@ -228,9 +225,12 @@ public void FindCommitBranchWasBranchedFromShouldReturnNullIfTheRemoteIsTheOnlyS var branch = localRepository.FindBranch("main"); branch.ShouldNotBeNull(); - var branchedCommit = gitRepoMetadataProvider.FindCommitBranchWasBranchedFrom(branch, new Config(), Array.Empty()); - Assert.IsNull(branchedCommit.Branch); - Assert.IsNull(branchedCommit.Commit); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var branchedCommit = gitRepoMetadataProvider.FindCommitBranchBranchedFrom(branch, configuration); + branchedCommit.ShouldBe(BranchCommit.Empty); + + var branchedCommits = gitRepoMetadataProvider.FindCommitBranchesBranchedFrom(branch, configuration).ToArray(); + branchedCommits.ShouldBeEmpty(); } } diff --git a/src/GitVersion.Core.Tests/DocumentationTests.cs b/src/GitVersion.Core.Tests/DocumentationTests.cs index 2844a20361..247af1aacd 100644 --- a/src/GitVersion.Core.Tests/DocumentationTests.cs +++ b/src/GitVersion.Core.Tests/DocumentationTests.cs @@ -1,20 +1,23 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; -using GitVersion.Model.Configuration; using GitVersion.OutputVariables; -using NUnit.Framework; -using Shouldly; -using YamlDotNet.Serialization; namespace GitVersion.Core.Tests; [TestFixture] public class DocumentationTests : TestBase { - private DirectoryInfo docsDirectory; + private FileSystem fileSystem; + private IDirectoryInfo docsDirectory; [OneTimeSetUp] - public void OneTimeSetUp() => this.docsDirectory = GetDocsDirectory(); + public void OneTimeSetUp() + { + this.fileSystem = new FileSystem(); + this.docsDirectory = GetDocsDirectory(); + } [Test] public void ConfigurationDocumentationIsUpToDate() @@ -22,12 +25,12 @@ public void ConfigurationDocumentationIsUpToDate() var configurationDocumentationFile = ReadDocumentationFile("input/docs/reference/configuration.md"); const BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance; - var configProperties = typeof(Config) + var configProperties = typeof(GitVersionConfiguration) .GetProperties(bindingFlags) - .Union(typeof(BranchConfig).GetProperties(bindingFlags)) - .Select(p => p.GetCustomAttribute()) + .Union(typeof(BranchConfiguration).GetProperties(bindingFlags)) + .Select(p => p.GetCustomAttribute()) .Where(a => a != null) - .Select(a => a?.Alias) + .Select(a => a?.Name) .ToList(); configProperties.ShouldNotBeEmpty(); @@ -36,59 +39,58 @@ public void ConfigurationDocumentationIsUpToDate() { var formattedConfigProperty = $"### {configProperty}"; configurationDocumentationFile.ShouldContain(formattedConfigProperty, Case.Insensitive, - System.Environment.NewLine + configurationDocumentationFile); + FileSystemHelper.Path.NewLine + configurationDocumentationFile); } } - [Test] public void VariableDocumentationIsUpToDate() { var variableDocumentationFile = ReadDocumentationFile("input/docs/reference/variables.md"); - var variables = VersionVariables.AvailableVariables.ToList(); + var variables = GitVersionVariables.AvailableVariables.ToList(); variables.ShouldNotBeEmpty(); foreach (var variable in variables) { variableDocumentationFile.ShouldContain(variable, Case.Insensitive, - System.Environment.NewLine + variableDocumentationFile); + FileSystemHelper.Path.NewLine + variableDocumentationFile); } } private string ReadDocumentationFile(string relativeDocumentationFilePath) { - var documentationFilePath = PathHelper.Combine(this.docsDirectory.FullName, relativeDocumentationFilePath); + var documentationFilePath = FileSystemHelper.Path.Combine(this.docsDirectory.FullName, relativeDocumentationFilePath); // Normalize path separators and such. - documentationFilePath = new FileInfo(documentationFilePath).FullName; + documentationFilePath = fileSystem.FileInfo.New(documentationFilePath).FullName; - if (!File.Exists(documentationFilePath)) + if (!this.fileSystem.File.Exists(documentationFilePath)) { throw new FileNotFoundException($"The documentation file '{documentationFilePath}' couldn't be found.", documentationFilePath); } - return File.ReadAllText(documentationFilePath); + return this.fileSystem.File.ReadAllText(documentationFilePath); } - private static DirectoryInfo GetDocsDirectory() + private IDirectoryInfo GetDocsDirectory() { - var currentDirectory = new FileInfo(typeof(DocumentationTests).Assembly.Location).Directory; + var currentDirectory = this.fileSystem.FileInfo.New(typeof(DocumentationTests).Assembly.Location).Directory; while (currentDirectory != null) { - var docsDirectory = currentDirectory + var searchedDirectory = currentDirectory .EnumerateDirectories("docs", SearchOption.TopDirectoryOnly) .FirstOrDefault(); - if (docsDirectory != null) + if (searchedDirectory != null) { - currentDirectory = docsDirectory; + currentDirectory = searchedDirectory; break; } currentDirectory = currentDirectory.Parent; } - if (currentDirectory == null || !currentDirectory.Name.Equals("docs", StringComparison.Ordinal)) + if (currentDirectory?.Name.Equals("docs", StringComparison.Ordinal) != true) { throw new DirectoryNotFoundException("Couldn't find the 'docs' directory."); } diff --git a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs new file mode 100644 index 0000000000..e5d86f1681 --- /dev/null +++ b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs @@ -0,0 +1,193 @@ +using GitVersion.Agents; +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; +using GitVersion.OutputVariables; +using GitVersion.VersionCalculation; +using LibGit2Sharp; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace GitVersion.Core.Tests; + +public static class GitRepositoryTestingExtensions +{ + private static int commitCount = 1; + private static readonly DateTimeOffset when = DateTimeOffset.Now; + + public static ICommit CreateMockCommit() + { + var objectId = Substitute.For(); + var sha = Guid.NewGuid().ToString("n") + "00000000"; + objectId.Sha.Returns(sha); + var commit = Substitute.For(); + commit.Id.Returns(objectId); + commit.Sha.Returns(sha); + commit.Message.Returns("Commit " + commitCount++); + commit.Parents.Returns([]); + commit.When.Returns(when.AddSeconds(1)); + return commit; + } + + public static ICommit CreateMockCommit(List diffPaths) + { + var commit = CreateMockCommit(); + commit.DiffPaths.Returns(diffPaths); + return commit; + } + + public static IBranch CreateMockBranch(string name, params ICommit[] commits) + { + var branch = Substitute.For(); + branch.Name.Returns(new ReferenceName(name)); + branch.IsTracking.Returns(true); + branch.IsRemote.Returns(false); + branch.IsDetachedHead.Returns(false); + branch.Tip.Returns(commits.FirstOrDefault()); + + var commitsCollection = Substitute.For(); + commitsCollection.MockCollectionReturn(commits); + commitsCollection.GetCommitsPriorTo(Arg.Any()).Returns(commits); + branch.Commits.Returns(commitsCollection); + return branch; + } + + public static void DiscoverRepository(this IServiceProvider sp) + { + var gitRepository = sp.GetRequiredService(); + var gitRepositoryInfo = sp.GetRequiredService(); + gitRepository.DiscoverRepository(gitRepositoryInfo.GitRootPath); + } + + public static IBranch FindBranch(this IGitRepository repository, string branchName) + => repository.Branches.FirstOrDefault(branch => branch.Name.WithoutOrigin == branchName) + ?? throw new GitVersionException($"Branch {branchName} not found"); + + public static void DumpGraph(this IGitRepository repository, Action? writer = null, int? maxCommits = null) + => DumpGraph(repository.Path, writer, maxCommits); + + public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null) + => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits); + + public static void RenameRemote(this RemoteCollection remotes, string oldName, string newName) + { + if (oldName.IsEquivalentTo(newName)) return; + if (remotes.Any(remote => remote.Name == newName)) + { + throw new InvalidOperationException($"A remote with the name '{newName}' already exists."); + } + if (!remotes.Any(remote => remote.Name == oldName)) + { + throw new InvalidOperationException($"A remote with the name '{oldName}' does not exist."); + } + remotes.Add(newName, remotes[oldName].Url); + remotes.Remove(oldName); + } + + public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null, + IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) + { + repository ??= fixture.Repository; + configuration ??= GitFlowConfigurationBuilder.New.Build(); + + var overrideConfiguration = new Dictionary(); + var options = Options.Create(new GitVersionOptions + { + WorkingDirectory = repository.Info.WorkingDirectory, + ConfigurationInfo = { OverrideConfiguration = overrideConfiguration }, + RepositoryInfo = + { + TargetBranch = targetBranch, + CommitId = commitId + }, + Settings = { OnlyTrackedBranches = onlyTrackedBranches } + }); + + try + { + var configurationProviderMock = Substitute.For(); + configurationProviderMock.Provide(overrideConfiguration).Returns(configuration); + var sp = ConfigureServices(services => + { + services.AddSingleton(options); + services.AddSingleton(configurationProviderMock); + }); + + sp.DiscoverRepository(); + + var variableProvider = sp.GetRequiredService(); + var nextVersionCalculator = sp.GetRequiredService(); + var contextOptions = sp.GetRequiredService>(); + + var context = contextOptions.Value; + + var semanticVersion = nextVersionCalculator.FindVersion(); + + var effectiveConfiguration = context.Configuration.GetEffectiveConfiguration(context.CurrentBranch.Name); + return variableProvider.GetVariablesFor(semanticVersion, context.Configuration, effectiveConfiguration.PreReleaseWeight); + } + catch (Exception) + { + repository.DumpGraph(); + throw; + } + } + + public static void WriteVersionVariables(this RepositoryFixtureBase fixture, string versionFile) + { + var versionVariables = fixture.GetVersion(); + + FileSystemHelper.File.WriteAllText(versionFile, versionVariables.ToJson()); + } + + public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, + IGitVersionConfiguration? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) + { + repository ??= fixture.Repository; + + var variables = GetVersion(fixture, configuration, repository, commitId, onlyTrackedBranches, targetBranch); + variables.FullSemVer.ShouldBe(fullSemver); + if (commitId == null) + { + fixture.SequenceDiagram.NoteOver(fullSemver, repository.Head.FriendlyName, color: "#D3D3D3"); + } + } + + /// + /// Simulates running on build server + /// + public static void InitializeRepository(this RemoteRepositoryFixture fixture) + { + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = fixture.LocalRepositoryFixture.RepositoryPath + }; + var options = Options.Create(gitVersionOptions); + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + var serviceProvider = ConfigureServices(services => + { + services.AddSingleton(options); + services.AddSingleton(environment); + }); + + var gitPreparer = serviceProvider.GetRequiredService(); + gitPreparer.Prepare(); + } + + private static ServiceProvider ConfigureServices(Action? servicesOverrides = null) + { + var services = new ServiceCollection() + .AddModule(new GitVersionCoreTestModule()); + + servicesOverrides?.Invoke(services); + return services.BuildServiceProvider(); + } + + private static void DumpGraph(string workingDirectory, Action? writer = null, int? maxCommits = null) + => GitTestExtensions.ExecuteGitCmd(GitExtensions.CreateGitLogArgs(maxCommits), workingDirectory, writer); +} diff --git a/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs deleted file mode 100644 index cca12fe9fd..0000000000 --- a/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs +++ /dev/null @@ -1,161 +0,0 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.OutputVariables; -using GitVersion.VersionCalculation; -using LibGit2Sharp; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NSubstitute; -using Shouldly; - -namespace GitVersion.Core.Tests; - -public static class GitToolsTestingExtensions -{ - private static int commitCount = 1; - private static readonly DateTimeOffset when = DateTimeOffset.Now; - - public static ICommit CreateMockCommit() - { - var objectId = Substitute.For(); - objectId.Sha.Returns(Guid.NewGuid().ToString("n") + "00000000"); - - var commit = Substitute.For(); - commit.Id.Returns(objectId); - commit.Sha.Returns(objectId.Sha); - commit.Message.Returns("Commit " + commitCount++); - commit.Parents.Returns(Enumerable.Empty()); - commit.When.Returns(when.AddSeconds(1)); - return commit; - } - public static IBranch CreateMockBranch(string name, params ICommit[] commits) - { - var branch = Substitute.For(); - branch.Name.Returns(new ReferenceName(name)); - branch.IsTracking.Returns(true); - branch.IsRemote.Returns(false); - branch.IsDetachedHead.Returns(false); - branch.Tip.Returns(commits.FirstOrDefault()); - - var commitsCollection = Substitute.For(); - commitsCollection.GetEnumerator().Returns(_ => ((IEnumerable)commits).GetEnumerator()); - commitsCollection.GetCommitsPriorTo(Arg.Any()).Returns(commits); - branch.Commits.Returns(commitsCollection); - return branch; - } - - public static IBranch? FindBranch(this IGitRepository repository, string branchName) => repository.Branches.FirstOrDefault(x => x.Name.WithoutRemote == branchName); - - public static void DumpGraph(this IGitRepository repository, Action? writer = null, int? maxCommits = null) => GitExtensions.DumpGraph(repository.Path, writer, maxCommits); - - public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null) => GitExtensions.DumpGraph(repository.ToGitRepository().Path, writer, maxCommits); - - public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? branch = null) - { - configuration ??= new ConfigurationBuilder().Build(); - - repository ??= fixture.Repository; - - var options = Options.Create(new GitVersionOptions - { - WorkingDirectory = repository.Info.WorkingDirectory, - ConfigInfo = { OverrideConfig = configuration }, - RepositoryInfo = - { - TargetBranch = branch, - CommitId = commitId - }, - Settings = { OnlyTrackedBranches = onlyTrackedBranches } - }); - - var sp = ConfigureServices(services => services.AddSingleton(options)); - - var variableProvider = sp.GetRequiredService(); - var nextVersionCalculator = sp.GetRequiredService(); - var contextOptions = sp.GetRequiredService>(); - - var context = contextOptions.Value; - - try - { - var nextVersion = nextVersionCalculator.FindVersion(); - var variables = variableProvider.GetVariablesFor(nextVersion.IncrementedVersion, nextVersion.Configuration, context.IsCurrentCommitTagged); - - return variables; - } - catch (Exception) - { - Console.WriteLine("Test failing, dumping repository graph"); - repository.DumpGraph(); - throw; - } - } - - public static void WriteVersionVariables(this RepositoryFixtureBase fixture, string versionFile) - { - var versionInfo = fixture.GetVersion(); - - using var stream = File.Open(versionFile, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite); - using var writer = new StreamWriter(stream); - writer.Write(versionInfo.ToString()); - } - - public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, Config? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) - { - configuration ??= new Config(); - configuration = new ConfigurationBuilder().Add(configuration).Build(); - Console.WriteLine("---------"); - - try - { - var variables = fixture.GetVersion(configuration, repository, commitId, onlyTrackedBranches, targetBranch); - variables.FullSemVer.ShouldBe(fullSemver); - } - catch (Exception) - { - (repository ?? fixture.Repository).DumpGraph(); - throw; - } - if (commitId == null) - { - fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3"); - } - } - - /// - /// Simulates running on build server - /// - public static void InitializeRepo(this RemoteRepositoryFixture fixture) - { - var gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = fixture.LocalRepositoryFixture.RepositoryPath - }; - var options = Options.Create(gitVersionOptions); - - var environment = new TestEnvironment(); - environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); - - var serviceProvider = ConfigureServices(services => - { - services.AddSingleton(options); - services.AddSingleton(environment); - }); - - var gitPreparer = serviceProvider.GetRequiredService(); - gitPreparer.Prepare(); - } - - private static IServiceProvider ConfigureServices(Action? servicesOverrides = null) - { - var services = new ServiceCollection() - .AddModule(new GitVersionCoreTestModule()); - - servicesOverrides?.Invoke(services); - return services.BuildServiceProvider(); - } -} diff --git a/src/GitVersion.Core.Tests/Extensions/GitVersionVariablesExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitVersionVariablesExtensions.cs new file mode 100644 index 0000000000..b47e24d0c8 --- /dev/null +++ b/src/GitVersion.Core.Tests/Extensions/GitVersionVariablesExtensions.cs @@ -0,0 +1,16 @@ +using System.IO.Abstractions; +using GitVersion.OutputVariables; + +namespace GitVersion.Core.Tests; + +public static class GitVersionVariablesExtensions +{ + public static string ToJson(this GitVersionVariables gitVersionVariables) + { + var serializer = new VersionVariableSerializer(new FileSystem()); + return serializer.ToJson(gitVersionVariables); + } + + public static GitVersionVariables ToGitVersionVariables(this string json) + => VersionVariableSerializer.FromJson(json); +} diff --git a/src/GitVersion.Core.Tests/Extensions/MockCollectionExtensions.cs b/src/GitVersion.Core.Tests/Extensions/MockCollectionExtensions.cs new file mode 100644 index 0000000000..81c3191326 --- /dev/null +++ b/src/GitVersion.Core.Tests/Extensions/MockCollectionExtensions.cs @@ -0,0 +1,19 @@ +namespace GitVersion.Core.Tests; + +public static class MockCollectionExtensions +{ + private static IEnumerator GetEnumerator(params T[] itemsToReturn) + { + foreach (var item in itemsToReturn) + { + yield return item; + } + } + + public static void MockCollectionReturn(this IEnumerable items, params T[] itemsToReturn) + { + var enumerator = items.GetEnumerator(); + enumerator.Returns(_ => GetEnumerator(itemsToReturn)); + enumerator.Dispose(); + } +} diff --git a/src/GitVersion.Core.Tests/Extensions/ShouldlyExtensions.cs b/src/GitVersion.Core.Tests/Extensions/ShouldlyExtensions.cs new file mode 100644 index 0000000000..bac7a4346e --- /dev/null +++ b/src/GitVersion.Core.Tests/Extensions/ShouldlyExtensions.cs @@ -0,0 +1,24 @@ +namespace GitVersion.Core.Tests.Extensions; + +public static class ShouldlyExtensions +{ + /// + /// Asserts that the action throws an exception of type TException + /// with the expected message. + /// + public static void ShouldThrowWithMessage(this Action action, string expectedMessage) where TException : Exception + { + var ex = Should.Throw(action); + ex.Message.ShouldBe(expectedMessage); + } + + /// + /// Asserts that the action throws an exception of type TException, + /// and allows further assertion on the exception instance. + /// + public static void ShouldThrow(this Action action, Action additionalAssertions) where TException : Exception + { + var ex = Should.Throw(action); + additionalAssertions(ex); + } +} diff --git a/src/GitVersion.Core.Tests/Extensions/StringFormatWithExtensionTests.cs b/src/GitVersion.Core.Tests/Extensions/StringFormatWithExtensionTests.cs index d73a1d0a9c..74f8dcbfc7 100644 --- a/src/GitVersion.Core.Tests/Extensions/StringFormatWithExtensionTests.cs +++ b/src/GitVersion.Core.Tests/Extensions/StringFormatWithExtensionTests.cs @@ -1,13 +1,13 @@ +using System.Globalization; using GitVersion.Core.Tests.Helpers; -using GitVersion.Helpers; -using NUnit.Framework; +using GitVersion.Formatting; namespace GitVersion.Core.Tests; [TestFixture] public class StringFormatWithExtensionTests { - private IEnvironment environment; + private TestEnvironment environment; [SetUp] public void Setup() => this.environment = new TestEnvironment(); @@ -18,7 +18,7 @@ public void FormatWithNoTokens() var propertyObject = new { }; const string expected = "Some String without tokens"; var actual = expected.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -28,7 +28,7 @@ public void FormatWithSingleSimpleToken() const string target = "{SomeProperty}"; const string expected = "SomeValue"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -38,7 +38,7 @@ public void FormatWithMultipleTokensAndVerbatimText() const string target = "{SomeProperty} some text {AnotherProperty}"; const string expected = "SomeValue some text Other Value"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -49,7 +49,7 @@ public void FormatWithEnvVarToken() const string target = "{env:GIT_VERSION_TEST_VAR}"; const string expected = "Env Var Value"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -60,7 +60,7 @@ public void FormatWithEnvVarTokenWithFallback() const string target = "{env:GIT_VERSION_TEST_VAR ?? fallback}"; const string expected = "Env Var Value"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -71,7 +71,7 @@ public void FormatWithUnsetEnvVarToken_WithFallback() const string target = "{env:GIT_VERSION_UNSET_TEST_VAR ?? fallback}"; const string expected = "fallback"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -92,7 +92,7 @@ public void FormatWithMultipleEnvVars() const string target = "{env:GIT_VERSION_TEST_VAR_1} and {env:GIT_VERSION_TEST_VAR_2}"; const string expected = "Val-1 and Val-2"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -103,7 +103,7 @@ public void FormatWithMultipleEnvChars() const string target = "{env:env:GIT_VERSION_TEST_VAR_1} and {env:DUMMY_VAR ?? fallback}"; const string expected = "{env:env:GIT_VERSION_TEST_VAR_1} and fallback"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -113,7 +113,7 @@ public void FormatWithMultipleFallbackChars() //Test the greediness of the regex in matching env: and ?? chars const string target = "{env:env:GIT_VERSION_TEST_VAR_1} and {env:DUMMY_VAR ??? fallback}"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(target, actual); + Assert.That(actual, Is.EqualTo(target)); } [Test] @@ -124,7 +124,7 @@ public void FormatWithSingleFallbackChar() //Test the sanity of the regex when there is a grammar mismatch const string target = "{en:DUMMY_ENV_VAR} and {env:DUMMY_ENV_VAR??fallback}"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(target, actual); + Assert.That(actual, Is.EqualTo(target)); } [Test] @@ -134,7 +134,7 @@ public void FormatWIthNullPropagationWithMultipleSpaces() const string target = "{SomeProperty} and {env:DUMMY_ENV_VAR ?? fallback}"; const string expected = "Some Value and fallback"; var actual = target.FormatWith(propertyObject, this.environment); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -245,4 +245,29 @@ public void FormatProperty_NullObject_WithFallback_QuotedAndEmpty() var actual = target.FormatWith(propertyObject, this.environment); Assert.That(actual, Is.EqualTo("")); } + + [Test] + public void FormatAssemblyInformationalVersionWithSemanticVersionCustomFormattedCommitsSinceVersionSource() + { + var semanticVersion = new SemanticVersion + { + Major = 1, + Minor = 2, + Patch = 3, + PreReleaseTag = new SemanticVersionPreReleaseTag(string.Empty, 9, true), + BuildMetaData = new SemanticVersionBuildMetaData("Branch.main") + { + Branch = "main", + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitsSinceVersionSource = 42, + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z", CultureInfo.InvariantCulture) + } + }; + const string target = "{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}"; + const string expected = "1.2.3-0042"; + var actual = target.FormatWith(semanticVersion, this.environment); + Assert.That(actual, Is.EqualTo(expected)); + } } diff --git a/src/GitVersion.Core.Tests/Formatting/DateFormatterTests.cs b/src/GitVersion.Core.Tests/Formatting/DateFormatterTests.cs new file mode 100644 index 0000000000..417c61d6b9 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/DateFormatterTests.cs @@ -0,0 +1,41 @@ +using System.Globalization; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public class DateFormatterTests +{ + [Test] + public void Priority_ShouldBe2() => new DateFormatter().Priority.ShouldBe(2); + + [Test] + public void TryFormat_NullValue_ReturnsFalse() + { + var sut = new DateFormatter(); + var result = sut.TryFormat(null, "yyyy-MM-dd", out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [TestCase("2021-01-01", "yyyy-MM-dd", "2021-01-01")] + [TestCase("2021-01-01T12:00:00Z", "yyyy-MM-ddTHH:mm:ssZ", "2021-01-01T12:00:00Z")] + public void TryFormat_ValidDateFormats_ReturnsExpectedResult(string input, string format, string expected) + { + // For UTC datetime strings, parse as UTC to ensure consistent behavior across timezones + DateTime date; + if (input.EndsWith("Z")) + { + date = DateTime.Parse(input, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal); + } + else + { + date = DateTime.Parse(input, CultureInfo.InvariantCulture); + } + + var sut = new DateFormatter(); + var result = sut.TryFormat(date, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe(expected); + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/EdgeCaseTests.cs b/src/GitVersion.Core.Tests/Formatting/EdgeCaseTests.cs new file mode 100644 index 0000000000..5d8e0e49b3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/EdgeCaseTests.cs @@ -0,0 +1,60 @@ +using GitVersion.Core.Tests.Extensions; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +public partial class InputSanitizerTests +{ + [TestFixture] + public class EdgeCaseTests : InputSanitizerTests + { + [TestCase(49)] + [TestCase(50)] + public void SanitizeFormat_WithBoundaryLengths_ReturnsInput(int length) + { + var input = new string('x', length); + new InputSanitizer().SanitizeFormat(input).ShouldBe(input); + } + + [TestCase(199)] + [TestCase(200)] + public void SanitizeEnvVarName_WithBoundaryLengths_ReturnsInput(int length) + { + var input = new string('A', length); + new InputSanitizer().SanitizeEnvVarName(input).ShouldBe(input); + } + + [TestCase(99)] + [TestCase(100)] + public void SanitizeMemberName_WithBoundaryLengths_ReturnsInput(int length) + { + var input = new string('A', length); + new InputSanitizer().SanitizeMemberName(input).ShouldBe(input); + } + + [Test] + public void SanitizeFormat_WithUnicode_ReturnsInput() + { + const string unicodeFormat = "测试format"; + new InputSanitizer().SanitizeFormat(unicodeFormat).ShouldBe(unicodeFormat); + } + + [Test] + public void SanitizeEnvVarName_WithUnicode_ThrowsArgumentException() + { + const string unicodeEnvVar = "测试_VAR"; + Action act = () => new InputSanitizer().SanitizeEnvVarName(unicodeEnvVar); + act.ShouldThrowWithMessage( + $"Environment variable name contains disallowed characters: '{unicodeEnvVar}'"); + } + + [Test] + public void SanitizeMemberName_WithUnicode_ThrowsArgumentException() + { + const string unicodeMember = "测试Member"; + Action act = () => new InputSanitizer().SanitizeMemberName(unicodeMember); + act.ShouldThrowWithMessage( + $"Member name contains disallowed characters: '{unicodeMember}'"); + } + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/FormattableFormatterTests.cs b/src/GitVersion.Core.Tests/Formatting/FormattableFormatterTests.cs new file mode 100644 index 0000000000..1404c18b20 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/FormattableFormatterTests.cs @@ -0,0 +1,54 @@ +using System.Globalization; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public class FormattableFormatterTests +{ + [Test] + public void Priority_ShouldBe2() => new FormattableFormatter().Priority.ShouldBe(2); + + [Test] + public void TryFormat_NullValue_ReturnsFalse() + { + var sut = new FormattableFormatter(); + var result = sut.TryFormat(null, "G", CultureInfo.InvariantCulture, out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [TestCase(123.456, "F2", "123.46")] + [TestCase(1234.456, "F2", "1234.46")] + [TestCase(123.456, "C", "¤123.46")] + [TestCase(123.456, "P", "12,345.60 %")] + [TestCase(1234567890, "N0", "1,234,567,890")] + public void TryFormat_ValidFormats_ReturnsExpectedResult(object input, string format, string expected) + { + var sut = new FormattableFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe(expected); + } + + [TestCase(1234567890, "Z", "Format 'Z' is not supported in FormattableFormatter")] + public void TryFormat_UnsupportedFormat_ReturnsFalse(object input, string format, string expected) + { + var sut = new FormattableFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBe(expected); + } + + [TestCase(0, "0000", "0000")] + [TestCase(1, "0000", "0001")] + [TestCase(0, "-0000;;''", "")] + [TestCase(1, "-0000;;''", "-0001")] + public void ZeroFormatting(int value, string format, string expected) + { + var sut = new FormattableFormatter(); + var result = sut.TryFormat(value, format, out var formatted); + result.ShouldBe(true); + formatted.ShouldBe(expected); + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/InputSanitizerTests.cs b/src/GitVersion.Core.Tests/Formatting/InputSanitizerTests.cs new file mode 100644 index 0000000000..73bf35dbe6 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/InputSanitizerTests.cs @@ -0,0 +1,82 @@ +using GitVersion.Core.Tests.Extensions; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public partial class InputSanitizerTests +{ + [TestFixture] + public class SanitizeFormatTests : InputSanitizerTests + { + [Test] + public void SanitizeFormat_WithValidFormat_ReturnsInput() + { + var sut = new InputSanitizer(); + const string validFormat = "yyyy-MM-dd"; + sut.SanitizeFormat(validFormat).ShouldBe(validFormat); + } + + [TestCase("")] + [TestCase(" ")] + [TestCase("\t")] + public void SanitizeFormat_WithEmptyOrWhitespace_ThrowsFormatException(string invalidFormat) + { + var sut = new InputSanitizer(); + Action act = () => sut.SanitizeFormat(invalidFormat); + act.ShouldThrowWithMessage("Format string cannot be empty."); + } + + [Test] + public void SanitizeFormat_WithTooLongFormat_ThrowsFormatException() + { + var sut = new InputSanitizer(); + var longFormat = new string('x', 51); + Action act = () => sut.SanitizeFormat(longFormat); + act.ShouldThrowWithMessage("Format string too long: 'xxxxxxxxxxxxxxxxxxxx...'"); + } + + [Test] + public void SanitizeFormat_WithMaxValidLength_ReturnsInput() + { + var sut = new InputSanitizer(); + var maxLengthFormat = new string('x', 50); + sut.SanitizeFormat(maxLengthFormat).ShouldBe(maxLengthFormat); + } + + [TestCase("\r", TestName = "SanitizeFormat_ControlChar_CR")] + [TestCase("\n", TestName = "SanitizeFormat_ControlChar_LF")] + [TestCase("\0", TestName = "SanitizeFormat_ControlChar_Null")] + [TestCase("\x01", TestName = "SanitizeFormat_ControlChar_0x01")] + [TestCase("\x1F", TestName = "SanitizeFormat_ControlChar_0x1F")] + public void SanitizeFormat_WithControlCharacters_ThrowsFormatException(string controlChar) + { + var sut = new InputSanitizer(); + var formatWithControl = $"valid{controlChar}format"; + Action act = () => sut.SanitizeFormat(formatWithControl); + act.ShouldThrowWithMessage("Format string contains invalid control characters"); + } + + [Test] + public void SanitizeFormat_WithTabCharacter_ReturnsInput() + { + var sut = new InputSanitizer(); + const string formatWithTab = "format\twith\ttab"; + sut.SanitizeFormat(formatWithTab).ShouldBe(formatWithTab); + } + + [TestCase("yyyy-MM-dd")] + [TestCase("HH:mm:ss")] + [TestCase("0.00")] + [TestCase("C2")] + [TestCase("X8")] + [TestCase("format with spaces")] + [TestCase("format-with-dashes")] + [TestCase("format_with_underscores")] + public void SanitizeFormat_WithValidFormats_ReturnsInput(string validFormat) + { + var sut = new InputSanitizer(); + sut.SanitizeFormat(validFormat).ShouldBe(validFormat); + } + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/NumericFormatterTests.cs b/src/GitVersion.Core.Tests/Formatting/NumericFormatterTests.cs new file mode 100644 index 0000000000..9b466ead53 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/NumericFormatterTests.cs @@ -0,0 +1,39 @@ +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public class NumericFormatterTests +{ + [Test] + public void Priority_ShouldBe1() => new NumericFormatter().Priority.ShouldBe(1); + + [Test] + public void TryFormat_NullValue_ReturnsFalse() + { + var sut = new NumericFormatter(); + var result = sut.TryFormat(null, "n", out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [TestCase("1234.5678", "n", "1,234.57")] + [TestCase("1234.5678", "f2", "1234.57")] + [TestCase("1234.5678", "f0", "1235")] + [TestCase("1234.5678", "g", "1234.5678")] + public void TryFormat_ValidFormats_ReturnsExpectedResult(string input, string format, string expected) + { + var sut = new NumericFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe(expected); + } + [Test] + public void TryFormat_UnsupportedFormat_ReturnsFalse() + { + var sut = new NumericFormatter(); + var result = sut.TryFormat(1234.5678, "z", out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/SanitizeEnvVarNameTests.cs b/src/GitVersion.Core.Tests/Formatting/SanitizeEnvVarNameTests.cs new file mode 100644 index 0000000000..53f77a0a26 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/SanitizeEnvVarNameTests.cs @@ -0,0 +1,67 @@ +using GitVersion.Core.Tests.Extensions; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +public partial class InputSanitizerTests +{ + [TestFixture] + public class SanitizeEnvVarNameTests : InputSanitizerTests + { + [Test] + public void SanitizeEnvVarName_WithValidName_ReturnsInput() + { + var sut = new InputSanitizer(); + const string validName = "VALID_ENV_VAR"; + sut.SanitizeEnvVarName(validName).ShouldBe(validName); + } + + [TestCase("")] + [TestCase(" ")] + [TestCase("\t")] + public void SanitizeEnvVarName_WithEmptyOrWhitespace_ThrowsArgumentException(string invalidName) + { + var sut = new InputSanitizer(); + Action act = () => sut.SanitizeEnvVarName(invalidName); + act.ShouldThrowWithMessage("Environment variable name cannot be null or empty."); + } + + [Test] + public void SanitizeEnvVarName_WithTooLongName_ThrowsArgumentException() + { + var sut = new InputSanitizer(); + var longName = new string('A', 201); + Action act = () => sut.SanitizeEnvVarName(longName); + act.ShouldThrowWithMessage("Environment variable name too long: 'AAAAAAAAAAAAAAAAAAAA...'"); + } + + [Test] + public void SanitizeEnvVarName_WithMaxValidLength_ReturnsInput() + { + var sut = new InputSanitizer(); + var maxLengthName = new string('A', 200); + sut.SanitizeEnvVarName(maxLengthName).ShouldBe(maxLengthName); + } + + [Test] + public void SanitizeEnvVarName_WithInvalidCharacters_ThrowsArgumentException() + { + var sut = new InputSanitizer(); + const string invalidName = "INVALID@NAME"; + Action act = () => sut.SanitizeEnvVarName(invalidName); + act.ShouldThrowWithMessage("Environment variable name contains disallowed characters: 'INVALID@NAME'"); + } + + [TestCase("PATH")] + [TestCase("HOME")] + [TestCase("USER_NAME")] + [TestCase("MY_VAR_123")] + [TestCase("_PRIVATE_VAR")] + [TestCase("VAR123")] + public void SanitizeEnvVarName_WithValidNames_ReturnsInput(string validName) + { + var sut = new InputSanitizer(); + sut.SanitizeEnvVarName(validName).ShouldBe(validName); + } + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/SanitizeMemberNameTests.cs b/src/GitVersion.Core.Tests/Formatting/SanitizeMemberNameTests.cs new file mode 100644 index 0000000000..7f7aa87c1f --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/SanitizeMemberNameTests.cs @@ -0,0 +1,78 @@ +using GitVersion.Core.Tests.Extensions; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +public partial class InputSanitizerTests +{ + [TestFixture] + public class SanitizeMemberNameTests : InputSanitizerTests + { + [Test] + public void SanitizeMemberName_WithValidName_ReturnsInput() + { + var sut = new InputSanitizer(); + const string validName = "ValidMemberName"; + sut.SanitizeMemberName(validName).ShouldBe(validName); + } + + [TestCase("")] + [TestCase(" ")] + [TestCase("\t")] + public void SanitizeMemberName_WithEmptyOrWhitespace_ThrowsArgumentException(string invalidName) + { + var sut = new InputSanitizer(); + Action act = () => sut.SanitizeMemberName(invalidName); + act.ShouldThrowWithMessage("Member name cannot be empty."); + } + + [Test] + public void SanitizeMemberName_WithTooLongName_ThrowsArgumentException() + { + var sut = new InputSanitizer(); + var longName = new string('A', 101); + Action act = () => sut.SanitizeMemberName(longName); + act.ShouldThrowWithMessage("Member name too long: 'AAAAAAAAAAAAAAAAAAAA...'"); + } + + [Test] + public void SanitizeMemberName_WithMaxValidLength_ReturnsInput() + { + var sut = new InputSanitizer(); + var maxLengthName = new string('A', 100); + sut.SanitizeMemberName(maxLengthName).ShouldBe(maxLengthName); + } + + [Test] + public void SanitizeMemberName_WithInvalidCharacters_ThrowsArgumentException() + { + var sut = new InputSanitizer(); + const string invalidName = "Invalid@Member"; + Action act = () => sut.SanitizeMemberName(invalidName); + act.ShouldThrowWithMessage("Member name contains disallowed characters: 'Invalid@Member'"); + } + + [TestCase("PropertyName")] + [TestCase("FieldName")] + [TestCase("Member123")] + [TestCase("_privateMember")] + [TestCase("CamelCaseName")] + [TestCase("PascalCaseName")] + [TestCase("member_with_underscores")] + public void SanitizeMemberName_WithValidNames_ReturnsInput(string validName) + { + var sut = new InputSanitizer(); + sut.SanitizeMemberName(validName).ShouldBe(validName); + } + + [TestCase("member.nested")] + [TestCase("Parent.Child.GrandChild")] + public void SanitizeMemberName_WithDottedNames_HandledByRegex(string dottedName) + { + var sut = new InputSanitizer(); + Action act = () => sut.SanitizeMemberName(dottedName); + + act.ShouldNotThrow(); + } + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/StringFormatterTests.cs b/src/GitVersion.Core.Tests/Formatting/StringFormatterTests.cs new file mode 100644 index 0000000000..b9f3c0a27d --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/StringFormatterTests.cs @@ -0,0 +1,76 @@ +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public class StringFormatterTests +{ + [Test] + public void Priority_ShouldBe2() => new StringFormatter().Priority.ShouldBe(2); + + [TestCase("u")] + [TestCase("")] + [TestCase(" ")] + [TestCase("invalid")] + public void TryFormat_NullValue_ReturnsFalse(string format) + { + var sut = new StringFormatter(); + var result = sut.TryFormat(null, format, out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [TestCase("hello", "u", "HELLO")] + [TestCase("HELLO", "l", "hello")] + [TestCase("hello world", "t", "Hello World")] + [TestCase("hELLO", "s", "Hello")] + [TestCase("hello world", "c", "HelloWorld")] + public void TryFormat_ValidFormats_ReturnsExpectedResult(string input, string format, string expected) + { + var sut = new StringFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe(expected); + } + + [TestCase("", "s")] + [TestCase("", "u")] + [TestCase("", "l")] + [TestCase("", "t")] + [TestCase("", "c")] + public void TryFormat_EmptyStringWithValidFormat_ReturnsEmpty(string input, string format) + { + var sut = new StringFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBeEmpty(); + } + + [TestCase("test", "")] + [TestCase("test", " ")] + [TestCase("test", "invalid")] + [TestCase("invalid", "")] + [TestCase("invalid", " ")] + [TestCase("invalid", "invalid")] + public void TryFormat_ValidStringWithInvalidFormat_ReturnsFalse(string input, string format) + { + var sut = new StringFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [TestCase("", "")] + [TestCase("", " ")] + [TestCase("", "invalid")] + [TestCase(" ", "")] + [TestCase(" ", " ")] + [TestCase(" ", "invalid")] + public void TryFormat_EmptyOrWhitespaceStringWithInvalidFormat_ReturnsTrue(string input, string format) + { + var sut = new StringFormatter(); + var result = sut.TryFormat(input, format, out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBeEmpty(); + } +} diff --git a/src/GitVersion.Core.Tests/Formatting/ValueFormatterTests.cs b/src/GitVersion.Core.Tests/Formatting/ValueFormatterTests.cs new file mode 100644 index 0000000000..9950cac172 --- /dev/null +++ b/src/GitVersion.Core.Tests/Formatting/ValueFormatterTests.cs @@ -0,0 +1,128 @@ +using System.Globalization; +using GitVersion.Formatting; + +namespace GitVersion.Tests.Formatting; + +[TestFixture] +public class ValueFormatterTests +{ + [Test] + public void TryFormat_NullValue_ReturnsFalse() + { + var result = ValueFormatter.Default.TryFormat(null, "any", out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [Test] + public void TryFormat_String_UsesStringFormatter() + { + var result = ValueFormatter.Default.TryFormat("hello", "u", out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe("HELLO"); + } + + [Test] + public void TryFormat_Number_UsesNumericFormatter() + { + var result = ValueFormatter.Default.TryFormat(1234.5678, "n", out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe("1,234.57"); + } + + [Test] + public void TryFormat_Date_UsesDateFormatter() + { + var date = new DateTime(2023, 12, 25, 0, 0, 0, DateTimeKind.Utc); + var result = ValueFormatter.Default.TryFormat(date, "yyyy-MM-dd", out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe("2023-12-25"); + } + + [Test] + public void TryFormat_FormattableObject_UsesFormattableFormatter() + { + const decimal value = 123.456m; + var result = ValueFormatter.Default.TryFormat(value, "C", out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe("¤123.46"); + } + + [Test] + public void TryFormat_InvalidFormat_ReturnsFalse() + { + var result = ValueFormatter.Default.TryFormat("test", "invalidformat", out var formatted); + result.ShouldBeFalse(); + formatted.ShouldBeEmpty(); + } + + [Test] + public void RegisterFormatter_AddsNewFormatter() + { + var customFormatter = new TestFormatter { Priority = 0 }; + IValueFormatterCombiner sut = new ValueFormatter(); + sut.RegisterFormatter(customFormatter); + var result = sut.TryFormat("test", "custom", out var formatted); + result.ShouldBeTrue(); + formatted.ShouldBe("CUSTOM:test"); + } + + [Test] + public void RemoveFormatter_RemovesExistingFormatter() + { + IValueFormatterCombiner sut = new ValueFormatter(); + // First verify numeric formatting works + sut.TryFormat(123.45, "n1", out var before); + before.ShouldBe("123.5"); + + sut.RemoveFormatter(); + + // Now numeric formatting will still happen, but via the FormattableFormatter + var result = sut.TryFormat(123.45, "n1", out var afterFormatted); + result.ShouldBeTrue(); + afterFormatted.ShouldBe("123.5"); + + sut.RemoveFormatter(); + + // Now numeric formatting will now not be handled by any formatter that remains + result = sut.TryFormat(123.45, "n1", out var afterNotFormatted); + result.ShouldBeFalse(); + afterNotFormatted.ShouldBeEmpty(); + } + + [Test] + public void Formatters_ExecuteInPriorityOrder() + { + IValueFormatterCombiner sut = new ValueFormatter(); + var highPriorityFormatter = new TestFormatter { Priority = 0 }; + var lowPriorityFormatter = new TestFormatter { Priority = 99 }; + + sut.RegisterFormatter(lowPriorityFormatter); + sut.RegisterFormatter(highPriorityFormatter); + var result = sut.TryFormat("test", "custom", out var formatted); + result.ShouldBeTrue(); + + // Should use the high priority formatter first + formatted.ShouldBe("CUSTOM:test"); + } + + private sealed class TestFormatter : IValueFormatter + { + public int Priority { get; init; } + + public bool TryFormat(object? value, string format, out string result) + { + if (format == "custom" && value is string str) + { + result = $"CUSTOM:{str}"; + return true; + } + + result = string.Empty; + return false; + } + + public bool TryFormat(object? value, string format, CultureInfo _, out string result) + => TryFormat(value, format, out result); + } +} diff --git a/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj b/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj index ee8b8148db..446ac51a69 100644 --- a/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj +++ b/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj @@ -1,28 +1,27 @@ - net48;netcoreapp3.1;net5.0;net6.0 - full false true - - true - - - - - - + + + + + + - + + + + diff --git a/src/GitVersion.Core.Tests/Helpers/AssemblyParallelizable.cs b/src/GitVersion.Core.Tests/Helpers/AssemblyParallelizable.cs index 9ae285d9ea..fdd365b7e2 100644 --- a/src/GitVersion.Core.Tests/Helpers/AssemblyParallelizable.cs +++ b/src/GitVersion.Core.Tests/Helpers/AssemblyParallelizable.cs @@ -1,3 +1 @@ -using NUnit.Framework; - [assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/src/GitVersion.Core.Tests/Helpers/DirectoryHelper.cs b/src/GitVersion.Core.Tests/Helpers/DirectoryHelper.cs deleted file mode 100644 index 4089986900..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/DirectoryHelper.cs +++ /dev/null @@ -1,79 +0,0 @@ -using GitVersion.Helpers; - -namespace GitVersion.Core.Tests.Helpers; - -public static class DirectoryHelper -{ - private static readonly Dictionary ToRename = new() - { - { "gitted", ".git" }, - { "gitmodules", ".gitmodules" } - }; - - public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target) - { - // From http://stackoverflow.com/questions/58744/best-way-to-copy-the-entire-contents-of-a-directory-in-c/58779#58779 - - foreach (var dir in source.GetDirectories()) - { - CopyFilesRecursively(dir, target.CreateSubdirectory(Rename(dir.Name))); - } - foreach (var file in source.GetFiles()) - { - file.CopyTo(PathHelper.Combine(target.FullName, Rename(file.Name))); - } - } - - private static string Rename(string name) => ToRename.ContainsKey(name) ? ToRename[name] : name; - - public static void DeleteSubDirectories(string parentPath) - { - var dirs = Directory.GetDirectories(parentPath); - foreach (var dir in dirs) - { - DeleteDirectory(dir); - } - } - - public static void DeleteDirectory(string directoryPath) - { - // From http://stackoverflow.com/questions/329355/cannot-delete-directory-with-directory-deletepath-true/329502#329502 - - if (!Directory.Exists(directoryPath)) - { - Trace.WriteLine( - $"Directory '{directoryPath}' is missing and can't be removed."); - - return; - } - - var files = Directory.GetFiles(directoryPath); - var dirs = Directory.GetDirectories(directoryPath); - - foreach (var file in files) - { - File.SetAttributes(file, FileAttributes.Normal); - File.Delete(file); - } - - foreach (var dir in dirs) - { - DeleteDirectory(dir); - } - - File.SetAttributes(directoryPath, FileAttributes.Normal); - try - { - Directory.Delete(directoryPath, false); - } - catch (IOException) - { - Trace.WriteLine(string.Format("{0}The directory '{1}' could not be deleted!" + - "{0}Most of the time, this is due to an external process accessing the files in the temporary repositories created during the test runs, and keeping a handle on the directory, thus preventing the deletion of those files." + - "{0}Known and common causes include:" + - "{0}- Windows Search Indexer (go to the Indexing Options, in the Windows Control Panel, and exclude the bin folder of LibGit2Sharp.Tests)" + - "{0}- Antivirus (exclude the bin folder of LibGit2Sharp.Tests from the paths scanned by your real-time antivirus){0}", - System.Environment.NewLine, Path.GetFullPath(directoryPath))); - } - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs b/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs deleted file mode 100644 index eae4da3a5e..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs +++ /dev/null @@ -1,23 +0,0 @@ -using GitVersion.Helpers; - -namespace GitVersion.Core.Tests.Helpers; - -public static class ExecutableHelper -{ - public static string GetCurrentDirectory() => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException(); - - public static string GetExecutable() => RuntimeHelper.IsCoreClr() ? "dotnet" : PathHelper.Combine(GetExeDirectory(), "gitversion.exe"); - - public static string GetExecutableArgs(string args) - { - if (RuntimeHelper.IsCoreClr()) - { - args = $"{PathHelper.Combine(GetExeDirectory(), "gitversion.dll")} {args}"; - } - return args; - } - - public static string GetTempPath() => PathHelper.Combine(GetCurrentDirectory(), "TestRepositories", Guid.NewGuid().ToString()); - - private static string GetExeDirectory() => GetCurrentDirectory().Replace("GitVersion.App.Tests", "GitVersion.App"); -} diff --git a/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs index b8558d13f9..250d382308 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitVersionContextBuilder.cs @@ -1,20 +1,18 @@ -using GitTools.Testing; -using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NSubstitute; namespace GitVersion.Core.Tests; -public class GitVersionContextBuilder +public class GitVersionContextBuilder : IDisposable { private IGitRepository? repository; - private Config? configuration; - public IServiceProvider? ServicesProvider; + private EmptyRepositoryFixture? emptyRepositoryFixture; + private IReadOnlyDictionary? overrideConfiguration; private Action? overrideServices; + public IServiceProvider? ServicesProvider; public GitVersionContextBuilder WithRepository(IGitRepository gitRepository) { @@ -22,9 +20,9 @@ public GitVersionContextBuilder WithRepository(IGitRepository gitRepository) return this; } - public GitVersionContextBuilder WithConfig(Config config) + public GitVersionContextBuilder WithOverrideConfiguration(IReadOnlyDictionary? value) { - this.configuration = config; + this.overrideConfiguration = value; return this; } @@ -44,14 +42,14 @@ private GitVersionContextBuilder WithBranch(string branchName) private GitVersionContextBuilder AddBranch(string branchName) { - var mockCommit = GitToolsTestingExtensions.CreateMockCommit(); - var mockBranch = GitToolsTestingExtensions.CreateMockBranch(branchName, mockCommit); + var mockCommit = GitRepositoryTestingExtensions.CreateMockCommit(); + var mockBranch = GitRepositoryTestingExtensions.CreateMockBranch(branchName, mockCommit); this.repository ??= CreateRepository(); var branches = this.repository.Branches.ToList(); branches.Add(mockBranch); - this.repository.Branches.GetEnumerator().Returns(_ => ((IEnumerable)branches).GetEnumerator()); + this.repository.Branches.MockCollectionReturn([.. branches]); this.repository.Head.Returns(mockBranch); return this; } @@ -60,15 +58,8 @@ public void Build() { var repo = this.repository ?? CreateRepository(); - var config = new ConfigurationBuilder() - .Add(this.configuration ?? new Config()) - .Build(); - - var options = Options.Create(new GitVersionOptions - { - WorkingDirectory = new EmptyRepositoryFixture().RepositoryPath, - ConfigInfo = { OverrideConfig = config } - }); + emptyRepositoryFixture = new(); + var options = Options.Create(new GitVersionOptions { WorkingDirectory = emptyRepositoryFixture.RepositoryPath, ConfigurationInfo = { OverrideConfiguration = this.overrideConfiguration } }); this.ServicesProvider = ConfigureServices(services => { @@ -80,10 +71,10 @@ public void Build() private static IGitRepository CreateRepository() { - var mockCommit = GitToolsTestingExtensions.CreateMockCommit(); - var mockBranch = GitToolsTestingExtensions.CreateMockBranch(TestBase.MainBranch, mockCommit); + var mockCommit = GitRepositoryTestingExtensions.CreateMockCommit(); + var mockBranch = GitRepositoryTestingExtensions.CreateMockBranch(TestBase.MainBranch, mockCommit); var branches = Substitute.For(); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] { mockBranch }).GetEnumerator()); + branches.MockCollectionReturn(mockBranch); var mockRepository = Substitute.For(); mockRepository.Branches.Returns(branches); @@ -93,7 +84,7 @@ private static IGitRepository CreateRepository() return mockRepository; } - private static IServiceProvider ConfigureServices(Action? overrideServices = null) + private static ServiceProvider ConfigureServices(Action? overrideServices = null) { var services = new ServiceCollection() .AddModule(new GitVersionCoreTestModule()); @@ -102,4 +93,21 @@ private static IServiceProvider ConfigureServices(Action? ov return services.BuildServiceProvider(); } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + + this.repository?.Dispose(); + this.emptyRepositoryFixture?.Dispose(); + } } diff --git a/src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs b/src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs index 5784f11a65..e46989145f 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs @@ -1,5 +1,9 @@ +using System.IO.Abstractions; +using GitVersion.Agents; +using GitVersion.Configuration; using GitVersion.Extensions; using GitVersion.Logging; +using GitVersion.Output; using Microsoft.Extensions.DependencyInjection; namespace GitVersion.Core.Tests.Helpers; @@ -9,9 +13,12 @@ public class GitVersionCoreTestModule : IGitVersionModule public void RegisterTypes(IServiceCollection services) { services.AddModule(new GitVersionLibGit2SharpModule()); + services.AddModule(new GitVersionBuildAgentsModule()); + services.AddModule(new GitVersionOutputModule()); + services.AddModule(new GitVersionConfigurationModule()); services.AddModule(new GitVersionCoreModule()); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); } diff --git a/src/GitVersion.Core.Tests/Helpers/ParticipantSanitizerTests.cs b/src/GitVersion.Core.Tests/Helpers/ParticipantSanitizerTests.cs new file mode 100644 index 0000000000..ad5f854bd3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Helpers/ParticipantSanitizerTests.cs @@ -0,0 +1,67 @@ +using GitVersion.Testing.Helpers; + +namespace GitVersion.Core.Tests.Helpers; + +[TestFixture] +public class ParticipantSanitizerTests +{ + [TestCase("feature/1234-is-id-with-something-kebab", "feature_1234_is_id_with_something_kebab")] + [TestCase("feature/1234-IsSomethingPascalCase", "feature_1234_IsSomethingPascalCase")] + [TestCase("feature/Caps-lower-something-kebab", "feature_Caps_lower_something_kebab")] + [TestCase("feature/Caps-lower-is-kebab", "feature_Caps_lower_is_kebab")] + [TestCase("kebab-folder/1234-is-id-with-something-kebab", "kebab_folder_1234_is_id_with_something_kebab")] + [TestCase("kebab-folder/1234-IsSomethingPascalCase", "kebab_folder_1234_IsSomethingPascalCase")] + [TestCase("kebab-folder/Caps-lower-something-kebab", "kebab_folder_Caps_lower_something_kebab")] + [TestCase("kebab-folder/Caps-lower-is-kebab", "kebab_folder_Caps_lower_is_kebab")] + [TestCase("PascalCaseFolder/1234-is-id-with-something-kebab", "PascalCaseFolder_1234_is_id_with_something_kebab")] + [TestCase("PascalCaseFolder/1234-IsSomethingPascalCase", "PascalCaseFolder_1234_IsSomethingPascalCase")] + [TestCase("PascalCaseFolder/Caps-lower-something-kebab", "PascalCaseFolder_Caps_lower_something_kebab")] + [TestCase("PascalCaseFolder/Caps-lower-is-kebab", "PascalCaseFolder_Caps_lower_is_kebab")] + [TestCase("1234-is-id-with-something-kebab", "1234_is_id_with_something_kebab")] + [TestCase("1234-IsSomethingPascalCase", "1234_IsSomethingPascalCase")] + [TestCase("Caps-lower-something-kebab", "Caps_lower_something_kebab")] + [TestCase("Caps-lower-is-kebab", "Caps_lower_is_kebab")] + [TestCase("feature/all-lower-is-kebab", "feature_all_lower_is_kebab")] + [TestCase("feature/24321-Upperjustoneword", "feature_24321_Upperjustoneword")] + [TestCase("feature/justoneword", "feature_justoneword")] + [TestCase("feature/PascalCase", "feature_PascalCase")] + [TestCase("feature/PascalCase-with-kebab", "feature_PascalCase_with_kebab")] + [TestCase("feature/12414", "feature_12414")] + [TestCase("feature/12414/12342-FeatureStoryTaskWithShortDescription", "feature_12414_12342_FeatureStoryTaskWithShortDescription")] + [TestCase("feature/12414/12342-Short-description", "feature_12414_12342_Short_description")] + [TestCase("feature/12414/12342-short-description", "feature_12414_12342_short_description")] + [TestCase("feature/12414/12342-Short-Description", "feature_12414_12342_Short_Description")] + [TestCase("release/1.0.0", "release_1_0_0")] + [TestCase("releases", "releases")] + [TestCase("feature", "feature")] + [TestCase("feature/tfs1-Short-description", "feature_tfs1_Short_description")] + [TestCase("feature/f2-Short-description", "feature_f2_Short_description")] + [TestCase("feature/bug1", "feature_bug1")] + [TestCase("f2", "f2")] + [TestCase("feature/f2", "feature_f2")] + [TestCase("feature/story2", "feature_story2")] + [TestCase("master", "master")] + [TestCase("develop", "develop")] + [TestCase("main", "main")] + public void SanitizeValidParticipant_ShouldReturnExpectedResult(string input, string expected) + { + var actual = ParticipantSanitizer.SanitizeParticipant(input); + actual.ShouldBe(expected); + } + + [TestCase("")] + [TestCase(" ")] + public void SanitizeEmptyOrWhitespaceParticipant_ShouldThrow(string value) + { + var exception = Should.Throw(() => ParticipantSanitizer.SanitizeParticipant(value)); + exception.Message.ShouldBe("The value cannot be an empty string or composed entirely of whitespace. (Parameter 'participant')"); + } + + [TestCase("feature/")] + [TestCase("/")] + public void SanitizeInvalidParticipant_ShouldThrow(string value) + { + var exception = Should.Throw(() => ParticipantSanitizer.SanitizeParticipant(value)); + exception.Message.ShouldBe("The value cannot end with a folder separator ('/'). (Parameter 'participant')"); + } +} diff --git a/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs b/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs deleted file mode 100644 index 315bf717d1..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace GitVersion.Core.Tests.Helpers; - -public static class RuntimeHelper -{ -#if !NETFRAMEWORK - private static bool? _isCoreClr; -#endif - - public static bool IsCoreClr() - { -#if !NETFRAMEWORK - _isCoreClr ??= System.Environment.Version.Major >= 5 - || System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET Core"); - return _isCoreClr.Value; -#else -#pragma warning disable IDE0022 // Use expression body for methods // Cannot be set because of the pragma section - return false; -#pragma warning restore IDE0022 // Use expression body for methods -#endif - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestBase.cs b/src/GitVersion.Core.Tests/Helpers/TestBase.cs index 4a9fd08050..cd25bd8a27 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestBase.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestBase.cs @@ -1,6 +1,5 @@ -using GitVersion.Configuration; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -8,9 +7,6 @@ namespace GitVersion.Core.Tests.Helpers; public class TestBase { - protected const string NoMonoDescription = "Won't run on Mono due to source information not being available for ShouldMatchApproved."; - protected const string NoMono = "NoMono"; - protected const string NoNet48 = "NoNet48"; public const string MainBranch = "main"; protected static IServiceProvider ConfigureServices(Action? overrideServices = null) @@ -23,14 +19,14 @@ protected static IServiceProvider ConfigureServices(Action? return services.BuildServiceProvider(); } - protected static IServiceProvider BuildServiceProvider(string workingDirectory, IGitRepository repository, string branch, Config? config = null) + protected static IServiceProvider BuildServiceProvider(IGitRepository repository, + string? targetBranch = null, IReadOnlyDictionary? configuration = null) { - config ??= new ConfigurationBuilder().Build(); var options = Options.Create(new GitVersionOptions { - WorkingDirectory = workingDirectory, - ConfigInfo = { OverrideConfig = config }, - RepositoryInfo = { TargetBranch = branch } + WorkingDirectory = repository.Path, + ConfigurationInfo = { OverrideConfiguration = configuration }, + RepositoryInfo = { TargetBranch = targetBranch } }); var sp = ConfigureServices(services => diff --git a/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilder.cs deleted file mode 100644 index 150d96a939..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilder.cs +++ /dev/null @@ -1,161 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Core.Tests.Helpers; - -public sealed class TestConfigurationBuilder -{ - public static TestConfigurationBuilder New => new(); - - private string? nextVerson; - private VersioningMode? versioningMode; - private readonly Dictionary versioningModeDictionary = new(); - private bool withoutAnyTrackMergeTargets; - private readonly Dictionary trackMergeTargetsDictionary = new(); - private readonly Dictionary preventIncrementOfMergedBranchVersionDictionary = new(); - private IncrementStrategy? increment; - private readonly Dictionary incrementDictionary = new(); - private readonly Dictionary tagDictionary = new(); - private IgnoreConfig? ignoreConfig; - - private TestConfigurationBuilder() - { - withoutAnyTrackMergeTargets = false; - increment = IncrementStrategy.Inherit; - versioningMode = VersioningMode.ContinuousDelivery; - } - - public TestConfigurationBuilder WithNextVersion(string? value) - { - nextVerson = value; - return this; - } - - public TestConfigurationBuilder WithVersioningMode(VersioningMode value) - { - versioningMode = value; - return this; - } - - public TestConfigurationBuilder WithoutVersioningMode() - { - versioningMode = null; - return this; - } - - public TestConfigurationBuilder WithVersioningMode(string branch, VersioningMode value) - { - versioningModeDictionary[branch] = value; - return this; - } - - public TestConfigurationBuilder WithoutVersioningMode(string branch) - { - versioningModeDictionary[branch] = null; - return this; - } - - public TestConfigurationBuilder WithTrackMergeTarget(string branch, bool value) - { - trackMergeTargetsDictionary[branch] = value; - return this; - } - - public TestConfigurationBuilder WithoutAnyTrackMergeTargets() - { - withoutAnyTrackMergeTargets = true; - trackMergeTargetsDictionary.Clear(); - return this; - } - - public TestConfigurationBuilder WithPreventIncrementOfMergedBranchVersion(string branch, bool value) - { - preventIncrementOfMergedBranchVersionDictionary[branch] = value; - return this; - } - - public TestConfigurationBuilder WithIncrement(IncrementStrategy? value) - { - increment = value; - return this; - } - - public TestConfigurationBuilder WithIncrement(string branch, IncrementStrategy value) - { - incrementDictionary[branch] = value; - return this; - } - - public TestConfigurationBuilder WithoutTag(string branch) - { - tagDictionary[branch] = null; - return this; - } - - public TestConfigurationBuilder WithTag(string branch, string value) - { - tagDictionary[branch] = value; - return this; - } - - public TestConfigurationBuilder WithIgnoreConfig(IgnoreConfig value) - { - ignoreConfig = value; - return this; - } - - public Config Build() - { - Config configuration = new() - { - NextVersion = nextVerson, - VersioningMode = versioningMode - }; - - if (ignoreConfig != null) - { - configuration.Ignore = ignoreConfig; - } - - ConfigurationBuilder configurationBuilder = new(); - configuration = configurationBuilder.Add(configuration).Build(); - - if (withoutAnyTrackMergeTargets) - { - foreach (var branchConfiguration in configuration.Branches.Values) - { - branchConfiguration.TrackMergeTarget = false; - } - } - - foreach (var item in trackMergeTargetsDictionary) - { - configuration.Branches[item.Key].TrackMergeTarget = item.Value; - } - - foreach (var item in versioningModeDictionary) - { - configuration.Branches[item.Key].VersioningMode = item.Value; - } - - foreach (var item in preventIncrementOfMergedBranchVersionDictionary) - { - configuration.Branches[item.Key].PreventIncrementOfMergedBranchVersion = item.Value; - } - - configuration.Increment = increment; - - foreach (var item in incrementDictionary) - { - configuration.Branches[item.Key].Increment = item.Value; - } - - foreach (var item in tagDictionary) - { - configuration.Branches[item.Key].Tag = item.Value; - } - - return configuration; - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestConsole.cs b/src/GitVersion.Core.Tests/Helpers/TestConsole.cs deleted file mode 100644 index a5ea2eb590..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestConsole.cs +++ /dev/null @@ -1,30 +0,0 @@ -using GitVersion.Logging; - -namespace GitVersion.Core.Tests.Helpers; - -public class TestConsole : IConsole -{ - private readonly Queue responses; - private readonly ILog log; - - public TestConsole(params string[] responses) - { - this.log = new NullLog(); - this.responses = new Queue(responses); - } - - public void WriteLine(string? msg) => this.log.Info(msg + System.Environment.NewLine); - - public void WriteLine() => this.log.Info(System.Environment.NewLine); - - public void Write(string? msg) => this.log.Info(msg ?? throw new ArgumentNullException(nameof(msg))); - - public string ReadLine() => this.responses.Dequeue(); - - public IDisposable UseColor(ConsoleColor consoleColor) => new NoOpDisposable(); - - private class NoOpDisposable : IDisposable - { - public void Dispose() { } - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs b/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs new file mode 100644 index 0000000000..3ae5935b28 --- /dev/null +++ b/src/GitVersion.Core.Tests/Helpers/TestConsoleAdapter.cs @@ -0,0 +1,17 @@ +using GitVersion.Helpers; +using GitVersion.Logging; + +namespace GitVersion.Core.Tests.Helpers; + +public class TestConsoleAdapter(StringBuilder sb) : IConsole +{ + public void WriteLine(string? msg) => sb.AppendLine(msg); + + public void Write(string? msg) => sb.Append(msg); + + public override string ToString() => sb.ToString(); + + public string ReadLine() => throw new NotImplementedException(); + + public IDisposable UseColor(ConsoleColor consoleColor) => Disposable.Empty; +} diff --git a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs deleted file mode 100644 index 298e63fc1c..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Core.Tests.Helpers; - -public class TestEffectiveConfiguration : EffectiveConfiguration -{ - public TestEffectiveConfiguration( - AssemblyVersioningScheme assemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - AssemblyFileVersioningScheme assemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - string? assemblyVersioningFormat = null, - string? assemblyFileVersioningFormat = null, - string? assemblyInformationalFormat = null, - VersioningMode versioningMode = VersioningMode.ContinuousDelivery, - string tagPrefix = Config.DefaultTagPrefix, - string tag = "", - string? nextVersion = null, - string branchPrefixToTrim = "", - bool preventIncrementOfMergedBranchVersion = false, - string? tagNumberPattern = null, - string continuousDeploymentFallbackTag = "ci", - bool trackMergeTarget = false, - string? majorMessage = null, - string? minorMessage = null, - string? patchMessage = null, - string? noBumpMessage = null, - CommitMessageIncrementMode commitMessageMode = CommitMessageIncrementMode.Enabled, - int legacySemVerPadding = 4, - int buildMetaDataPadding = 4, - int commitsSinceVersionSourcePadding = 4, - IEnumerable? versionFilters = null, - bool tracksReleaseBranches = false, - bool isRelease = false, - bool isMainline = false, - string commitDateFormat = "yyyy-MM-dd", - bool updateBuildNumber = false) : - base(assemblyVersioningScheme, - assemblyFileVersioningScheme, - assemblyInformationalFormat, - assemblyVersioningFormat, - assemblyFileVersioningFormat, - versioningMode, - tagPrefix, - tag, - nextVersion, - IncrementStrategy.Patch, - branchPrefixToTrim, - preventIncrementOfMergedBranchVersion, - tagNumberPattern, - continuousDeploymentFallbackTag, - trackMergeTarget, - majorMessage, - minorMessage, - patchMessage, - noBumpMessage, - commitMessageMode, - legacySemVerPadding, - buildMetaDataPadding, - commitsSinceVersionSourcePadding, - versionFilters ?? Enumerable.Empty(), - tracksReleaseBranches, - isRelease, - isMainline, - commitDateFormat, - updateBuildNumber, - 0, - 0) - { - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestEnvironment.cs b/src/GitVersion.Core.Tests/Helpers/TestEnvironment.cs index a4435ffdbe..99eb6b2090 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestEnvironment.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestEnvironment.cs @@ -2,11 +2,9 @@ namespace GitVersion.Core.Tests.Helpers; public class TestEnvironment : IEnvironment { - private readonly IDictionary map; + private readonly Dictionary map = []; - public TestEnvironment() => this.map = new Dictionary(); - - public string? GetEnvironmentVariable(string variableName) => this.map.TryGetValue(variableName, out var val) ? val : null; + public string? GetEnvironmentVariable(string variableName) => this.map.GetValueOrDefault(variableName); public void SetEnvironmentVariable(string variableName, string? value) => this.map[variableName] = value; } diff --git a/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs b/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs deleted file mode 100644 index 1148266487..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs +++ /dev/null @@ -1,110 +0,0 @@ -using GitVersion.Helpers; - -namespace GitVersion.Core.Tests.Helpers; - -public class TestFileSystem : IFileSystem -{ - private readonly Dictionary fileSystem = new(StringComparerUtils.OsDependentComparer); - - public void Copy(string from, string to, bool overwrite) - { - var fromPath = Path.GetFullPath(from); - var toPath = Path.GetFullPath(to); - if (this.fileSystem.ContainsKey(toPath)) - { - if (overwrite) - this.fileSystem.Remove(toPath); - else - throw new IOException("File already exists"); - } - - if (!this.fileSystem.TryGetValue(fromPath, out var source)) - throw new FileNotFoundException($"The source file '{fromPath}' was not found", from); - - this.fileSystem.Add(toPath, source); - } - - public void Move(string from, string to) - { - var fromPath = Path.GetFullPath(from); - Copy(from, to, false); - this.fileSystem.Remove(fromPath); - } - - public bool Exists(string file) - { - var path = Path.GetFullPath(file); - return this.fileSystem.ContainsKey(path); - } - - public void Delete(string path) - { - var fullPath = Path.GetFullPath(path); - this.fileSystem.Remove(fullPath); - } - - public string ReadAllText(string path) - { - var fullPath = Path.GetFullPath(path); - if (!this.fileSystem.TryGetValue(fullPath, out var content)) - throw new FileNotFoundException($"The file '{fullPath}' was not found", fullPath); - - var encoding = EncodingHelper.DetectEncoding(content) ?? Encoding.UTF8; - return encoding.GetString(content); - } - - public void WriteAllText(string? file, string fileContents) - { - var path = Path.GetFullPath(file ?? throw new ArgumentNullException(nameof(file))); - var encoding = this.fileSystem.ContainsKey(path) - ? EncodingHelper.DetectEncoding(this.fileSystem[path]) ?? Encoding.UTF8 - : Encoding.UTF8; - WriteAllText(path, fileContents, encoding); - } - - public void WriteAllText(string? file, string fileContents, Encoding encoding) - { - var path = Path.GetFullPath(file ?? throw new ArgumentNullException(nameof(file))); - this.fileSystem[path] = encoding.GetBytes(fileContents); - } - - public IEnumerable DirectoryEnumerateFiles(string? directory, string searchPattern, SearchOption searchOption) => throw new NotImplementedException(); - - public Stream OpenWrite(string path) => new TestStream(path, this); - - public Stream OpenRead(string path) - { - var fullPath = Path.GetFullPath(path); - if (!this.fileSystem.ContainsKey(fullPath)) - throw new FileNotFoundException("File not found.", fullPath); - - var content = this.fileSystem[fullPath]; - return new MemoryStream(content); - } - - public void CreateDirectory(string path) - { - var fullPath = Path.GetFullPath(path); - if (this.fileSystem.ContainsKey(fullPath)) - { - this.fileSystem[fullPath] = Array.Empty(); - } - else - { - this.fileSystem.Add(fullPath, Array.Empty()); - } - } - - public bool DirectoryExists(string path) - { - var fullPath = Path.GetFullPath(path); - return this.fileSystem.ContainsKey(fullPath); - } - - public long GetLastDirectoryWrite(string path) => 1; - - public bool PathsEqual(string? path, string? otherPath) => string.Equals( - Path.GetFullPath(path ?? throw new ArgumentNullException(nameof(path))).TrimEnd('\\').TrimEnd('/'), - Path.GetFullPath(otherPath ?? throw new ArgumentNullException(nameof(otherPath))).TrimEnd('\\').TrimEnd('/'), - StringComparerUtils.OsDependentComparison); -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestLogAppender.cs b/src/GitVersion.Core.Tests/Helpers/TestLogAppender.cs index 54483a0e8d..5bbd6cae9d 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestLogAppender.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestLogAppender.cs @@ -2,10 +2,7 @@ namespace GitVersion.Core.Tests.Helpers; -public class TestLogAppender : ILogAppender +public class TestLogAppender(Action logAction) : ILogAppender { - private readonly Action logAction; - - public TestLogAppender(Action logAction) => this.logAction = logAction; - public void WriteTo(LogLevel level, string message) => this.logAction(message); + public void WriteTo(LogLevel level, string message) => logAction(message); } diff --git a/src/GitVersion.Core.Tests/Helpers/TestStream.cs b/src/GitVersion.Core.Tests/Helpers/TestStream.cs deleted file mode 100644 index d69fda5321..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestStream.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace GitVersion.Core.Tests.Helpers; - -public class TestStream : Stream -{ - private readonly string path; - private readonly TestFileSystem testFileSystem; - private readonly MemoryStream underlying = new(); - - public TestStream(string path, TestFileSystem testFileSystem) - { - this.path = path; - this.testFileSystem = testFileSystem; - } - - protected override void Dispose(bool disposing) - { - Flush(); - base.Dispose(disposing); - } - - public override void Flush() - { - this.underlying.Position = 0; - var readToEnd = new StreamReader(this.underlying).ReadToEnd(); - this.testFileSystem.WriteAllText(this.path, readToEnd); - } - - public override long Seek(long offset, SeekOrigin origin) => this.underlying.Seek(offset, origin); - - public override void SetLength(long value) => this.underlying.SetLength(value); - - public override int Read(byte[] buffer, int offset, int count) => this.underlying.Read(buffer, offset, count); - - public override void Write(byte[] buffer, int offset, int count) => this.underlying.Write(buffer, offset, count); - - public override bool CanRead => this.underlying.CanRead; - public override bool CanSeek => this.underlying.CanSeek; - public override bool CanWrite => this.underlying.CanWrite; - public override long Length => this.underlying.Length; - - public override long Position - { - get => this.underlying.Position; - set => this.underlying.Position = value; - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs b/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs new file mode 100644 index 0000000000..5670ca86a3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs @@ -0,0 +1,29 @@ +using GitVersion.OutputVariables; + +namespace GitVersion.Core.Tests.Helpers; + +internal record TestableGitVersionVariables() : GitVersionVariables("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""); diff --git a/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs b/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs deleted file mode 100644 index c6cf98e02c..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs +++ /dev/null @@ -1,25 +0,0 @@ -using GitVersion.OutputVariables; - -namespace GitVersion.Core.Tests.Helpers; - -internal class TestableVersionVariables : VersionVariables -{ - public TestableVersionVariables( - string major = "", string minor = "", string patch = "", string buildMetaData = "", - string buildMetaDataPadded = "", string fullBuildMetaData = "", string branchName = "", - string escapedBranchName = "", string sha = "", string shortSha = "", string majorMinorPatch = "", - string semVer = "", string legacySemVer = "", string legacySemVerPadded = "", string fullSemVer = "", - string assemblySemVer = "", string assemblySemFileVer = "", string preReleaseTag = "", - string preReleaseTagWithDash = "", string preReleaseLabel = "", string preReleaseLabelWithDash = "", string preReleaseNumber = "", - string weightedPreReleaseNumber = "", string informationalVersion = "", string commitDate = "", - string nugetVersion = "", string nugetVersionV2 = "", string nugetPreReleaseTag = "", - string nugetPreReleaseTagV2 = "", string versionSourceSha = "", string commitsSinceVersionSource = "", - string commitsSinceVersionSourcePadded = "", string uncommittedChanges = "") : base( - major, minor, patch, buildMetaData, buildMetaDataPadded, fullBuildMetaData, branchName, escapedBranchName, - sha, shortSha, majorMinorPatch, semVer, legacySemVer, legacySemVerPadded, fullSemVer, - assemblySemVer, assemblySemFileVer, preReleaseTag, weightedPreReleaseNumber, preReleaseTagWithDash, - preReleaseLabel, preReleaseLabelWithDash, preReleaseNumber, informationalVersion, commitDate, nugetVersion, nugetVersionV2, - nugetPreReleaseTag, nugetPreReleaseTagV2, versionSourceSha, commitsSinceVersionSource, commitsSinceVersionSourcePadded, uncommittedChanges) - { - } -} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/AlignGitFlowWithMainlineVersionStrategy.cs b/src/GitVersion.Core.Tests/IntegrationTests/AlignGitFlowWithMainlineVersionStrategy.cs new file mode 100644 index 0000000000..5b7484c6b1 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/AlignGitFlowWithMainlineVersionStrategy.cs @@ -0,0 +1,11258 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class AlignGitFlowWithMainlineVersionStrategy +{ + private static GitFlowConfigurationBuilder configurationBuilder => GitFlowConfigurationBuilder.New; + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+4", configuration); + } + else + { + // ❔ expected: "2.0.0-2+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+1", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+4", configuration); + } + else + { + // ❔ expected: "2.0.1-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+1", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+4", configuration); + } + else + { + // ❔ expected: "2.1.0-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+4", configuration); + } + else + { + // ❔ expected: "0.0.0-2+4" + fixture.AssertFullSemver("0.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+4", configuration); + } + else + { + // ❔ expected: "0.0.0-2+4" + fixture.AssertFullSemver("0.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+4", configuration); + } + else + { + // ❔ expected: "0.0.2-2+4" + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+1", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+4", configuration); + } + else + { + // ❔ expected: "0.2.0-2+4" + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+1", configuration); + + fixture.ApplyTag("0.2.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+4", configuration); + } + else + { + // ❔ expected: "0.2.1-1+4" + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+1", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+4", configuration); + } + else + { + // ❔ expected: "2.0.0-2+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+1", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+4", configuration); + } + else + { + // ❔ expected: "2.0.1-foo.2+3" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+1", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+4", configuration); + } + else + { + // ❔ expected: "2.1.0-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+3", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+3", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + } + + fixture.MakeACommit("D"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + } + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+6", configuration); + } + else + { + // ❔ expected: "0.0.2-2+6" + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+3", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+6", configuration); + } + else + { + // ❔ expected: "0.2.0-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+3", configuration); + + fixture.ApplyTag("0.2.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+6", configuration); + } + else + { + // ❔ expected: "0.2.1-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+3", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+3", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+3", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.1-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+2", configuration); + } + else + { + // ❔ expected: "1.0.1-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.1.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+2", configuration); + } + else + { + // ❔ expected: "1.1.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+2", configuration); + } + else + { + // ❔ expected: "0.0.1-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.0.1-PullRequest2.2" + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+2", configuration); + } + else + { + // ❔ expected: "0.0.1-2+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.1.0-PullRequest2.2" + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.1.1-PullRequest2.2" + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+2", configuration); + } + else + { + // ❔ expected: "0.1.1-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.1-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+2", configuration); + } + else + { + // ❔ expected: "1.0.1-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.1.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+2", configuration); + } + else + { + // ❔ expected: "1.1.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementInheritOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("2.0.0"); + fixture.ApplyTag("2.0.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+4", configuration); + + fixture.ApplyTag("2.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.0.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+4", configuration); + + fixture.ApplyTag("2.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment none on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementNoneOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+4", configuration); + + fixture.ApplyTag("0.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ❔ expected: "0.0.0-3+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-4+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+4", configuration); + + fixture.ApplyTag("0.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ❔ expected: "0.0.0-3+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-4+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+4", configuration); + + fixture.ApplyTag("0.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+4", configuration); + + fixture.ApplyTag("0.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment patch on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementPatchOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+4", configuration); + + fixture.ApplyTag("0.0.3-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.4-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+4", configuration); + + fixture.ApplyTag("0.0.2-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+6", configuration); + } + else + { + // ❔ expected: "0.0.2-2+6" + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.2"); + fixture.ApplyTag("0.0.2"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+4", configuration); + + fixture.ApplyTag("0.0.3-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.4-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+4", configuration); + + fixture.ApplyTag("0.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementMinorOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+4", configuration); + + fixture.ApplyTag("0.3.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.3.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.4.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+4", configuration); + + fixture.ApplyTag("0.2.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+6", configuration); + } + else + { + // ❔ expected: "0.2.0-2+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.2.0"); + fixture.ApplyTag("0.2.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+4", configuration); + + fixture.ApplyTag("0.2.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+6", configuration); + } + else + { + // ❔ expected: "0.2.1-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.2.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+4", configuration); + + fixture.ApplyTag("0.3.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.3.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.4.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementMajorOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("2.0.0"); + fixture.ApplyTag("2.0.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+4", configuration); + + fixture.ApplyTag("2.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.0.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+4", configuration); + + fixture.ApplyTag("2.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+6", configuration); + } + else + { + // ❔ expected: "1.0.0-2+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("1.0.0"); + fixture.ApplyTag("1.0.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+3", configuration); + + fixture.ApplyTag("1.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+6", configuration); + } + else + { + // ❔ expected: "1.0.1-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.0.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+3", configuration); + + fixture.ApplyTag("1.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+6", configuration); + } + else + { + // ❔ expected: "1.1.0-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + [TestCase(false, "release/2.0.0")] + [TestCase(true, "release/2.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+6", configuration); + } + else + { + // ❔ expected: "0.0.0-2+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+6", configuration); + } + else + { + // ❔ expected: "0.0.0-2+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + [TestCase(true, "release/0.1.1")] + [TestCase(true, "release/0.2.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + } + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+6", configuration); + } + else + { + // ❔ expected: "0.0.1-2+6" + fixture.AssertFullSemver("0.0.2-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.1"); + fixture.ApplyTag("0.0.1"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + [TestCase(true, "release/0.1.1")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+6", configuration); + } + else + { + // ❔ not expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.1.0"); + fixture.ApplyTag("0.1.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+3", configuration); + + fixture.ApplyTag("0.1.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+6", configuration); + } + else + { + // ❔ not expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.1.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+6", configuration); + } + else + { + // ❔ expected: "1.0.0-2+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("1.0.0"); + fixture.ApplyTag("1.0.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+3", configuration); + + fixture.ApplyTag("1.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+6", configuration); + } + else + { + // ❔ expected: "1.0.1-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.0.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+3", configuration); + + fixture.ApplyTag("1.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+6", configuration); + } + else + { + // ❔ expected: "1.1.0-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + [TestCase(false, "release/2.0.0")] + [TestCase(true, "release/2.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/AlignGitHubFlowWithMainlineVersionStrategy.cs b/src/GitVersion.Core.Tests/IntegrationTests/AlignGitHubFlowWithMainlineVersionStrategy.cs new file mode 100644 index 0000000000..3a9aae8822 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/AlignGitHubFlowWithMainlineVersionStrategy.cs @@ -0,0 +1,11258 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class AlignGitHubFlowWithMainlineVersionStrategy +{ + private static GitHubFlowConfigurationBuilder configurationBuilder => GitHubFlowConfigurationBuilder.New; + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+4", configuration); + } + else + { + // ❔ expected: "2.0.0-2+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+1", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+4", configuration); + } + else + { + // ❔ expected: "2.0.1-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+1", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+4", configuration); + } + else + { + // ❔ expected: "2.1.0-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+4", configuration); + } + else + { + // ❔ expected: "0.0.0-2+4" + fixture.AssertFullSemver("0.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+4", configuration); + } + else + { + // ❔ expected: "0.0.0-2+4" + fixture.AssertFullSemver("0.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+4", configuration); + } + else + { + // ❔ expected: "0.0.2-2+4" + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+1", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+4", configuration); + } + else + { + // ❔ expected: "0.2.0-2+4" + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+1", configuration); + + fixture.ApplyTag("0.2.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+4", configuration); + } + else + { + // ❔ expected: "0.2.1-1+4" + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+1", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+4", configuration); + } + else + { + // ❔ expected: "2.0.0-2+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+1", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+4", configuration); + } + else + { + // ❔ expected: "2.0.1-foo.2+3" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+1", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+4", configuration); + } + else + { + // ❔ expected: "2.1.0-1+4" + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + } + + /// + /// GitHubFlow - Feature branch (Increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+1", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+4", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+3", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+3", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + } + + fixture.MakeACommit("D"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + } + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+6", configuration); + } + else + { + // ❔ expected: "0.0.2-2+6" + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+3", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+6", configuration); + } + else + { + // ❔ expected: "0.2.0-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.1+3", configuration); + + fixture.ApplyTag("0.2.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+6", configuration); + } + else + { + // ❔ expected: "0.2.1-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.1+3", configuration); + + fixture.ApplyTag("0.3.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.1+3", configuration); + + fixture.ApplyTag("2.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.1+3", configuration); + + fixture.ApplyTag("2.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeatureWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.1+3", configuration); + + fixture.ApplyTag("3.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.1-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+2", configuration); + } + else + { + // ❔ expected: "1.0.1-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.1.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+2", configuration); + } + else + { + // ❔ expected: "1.1.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment inherit on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementInheritOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment none on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+2", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+2", configuration); + } + else + { + // ❔ expected: "0.0.1-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment none on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementNoneOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.0.1-PullRequest2.2" + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+2", configuration); + } + else + { + // ❔ expected: "0.0.1-2+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementPatchOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.0.2-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.1.0-PullRequest2.2" + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+2", configuration); + } + else + { + // ❔ expected: "0.1.0-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "0.1.1-PullRequest2.2" + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+2", configuration); + } + else + { + // ❔ expected: "0.1.1-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment minor on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMinorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("0.2.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndInheritOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment major on main and none on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndNoneOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.None) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+2", configuration); + } + else + { + // ❔ expected: "1.0.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and patch on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndPatchOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.0.1-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+2", configuration); + } + else + { + // ❔ expected: "1.0.1-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and minor on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndMinorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.2", configuration); + } + else + { + // ❔ expected: "1.1.0-PullRequest2.2" + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + } + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+2", configuration); + } + else + { + // ❔ expected: "1.1.0-1+2" + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + } + + /// + /// GitHubFlow - Pull requests (increment major on main and major on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequestWithIncrementMajorOnMainAndMajorOnFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Major) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+2", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementInheritOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("2.0.0"); + fixture.ApplyTag("2.0.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+4", configuration); + + fixture.ApplyTag("2.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.0.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+4", configuration); + + fixture.ApplyTag("2.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment inherit on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementInheritOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment none on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementNoneOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+4", configuration); + + fixture.ApplyTag("0.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ❔ expected: "0.0.0-3+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-4+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+4", configuration); + + fixture.ApplyTag("0.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+6", configuration); + } + else + { + // ❔ expected: "0.0.0-3+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-4+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+4", configuration); + + fixture.ApplyTag("0.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+4", configuration); + + fixture.ApplyTag("0.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment none on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseBranchWithIncrementNoneOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + } + } + + /// + /// GitHubFlow - Release branch (Increment patch on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementPatchOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+4", configuration); + + fixture.ApplyTag("0.0.3-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.4-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+4", configuration); + + fixture.ApplyTag("0.0.2-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2+6", configuration); + } + else + { + // ❔ expected: "0.0.2-2+6" + fixture.AssertFullSemver("0.0.3-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.2"); + fixture.ApplyTag("0.0.2"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+4", configuration); + + fixture.ApplyTag("0.0.3-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.4-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+4", configuration); + + fixture.ApplyTag("0.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseBranchWithIncrementPatchOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementMinorOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+4", configuration); + + fixture.ApplyTag("0.3.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.3.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.4.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+4", configuration); + + fixture.ApplyTag("0.2.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-2+6", configuration); + } + else + { + // ❔ expected: "0.2.0-2+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.2.0"); + fixture.ApplyTag("0.2.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.1+4", configuration); + + fixture.ApplyTag("0.2.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.1-1+6", configuration); + } + else + { + // ❔ expected: "0.2.1-1+6" + fixture.AssertFullSemver("0.3.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.2.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.1+4", configuration); + + fixture.ApplyTag("0.3.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.3.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.4.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment minor on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseBranchWithIncrementMinorOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main) + /// + [TestCase(false, IncrementStrategy.Inherit)] + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseBranchWithIncrementMajorOnMain(bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo("release/3.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and inherit on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndInheritOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndNoneOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+6", configuration); + } + else + { + // ❔ expected: "2.0.0-2+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("2.0.0"); + fixture.ApplyTag("2.0.0"); + } + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and patch on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndPatchOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.1+4", configuration); + + fixture.ApplyTag("2.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+6", configuration); + } + else + { + // ❔ expected: "2.0.1-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.0.1"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and minor on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndMinorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.1+4", configuration); + + fixture.ApplyTag("2.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+6", configuration); + } + else + { + // ❔ expected: "2.1.0-1+6" + fixture.AssertFullSemver("3.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("2.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment major on main and major on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + public void EnsureReleaseBranchWithIncrementMajorOnMainAndMajorOnReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.1+4", configuration); + + fixture.ApplyTag("3.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("3.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("4.0.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+6", configuration); + } + else + { + // ❔ expected: "1.0.0-2+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("1.0.0"); + fixture.ApplyTag("1.0.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+3", configuration); + + fixture.ApplyTag("1.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+6", configuration); + } + else + { + // ❔ expected: "1.0.1-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.0.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+3", configuration); + + fixture.ApplyTag("1.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+6", configuration); + } + else + { + // ❔ expected: "1.1.0-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + [TestCase(false, "release/2.0.0")] + [TestCase(true, "release/2.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementInheritOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Inherit) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+6", configuration); + } + else + { + // ❔ expected: "0.0.0-2+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.1+3", configuration); + + fixture.ApplyTag("0.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-2+6", configuration); + } + else + { + // ❔ expected: "0.0.0-2+6" + fixture.AssertFullSemver("0.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.0"); + fixture.ApplyTag("0.0.0"); + } + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-3+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + } + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + [TestCase(true, "release/0.1.1")] + [TestCase(true, "release/0.2.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementNoneOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.None) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+1", configuration); + } + else + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + } + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.1+3", configuration); + + fixture.ApplyTag("0.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2+6", configuration); + } + else + { + // ❔ expected: "0.0.1-2+6" + fixture.AssertFullSemver("0.0.2-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.0.1"); + fixture.ApplyTag("0.0.1"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + [TestCase(true, "release/0.1.1")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementPatchOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Patch) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.1.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2+6", configuration); + } + else + { + // ❔ not expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("0.1.0"); + fixture.ApplyTag("0.1.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.1+3", configuration); + + fixture.ApplyTag("0.1.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1+6", configuration); + } + else + { + // ❔ not expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("0.1.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.1+3", configuration); + + fixture.ApplyTag("0.2.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.2.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("0.2.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.3.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMinorOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Minor) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+1", configuration); + } + + [TestCase(true, IncrementStrategy.Inherit)] + [TestCase(false, IncrementStrategy.None)] + [TestCase(true, IncrementStrategy.None)] + [TestCase(false, IncrementStrategy.Patch)] + [TestCase(true, IncrementStrategy.Patch)] + [TestCase(false, IncrementStrategy.Minor)] + [TestCase(true, IncrementStrategy.Minor)] + [TestCase(false, IncrementStrategy.Major)] + [TestCase(true, IncrementStrategy.Major)] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMain( + bool useMainline, IncrementStrategy incrementOnReleaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(incrementOnReleaseBranch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndInheritOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndNoneOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.None) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2+6", configuration); + } + else + { + // ❔ expected: "1.0.0-2+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) + { + fixture.Repository.Tags.Remove("1.0.0"); + fixture.ApplyTag("1.0.0"); + } + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndPatchOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.1+3", configuration); + + fixture.ApplyTag("1.0.1-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+6", configuration); + } + else + { + // ❔ expected: "1.0.1-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.0.1"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndMinorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+3", configuration); + + fixture.ApplyTag("1.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + if (useMainline) + { + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-1+6", configuration); + } + else + { + // ❔ expected: "1.1.0-1+6" + fixture.AssertFullSemver("2.0.0-1+6", configuration); + } + + if (!useMainline) fixture.ApplyTag("1.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(false, "release/0.1.0")] + [TestCase(true, "release/0.1.0")] + [TestCase(false, "release/0.1.1")] + [TestCase(true, "release/0.1.1")] + [TestCase(false, "release/0.2.0")] + [TestCase(true, "release/0.2.0")] + [TestCase(false, "release/1.0.0")] + [TestCase(true, "release/1.0.0")] + [TestCase(false, "release/1.0.1")] + [TestCase(true, "release/1.0.1")] + [TestCase(false, "release/1.0.2")] + [TestCase(true, "release/1.0.2")] + [TestCase(false, "release/1.1.0")] + [TestCase(true, "release/1.1.0")] + [TestCase(false, "release/1.1.1")] + [TestCase(true, "release/1.1.1")] + [TestCase(false, "release/2.0.0")] + [TestCase(true, "release/2.0.0")] + public void EnsureReleaseAndFeatureBranchWithIncrementMajorOnMainAndMajorOnReleaseBranch( + bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder + .WithIncrement(IncrementStrategy.Major) + .WithBranch("main", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("release", b => b + .WithIncrement(IncrementStrategy.Major) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1+6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("3.0.0-1+1", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/BranchWithoutCommitScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/BranchWithoutCommitScenarios.cs index b2fa760ada..9735e16114 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/BranchWithoutCommitScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/BranchWithoutCommitScenarios.cs @@ -1,7 +1,5 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -17,23 +15,23 @@ public void CanTakeVersionFromReleaseBranch() fixture.Repository.CreateBranch("release-4.0.123"); fixture.Checkout(commit.Sha); - fixture.AssertFullSemver("4.0.123-beta.1+0", null, fixture.Repository, commit.Sha, false, "release-4.0.123"); + fixture.AssertFullSemver("4.0.123-beta.1+1", null, fixture.Repository, commit.Sha, false, "release-4.0.123"); } - [Test] - public void BranchVersionHavePrecedenceOverTagVersionIfVersionGreaterThanTag() + [TestCase("0.1.0-alpha.1", "1.0.0-beta.1+2")] + [TestCase("1.0.0-alpha.1", "1.0.0-beta.1+2")] + [TestCase("1.0.1-alpha.1", "1.0.1-beta.1+2")] + public void BranchVersionHavePrecedenceOverTagVersionIfVersionGreaterThanTag(string tag, string expected) { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); - fixture.Repository.CreateBranch("develop"); - fixture.Checkout("develop"); - fixture.MakeATaggedCommit("0.1.0-alpha.1"); // simulate merge from feature branch + fixture.BranchTo("develop"); + fixture.MakeATaggedCommit(tag); // simulate merge from feature branch - fixture.Repository.CreateBranch("release/1.0"); - fixture.Checkout("release/1.0"); + fixture.BranchTo("release/1.0.0"); - fixture.AssertFullSemver("1.0.0-beta.1+0"); + fixture.AssertFullSemver(expected); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitFlow.cs b/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitFlow.cs new file mode 100644 index 0000000000..ec307dd2b8 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitFlow.cs @@ -0,0 +1,1277 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitFlow +{ + private static GitFlowConfigurationBuilder configurationBuilder => GitFlowConfigurationBuilder.New; + + /// + /// GitFlow - Feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeature(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-4", configuration); + } + + /// + /// GitFlow - Merge main to feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeature(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-6", configuration); + } + + /// + /// GitFlow - Pull requests (increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequest(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureReleaseAndFeatureBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseAndFeatureBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + /// + /// GitFlow - Release branch (Increment patch on main) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureReleaseBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + /// + /// GitFlow - Release branch (Increment patch on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + [TestCase(true, "release/0.1.0")] + public void EnsureReleaseBranch(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+4", configuration); + + fixture.ApplyTag("0.1.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureDevelopmentWithDevelopBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.ApplyTag("0.1.0-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.Checkout("develop"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.6", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("develop", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.6", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest3.7", configuration); + + fixture.Checkout("develop"); + fixture.Repository.Branches.Remove("pull/3/merge"); + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-7", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureDevelopmentWithDevelopBranchFast(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+1", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.Checkout("develop"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.4", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("develop", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.4", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest3.5", configuration); + + fixture.Checkout("develop"); + fixture.Repository.Branches.Remove("pull/3/merge"); + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-5", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureDevelopmentWithMainBranchFast(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+2", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.4", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-4", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureBugFixWithMainBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("hotfix/bar"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.ApplyTag("0.0.2-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+1", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+2", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("hotfix/bar"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.4", configuration); + + fixture.Checkout("hotfix/bar"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-4", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureBugFixWithDevelopBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.BranchTo("hotfix/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+2", configuration); + + fixture.ApplyTag("0.0.2-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+2", configuration); + + fixture.Checkout("develop"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("hotfix/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.5", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("hotfix/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest3.5", configuration); + + fixture.Checkout("hotfix/foo"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-5", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureBugFixWithDevelopBranchFast(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.BranchTo("hotfix/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.ApplyTag("0.0.2-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+1", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.2+2", configuration); + + fixture.Checkout("develop"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("hotfix/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.4", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("hotfix/foo"); + + // ❔ expected: "0.0.2-PullRequest3.4" + fixture.AssertFullSemver("0.1.0-PullRequest3.4", configuration); + + fixture.Checkout("hotfix/foo"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-4", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureDevelopmentWithReleaseNextBranch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.BranchTo("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.Checkout("develop"); + fixture.MakeACommit(); + fixture.Checkout("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+4", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.Checkout("release/next"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.7", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("release/next", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+7", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest3.8", configuration); + + fixture.Checkout("release/next"); + fixture.Repository.Branches.Remove("pull/3/merge"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-8", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureDevelopmentWithReleaseNextBranchFast(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.BranchTo("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.Checkout("develop"); + fixture.MakeACommit(); + fixture.Checkout("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+2", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.1+3", configuration); + + fixture.ApplyTag("0.1.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-foo.2+2", configuration); + + fixture.Checkout("release/next"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest2.6", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("release/next", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-beta.1+6", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("release/next"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-PullRequest3.7", configuration); + + fixture.Checkout("release/next"); + fixture.Repository.Branches.Remove("pull/3/merge"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-7", configuration); + + if (!useMainline) fixture.ApplyTag("0.1.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureFeatureDevelopmentWithRelease100Branch(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("develop"); + fixture.MakeACommit(); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+3", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.1+4", configuration); + + fixture.ApplyTag("1.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-foo.2+2", configuration); + + fixture.Checkout("release/1.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest2.7", configuration); + + fixture.Checkout("feature/foo"); + fixture.Repository.Branches.Remove("pull/2/merge"); + fixture.MergeTo("release/1.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+7", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/3/merge"); + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-PullRequest3.8", configuration); + + fixture.Checkout("release/1.0.0"); + fixture.Repository.Branches.Remove("pull/3/merge"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-8", configuration); + + if (!useMainline) fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitHubFlow.cs b/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitHubFlow.cs new file mode 100644 index 0000000000..4a66feb476 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitHubFlow.cs @@ -0,0 +1,494 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class CompareTheDifferentWhenUsingMainlineVersionStrategyWithGitHubFlow +{ + private static GitHubFlowConfigurationBuilder configurationBuilder => GitHubFlowConfigurationBuilder.New; + + /// + /// GitHubFlow - Feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureFeature1(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+0", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+1", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-4", configuration); + } + + /// + /// GitHubFlow - Merge main to feature branch (Increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureMergeMainToFeature2(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.1+3", configuration); + + fixture.ApplyTag("0.0.3-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+1", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-foo.2+2", configuration); + + fixture.MergeTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-6", configuration); + } + + /// + /// GitHubFlow - Pull requests (increment patch on main and inherit on feature) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsurePullRequest(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-2", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void EnsureReleaseAndFeatureBranch1(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + fixture.ApplyTag("2.0.0-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo("release/2.0.0", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseAndFeatureBranch2(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.BranchTo("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+1", configuration); + + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.1+3", configuration); + + fixture.ApplyTag("0.0.2-foo.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+0", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-foo.2+1", configuration); + + fixture.Checkout(releaseBranch); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-PullRequest2.5", configuration); + + fixture.Checkout("feature/foo"); + fixture.MergeTo(releaseBranch, removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+5", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main) + /// + [TestCase(false)] + [TestCase(true)] + public void EnsureReleaseBranch1(bool useMainline) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo("release/2.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-6", configuration); + + if (!useMainline) fixture.ApplyTag("2.0.0"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + /// + /// GitHubFlow - Release branch (Increment patch on main and none on release) + /// + [TestCase(false, "release/next")] + [TestCase(true, "release/next")] + [TestCase(false, "release/0.0.0")] + [TestCase(true, "release/0.0.0")] + [TestCase(false, "release/0.0.1")] + [TestCase(true, "release/0.0.1")] + [TestCase(false, "release/0.0.2")] + [TestCase(true, "release/0.0.2")] + public void EnsureReleaseBranch2(bool useMainline, string releaseBranch) + { + var builder = useMainline + ? configurationBuilder.WithVersionStrategy(VersionStrategies.Mainline) + : configurationBuilder; + var configuration = builder.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.1"); + fixture.BranchTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+0", configuration); + + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2-1", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.2"); + fixture.MergeTo(releaseBranch); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+2", configuration); + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+3", configuration); + + fixture.MakeACommit("E"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.1+4", configuration); + + fixture.ApplyTag("0.0.3-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+0", configuration); + + fixture.MakeACommit("F"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-beta.2+1", configuration); + + fixture.MergeTo("main", removeBranchAfterMerging: true); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3-6", configuration); + + if (!useMainline) fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("G"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.4-1", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs b/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs new file mode 100644 index 0000000000..f1d4833705 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/ComparingTheBehaviorOfDifferentVersioningModes.cs @@ -0,0 +1,398 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.IntegrationTests; + +/// +/// - For mode 1 the main-releases are especially not marked with dedicated tags. +/// - For mode 2, 3 and 4 the pre-releases and the main-releases are always marked with dedicated tags. +/// - Continuous deployment with is mainline false requires always a pre-release tag unless the commit is tagged +/// +[TestFixture] +internal class ComparingTheBehaviorOfDifferentDeploymentModes +{ + private static GitHubFlowConfigurationBuilder GetConfigurationBuilder() => GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", b => b + .WithIncrement(IncrementStrategy.Patch).WithLabel(null) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Inherit).WithLabel("{BranchName}") + ); + + private static readonly IGitVersionConfiguration continuousDeployment = GetConfigurationBuilder() + .WithDeploymentMode(DeploymentMode.ContinuousDeployment) + .WithBranch("main", b => b.WithIsMainBranch(true).WithDeploymentMode(DeploymentMode.ContinuousDeployment)) + .WithBranch("feature", b => b.WithIsMainBranch(false).WithDeploymentMode(DeploymentMode.ContinuousDeployment)) + .Build(); + + private static readonly IGitVersionConfiguration continuousDelivery = GetConfigurationBuilder() + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("main", b => b.WithIsMainBranch(true).WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("feature", b => b.WithIsMainBranch(false).WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + + private static readonly IGitVersionConfiguration manualDeployment = GetConfigurationBuilder() + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithBranch("main", b => b.WithIsMainBranch(true).WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b.WithIsMainBranch(false).WithDeploymentMode(DeploymentMode.ManualDeployment)) + .Build(); + + [Test] + public void ExpectedBehavior() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0", continuousDelivery); + fixture.AssertFullSemver("1.0.0", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-1", continuousDelivery); + fixture.AssertFullSemver("1.0.1-1+1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-2", continuousDelivery); + fixture.AssertFullSemver("1.0.1-1+2", manualDeployment); + + fixture.ApplyTag("1.0.1-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-alpha.1", continuousDelivery); + fixture.AssertFullSemver("1.0.1-alpha.1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-alpha.2", continuousDelivery); + fixture.AssertFullSemver("1.0.1-alpha.2+1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-alpha.3", continuousDelivery); + fixture.AssertFullSemver("1.0.1-alpha.2+2", manualDeployment); + + fixture.MakeATaggedCommit("1.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-beta.1", continuousDelivery); + fixture.AssertFullSemver("1.0.1-beta.1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-beta.2", continuousDelivery); + fixture.AssertFullSemver("1.0.1-beta.2+1", manualDeployment); + + fixture.MakeATaggedCommit("1.0.1-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-beta.2", continuousDelivery); + fixture.AssertFullSemver("1.0.1-beta.2", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1-beta.3", continuousDelivery); + fixture.AssertFullSemver("1.0.1-beta.3+1", manualDeployment); + + fixture.ApplyTag("1.0.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", continuousDeployment); + fixture.AssertFullSemver("1.0.1", continuousDelivery); + fixture.AssertFullSemver("1.0.1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.2", continuousDeployment); + fixture.AssertFullSemver("1.0.2-1", continuousDelivery); + fixture.AssertFullSemver("1.0.2-1+1", manualDeployment); + + fixture.ApplyTag("1.0.2-1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.2", continuousDeployment); + fixture.AssertFullSemver("1.0.2-1", continuousDelivery); + fixture.AssertFullSemver("1.0.2-1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.2", continuousDeployment); + fixture.AssertFullSemver("1.0.2-2", continuousDelivery); + fixture.AssertFullSemver("1.0.2-2+1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.2", continuousDeployment); + fixture.AssertFullSemver("1.0.2-3", continuousDelivery); + fixture.AssertFullSemver("1.0.2-2+2", manualDeployment); + } + + [Test] + public void MainRelease() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2", continuousDeployment); + fixture.AssertFullSemver("0.0.2", continuousDelivery); + fixture.AssertFullSemver("0.0.2", manualDeployment); + } + + [Test] + public void MergeFeatureToMain() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.BranchTo("feature/test"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-test.1", continuousDelivery); + fixture.AssertFullSemver("0.0.3-test.1+1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-test.2", continuousDelivery); + fixture.AssertFullSemver("0.0.3-test.1+2", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-3", continuousDelivery); + fixture.AssertFullSemver("0.0.3-1+3", manualDeployment); + } + + [Test] + public void MergeFeatureToMainWithPreviousCommits() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-1", continuousDelivery); + fixture.AssertFullSemver("0.0.3-1+1", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-2", continuousDelivery); + fixture.AssertFullSemver("0.0.3-1+2", manualDeployment); + + fixture.BranchTo("feature/test"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-test.3", continuousDelivery); + fixture.AssertFullSemver("0.0.3-test.1+3", manualDeployment); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-test.4", continuousDelivery); + fixture.AssertFullSemver("0.0.3-test.1+4", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", continuousDeployment); + fixture.AssertFullSemver("0.0.3-5", continuousDelivery); + fixture.AssertFullSemver("0.0.3-1+5", manualDeployment); + } + + [Test] + public void MergeFeatureToMainWithMinorMinorSemVersionIncrement() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.BranchTo("feature/test"); + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-test.1", continuousDelivery); + fixture.AssertFullSemver("0.1.0-test.1+1", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-test.2", continuousDelivery); + fixture.AssertFullSemver("0.1.0-test.1+2", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-3", continuousDelivery); + fixture.AssertFullSemver("0.1.0-1+3", manualDeployment); + } + + [Test] + public void MergeFeatureToMainWithMajorMinorSemVersionIncrement() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.BranchTo("feature/test"); + fixture.MakeACommit("+semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-test.1", continuousDelivery); + fixture.AssertFullSemver("1.0.0-test.1+1", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-test.2", continuousDelivery); + fixture.AssertFullSemver("1.0.0-test.1+2", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-3", continuousDelivery); + fixture.AssertFullSemver("1.0.0-1+3", manualDeployment); + } + + [Test] + public void MergeFeatureToMainWithPreviousCommitsAndMinorMinorSemVersionIncrement() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-1", continuousDelivery); + fixture.AssertFullSemver("0.1.0-1+1", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-2", continuousDelivery); + fixture.AssertFullSemver("0.1.0-1+2", manualDeployment); + + fixture.BranchTo("feature/test"); + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-test.3", continuousDelivery); + fixture.AssertFullSemver("0.1.0-test.1+3", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-test.4", continuousDelivery); + fixture.AssertFullSemver("0.1.0-test.1+4", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-5", continuousDelivery); + fixture.AssertFullSemver("0.1.0-1+5", manualDeployment); + } + + [Test] + public void MergeFeatureToMainWithPreviousCommitsAndMinorMajorSemVersionIncrement() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("0.0.2"); + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0", continuousDeployment); + fixture.AssertFullSemver("0.1.0-1", continuousDelivery); + fixture.AssertFullSemver("0.1.0-1+1", manualDeployment); + + fixture.MakeACommit("+semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-2", continuousDelivery); + fixture.AssertFullSemver("1.0.0-1+2", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-3", continuousDelivery); + fixture.AssertFullSemver("1.0.0-1+3", manualDeployment); + + fixture.BranchTo("feature/test"); + fixture.MakeACommit("+semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-test.4", continuousDelivery); + fixture.AssertFullSemver("1.0.0-test.1+4", manualDeployment); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-test.5", continuousDelivery); + fixture.AssertFullSemver("1.0.0-test.1+5", manualDeployment); + + fixture.Checkout("main"); + fixture.MergeNoFF("feature/test"); + fixture.Repository.Branches.Remove("feature/test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", continuousDeployment); + fixture.AssertFullSemver("1.0.0-6", continuousDelivery); + fixture.AssertFullSemver("1.0.0-1+6", manualDeployment); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/ContinuousDeliveryTestScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/ContinuousDeliveryTestScenarios.cs new file mode 100644 index 0000000000..fc3168c637 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/ContinuousDeliveryTestScenarios.cs @@ -0,0 +1,453 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class ContinuousDeliveryTestScenarios +{ + [Test] + public void ShouldUseTheFallbackVersionOnMainWhenNoVersionsAreAvailable() + { + // * 2373a87 58 minutes ago (HEAD -> main) + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("main", builder => builder + .WithLabel("ci") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + ) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.1", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldUseTheFallbackVersionOnDevelopWhenNoVersionsAreAvailable() + { + // * a831d61 58 minutes ago (HEAD -> develop) + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .Build(); + + using var fixture = new EmptyRepositoryFixture("develop"); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldUseConfiguredNextVersionOnMainWhenNoHigherVersionsAvailable() + { + // * 8c64db3 58 minutes ago (HEAD -> main) + + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.0.0") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("main", builder => builder + .WithLabel("ci") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + ) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-ci.1", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldNotMatterWhenConfiguredNextVersionIsEqualsToTheTaggedVersion() + { + // * 858f71b 58 minutes ago (HEAD -> main, tag: 1.0.0) + + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.0.0") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldUseTaggedVersionWhenGreaterThanConfiguredNextVersion() + { + // * ba74727 58 minutes ago (HEAD -> main, tag: 1.1.0) + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithNextVersion("1.0.0").Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.1.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldCalculateTheCorrectVersionWhenMergingFromMainToFeatureBranch() + { + // *94f03f8 55 minutes ago(HEAD -> main) + // |\ + // | *b1f41a4 56 minutes ago + // |/ + // *ec77f9c 58 minutes ago + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("main", builder => builder + .WithLabel("ci") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + ) + .WithBranch("feature", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.1", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-just-a-test.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-just-a-test.2", configuration); + + fixture.Checkout("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.1", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.3", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.3", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldCalculateTheCorrectVersionWhenMergingFromDevelopToFeatureBranch() + { + // *2c475bf 55 minutes ago(HEAD -> develop) + // |\ + // | *e05365d 56 minutes ago + // |/ + // *67acc03 58 minutes ago(main) + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("develop", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("feature", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-just-a-test.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-just-a-test.2", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.3", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.3", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldCalculateTheCorrectVersionWhenMergingFromReleaseToFeatureBranch() + { + // *b1e5593 53 minutes ago(HEAD -> release/ 1.0.0) + // *8752695 55 minutes ago + // |\ + // | *0965b88 56 minutes ago + // |/ + // *f63a536 58 minutes ago(main) + + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("release", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("feature", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.2", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.3", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.3", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldFallbackToTheVersionOnDevelopLikeTheReleaseWasNeverCreatedWhenReleaseHasBeenCanceled() + { + // *8f062c7 49 minutes ago(HEAD -> develop) + // |\ + // | *bda6ba8 52 minutes ago + // | *6f5cf19 54 minutes ago + // * | 3b20f15 50 minutes ago + // |/ + // *f5640b3 56 minutes ago + // *2099a07 58 minutes ago(main) + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder + .WithLabel("ci") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithTrackMergeTarget(false) + ) + .WithBranch("develop", builder => builder + .WithTrackMergeTarget(false) + ) + .WithBranch("release", builder => builder + .WithTrackMergeTarget(false) + ) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.1", configuration); + + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.4", configuration); + + // cancel the release 1.0.0 + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.6", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldConsiderTheMergeCommitFromMainToDevelopWhenReleaseHasBeenMergedAndTaggedOnMain() + { + // * 5d13120 48 minutes ago (HEAD -> develop) + // |\ + // | * 8ddd9b0 49 minutes ago (tag: 1.0.0, main) + // | |\ + // | | * 4b826b8 52 minutes ago + // | | * d4b0047 54 minutes ago + // * | | 0457671 50 minutes ago + // | |/ + // |/| + // * | 5f31f30 56 minutes ago + // |/ + // * 252971e 58 minutes ago + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder + .WithLabel("ci") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithTrackMergeTarget(false) + ) + .WithBranch("develop", builder => builder + .WithTrackMergeTarget(false) + ) + .WithBranch("release", builder => builder + .WithTrackMergeTarget(false) + ) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-ci.1", configuration); + + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-ci.5", configuration); + + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); + + fixture.Repository.DumpGraph(); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs b/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs new file mode 100644 index 0000000000..6d8a75983a --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/CreatingAFeatureBranchFromAReleaseBranchScenario.cs @@ -0,0 +1,908 @@ +using GitVersion.Configuration; + +namespace GitVersion.Core.Tests.IntegrationTests; + +/// +/// Version not generated correct when creating a feature branch from a release branch #3101 +/// +[TestFixture] +public class CreatingAFeatureBranchFromAReleaseBranchScenario +{ + [Test] + public void ShouldTreatTheFeatureBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromMainAndFirstReleaseBranchButNotFromTheSecondReleaseBranch() + { + // *f59b84f in the future(HEAD -> release/ 1.0.0) + // *d0f4669 in the future + // |\ + // | *471acec in the future + // |/ + // | *266fa68 in the future(release/ 1.1.0, main) + // |/ + // *e0b5034 6 seconds ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2", configuration); + + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+2", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheFeatureBranchNotLikeTheReleaseBranchWhenItHasBeenBranchedFromDevelopAndFirstReleaseBranchButNotFromTheSecondReleaseBranch() + { + // *19ed1e8 in the future(HEAD -> release/ 1.0.0) + // *1684169 in the future + // |\ + // | *07bd75c in the future + // |/ + // | *ff34213 in the future(release/ 1.1.0, develop) + // |/ + // *d5ac9aa in the future + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture("develop"); + + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + // 1.1.0 is correct because the base branch points to develop and release + // maybe we can fix it somehow using the configuration with PreReleaseWeight? + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-just-a-test.1+0", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+2", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheHotfixBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromMainAndFirstReleaseBranchButNotFromTheSecondReleaseBranch() + { + // *2b9c8bf 42 minutes ago(HEAD -> release/ 1.0.0) + // *66cfc66 44 minutes ago + // |\ + // | *e9978b9 45 minutes ago + // |/ + // | *c2b96e5 47 minutes ago(release/ 1.1.0, main|develop) + // |/ + // *e00f53d 49 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.BranchTo("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.Checkout("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.MergeNoFF("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.Repository.Branches.Remove("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheHotfixBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromDevelopAndFirstReleaseBranchButNotFromTheSecondReleaseBranch() + { + // *2b9c8bf 42 minutes ago(HEAD -> release/ 1.0.0) + // *66cfc66 44 minutes ago + // |\ + // | *e9978b9 45 minutes ago + // |/ + // | *c2b96e5 47 minutes ago(release/ 1.1.0, main|develop) + // |/ + // *e00f53d 49 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.BranchTo("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.Checkout("develop"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.Checkout("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MergeNoFF("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.Branches.Remove("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheFeatureBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromFirstButNotFromTheSecondReleaseBranchFromMain() + { + // * 3807c66 49 minutes ago (HEAD -> release/1.0.0) + // * da32145 51 minutes ago + // |\ + // | * 6a89f35 52 minutes ago + // |/ + // * 19f2980 56 minutes ago + // | * 2282a59 54 minutes ago (release/1.1.0, main) + // |/ + // * d7b7c5e 58 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("release/1.0.0"); + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+2", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.Checkout("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+3", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheFeatureBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromFirstButNotFromTheSecondReleaseBranchFromDevelop() + { + // *1525ad0 38 minutes ago(HEAD -> release/ 1.0.0) + // *476fc51 40 minutes ago + // |\ + // | *c8c5030 41 minutes ago + // |/ + // *d91061d 45 minutes ago + // | *1ac98f5 43 minutes ago(release/ 1.1.0, develop) + // |/ + // *22596b8 47 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("develop"); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("release/1.0.0"); + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+3", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.Checkout("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+4", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+6", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheHotfixBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromFirstButNotFromTheSecondReleaseBranchOnMain() + { + // *1525ad0 38 minutes ago(HEAD -> release/ 1.0.0) + // *476fc51 40 minutes ago + // |\ + // | *c8c5030 41 minutes ago + // |/ + // *d91061d 45 minutes ago + // | *1ac98f5 43 minutes ago(release/ 1.1.0, develop) + // |/ + // *22596b8 47 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("release/1.0.0"); + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.BranchTo("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.Checkout("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MergeNoFF("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.Branches.Remove("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheHotfixBranchLikeTheFirstReleaseBranchWhenItHasBeenBranchedFromFirstButNotFromTheSecondReleaseBranchOnDevelop() + { + // *1525ad0 38 minutes ago(HEAD -> release/ 1.0.0) + // *476fc51 40 minutes ago + // |\ + // | *c8c5030 41 minutes ago + // |/ + // *d91061d 45 minutes ago + // | *1ac98f5 43 minutes ago(release/ 1.1.0, develop) + // |/ + // *22596b8 47 minutes ago + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("develop"); + fixture.Repository.MakeACommit(); + + fixture.BranchTo("release/1.0.0"); + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.BranchTo("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.Checkout("develop"); + fixture.MakeACommit(); + fixture.BranchTo("release/1.1.0"); + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.Checkout("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+4", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MergeNoFF("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.Branches.Remove("hotfix/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+6", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheFeatureBranchLikeTheReleaseBranchWhenItHasBeenBranchedFromRelease() + { + // *588f0de in the future(HEAD -> release/ 1.0.0) + // *56f660c in the future + // |\ + // | *9450fb0 in the future + // |/ + // *9e557cd in the future + // *2e022d7 in the future(main) + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.Repository.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.BranchTo("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-just-a-test.1+3", configuration); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MergeNoFF("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Repository.Branches.Remove("feature/just-a-test"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+5", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldTreatTheMergeFromReleaseToDevelopLikeTheReleaseBranchHasNeverBeenExistingWhenReleaseHasBeenCanceled() + { + // *809eaa7 in the future(HEAD -> develop) + // *46e2cb8 in the future + // |\ + // | *08bd8ff in the future + // | *9b741de in the future + // * | 13206fd in the future + // |/ + // *9dc9b22 in the future + // *f708abd in the future(main) + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.4", configuration); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.6", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.7", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldOnlyTrackTheCommitsOnDevelopBranchForNextReleaseWhenReleaseHasBeenShippedToProduction() + { + // *9afb0ca in the future(HEAD -> develop) + // |\ + // | *90c96f2 in the future(tag: 1.0.0, main) + // | |\ + // | | *7de3d63 in the future + // | | *2ccf33b in the future + // * | | e050757 in the future + // | |/ + // |/| + // * | cf1ff87 in the future + // |/ + // *838a95b in the future + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-5", configuration); + + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void ShouldNotConsiderTheMergeCommitFromReleaseToMainWhenCommitHasNotBeenTagged() + { + // *457e0cd in the future(HEAD -> develop) + // |\ + // | *d9da657 in the future(tag: 1.0.0, main) + // | |\ + // | | *026a6cd in the future + // | | *7f5de6e in the future + // * | | 3db6e6f in the future + // | |/ + // |/| + // * | 845926e in the future + // |/ + // *42db9ba in the future + + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.BranchTo("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configuration); + + fixture.BranchTo("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+4", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-5", configuration); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-5", configuration); + + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); + + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); + + fixture.Repository.DumpGraph(); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs index bd9f36b2a4..7b3908a2dc 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs @@ -1,9 +1,7 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -46,33 +44,25 @@ public void WhenDevelopHasMultipleCommitsSpecifyNonExistingCommitId() public void WhenDevelopBranchedFromTaggedCommitOnMainVersionDoesNotChange() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - fixture.AssertFullSemver("1.0.0"); + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + fixture.AssertFullSemver("1.1.0-alpha.0"); } [Test] public void CanChangeDevelopTagViaConfig() { - var config = new Config - { - Branches = - { - { - "develop", - new BranchConfig - { - Tag = "alpha", - SourceBranches = new HashSet() - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", builder => builder + .WithLabel("alpha").WithSourceBranches() + ) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("1.1.0-alpha.1", config); + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); } [Test] @@ -108,22 +98,22 @@ public void MergingReleaseBranchBackIntoDevelopWithMergingToMainDoesBumpDevelopV fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); Commands.Checkout(fixture.Repository, "develop"); - fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); + fixture.MergeNoFF("release-2.0.0"); fixture.AssertFullSemver("2.1.0-alpha.2"); } [Test] public void CanHandleContinuousDelivery() { - var config = new Config - { - Branches = { { "develop", new BranchConfig { VersioningMode = VersioningMode.ContinuousDelivery } } } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - fixture.Repository.MakeATaggedCommit("1.1.0-alpha7"); - fixture.AssertFullSemver("1.1.0-alpha.7", config); + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + fixture.MakeATaggedCommit("1.1.0-alpha7"); + fixture.AssertFullSemver("1.1.0-alpha.7", configuration); } [Test] @@ -140,7 +130,7 @@ public void WhenDevelopBranchedFromMainDetachedHeadMinorIsIncreased() } [Test] - public void InheritVersionFromReleaseBranch() + public void InheritVersionFromParentReleaseBranch() { using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.0.0"); @@ -150,7 +140,7 @@ public void InheritVersionFromReleaseBranch() fixture.MakeACommit(); fixture.MakeACommit(); fixture.Checkout("develop"); - fixture.AssertFullSemver("1.1.0-alpha.1"); + fixture.AssertFullSemver("2.1.0-alpha.0"); fixture.MakeACommit(); fixture.AssertFullSemver("2.1.0-alpha.1"); fixture.MergeNoFF("release/2.0.0"); @@ -160,6 +150,30 @@ public void InheritVersionFromReleaseBranch() fixture.AssertFullSemver("2.1.0-MyFeature.1+5"); } + [Test] + public void InheritVersionFromParentReleaseBranchWithVersion2InsteadOfVersion3() + { + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + fixture.Repository.CreateBranch("release/3.0.0"); + fixture.MakeACommit(); + fixture.BranchTo("release/2.0.0"); + fixture.MakeACommit(); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-beta.1+3"); + fixture.Checkout("develop"); + fixture.AssertFullSemver("3.1.0-alpha.1"); + fixture.MakeACommit(); + fixture.AssertFullSemver("3.1.0-alpha.2"); + fixture.MergeNoFF("release/2.0.0"); + fixture.AssertFullSemver("3.1.0-alpha.5"); + fixture.Checkout("release/2.0.0"); + fixture.BranchTo("feature/MyFeature"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-MyFeature.1+4"); + } + [Test] public void WhenMultipleDevelopBranchesExistAndCurrentBranchHasIncrementInheritPolicyAndCurrentCommitIsAMerge() { @@ -189,7 +203,7 @@ public void TagOnHotfixShouldNotAffectDevelop() fixture.Repository.MakeACommit(); fixture.AssertFullSemver("1.2.1-beta.1+1"); fixture.Repository.ApplyTag("1.2.1-beta.1"); - fixture.AssertFullSemver("1.2.1-beta.1"); + fixture.AssertFullSemver("1.2.1-beta.2+0"); Commands.Checkout(fixture.Repository, "develop"); fixture.Repository.MakeACommit(); fixture.AssertFullSemver("1.3.0-alpha.2"); @@ -198,10 +212,11 @@ public void TagOnHotfixShouldNotAffectDevelop() [Test] public void CommitsSinceVersionSourceShouldNotGoDownUponGitFlowReleaseFinish() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("develop", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("release", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -210,7 +225,7 @@ public void CommitsSinceVersionSourceShouldNotGoDownUponGitFlowReleaseFinish() fixture.MakeACommit("commit in develop - 1"); fixture.AssertFullSemver("1.2.0-alpha.1"); fixture.BranchTo("release/1.2.0"); - fixture.AssertFullSemver("1.2.0-beta.1+0"); + fixture.AssertFullSemver("1.2.0-beta.1+1"); fixture.Checkout("develop"); fixture.MakeACommit("commit in develop - 2"); fixture.MakeACommit("commit in develop - 3"); @@ -221,28 +236,29 @@ public void CommitsSinceVersionSourceShouldNotGoDownUponGitFlowReleaseFinish() fixture.MakeACommit("commit in release/1.2.0 - 1"); fixture.MakeACommit("commit in release/1.2.0 - 2"); fixture.MakeACommit("commit in release/1.2.0 - 3"); - fixture.AssertFullSemver("1.2.0-beta.1+3"); + fixture.AssertFullSemver("1.2.0-beta.1+4"); fixture.Checkout(MainBranch); fixture.MergeNoFF("release/1.2.0"); fixture.ApplyTag("1.2.0"); fixture.Checkout("develop"); fixture.MergeNoFF("release/1.2.0"); fixture.MakeACommit("commit in develop - 6"); - fixture.AssertFullSemver("1.3.0-alpha.9"); + fixture.AssertFullSemver("1.3.0-alpha.6"); fixture.SequenceDiagram.Destroy("release/1.2.0"); fixture.Repository.Branches.Remove("release/1.2.0"); - const string expectedFullSemVer = "1.3.0-alpha.9"; - fixture.AssertFullSemver(expectedFullSemVer, config); + const string expectedFullSemVer = "1.3.0-alpha.6"; + fixture.AssertFullSemver(expectedFullSemVer, configuration); } [Test] public void CommitsSinceVersionSourceShouldNotGoDownUponMergingFeatureOnlyToDevelop() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("develop", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("release", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit($"commit in {MainBranch} - 1"); @@ -254,18 +270,18 @@ public void CommitsSinceVersionSourceShouldNotGoDownUponMergingFeatureOnlyToDeve fixture.MakeACommit("commit in release - 1"); fixture.MakeACommit("commit in release - 2"); fixture.MakeACommit("commit in release - 3"); - fixture.AssertFullSemver("1.2.0-beta.1+3"); + fixture.AssertFullSemver("1.2.0-beta.1+4"); fixture.ApplyTag("1.2.0"); fixture.Checkout("develop"); fixture.MakeACommit("commit in develop - 2"); fixture.AssertFullSemver("1.3.0-alpha.1"); fixture.MergeNoFF("release/1.2.0"); - fixture.AssertFullSemver("1.3.0-alpha.5"); + fixture.AssertFullSemver("1.3.0-alpha.2"); fixture.SequenceDiagram.Destroy("release/1.2.0"); fixture.Repository.Branches.Remove("release/1.2.0"); - const string expectedFullSemVer = "1.3.0-alpha.5"; - fixture.AssertFullSemver(expectedFullSemVer, config); + const string expectedFullSemVer = "1.3.0-alpha.2"; + fixture.AssertFullSemver(expectedFullSemVer, configuration); } [Test] @@ -287,14 +303,14 @@ public void PreviousPreReleaseTagShouldBeRespectedWhenCountingCommits() [Test] public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommitsSinceVersionSourceShouldNotGoDownWhenMergingReleaseToDevelop() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment, - Branches = new Dictionary - { - { "develop", new BranchConfig { PreventIncrementOfMergedBranchVersion = false } } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("develop", builder => builder + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithPreventIncrementOfMergedBranch(false) + ) + .WithBranch("release", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); using var fixture = new EmptyRepositoryFixture(); const string ReleaseBranch = "release/1.1.0"; @@ -317,37 +333,71 @@ public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommi fixture.MergeNoFF(ReleaseBranch); // Version numbers will still be correct when the release branch is around. - fixture.AssertFullSemver("1.2.0-alpha.6"); - fixture.AssertFullSemver("1.2.0-alpha.6", config); + fixture.AssertFullSemver("1.2.0-alpha.3"); + fixture.AssertFullSemver("1.2.0-alpha.3", configuration); - var versionSourceBeforeReleaseBranchIsRemoved = fixture.GetVersion(config).Sha; + var versionSourceBeforeReleaseBranchIsRemoved = fixture.GetVersion(configuration).Sha; fixture.Repository.Branches.Remove(ReleaseBranch); - var versionSourceAfterReleaseBranchIsRemoved = fixture.GetVersion(config).Sha; - Assert.AreEqual(versionSourceBeforeReleaseBranchIsRemoved, versionSourceAfterReleaseBranchIsRemoved); - fixture.AssertFullSemver("1.2.0-alpha.6"); - fixture.AssertFullSemver("1.2.0-alpha.6", config); - - config.Branches = new Dictionary - { - { "develop", new BranchConfig { PreventIncrementOfMergedBranchVersion = true } } - }; - fixture.AssertFullSemver("1.2.0-alpha.3", config); + var versionSourceAfterReleaseBranchIsRemoved = fixture.GetVersion(configuration).Sha; + Assert.That(versionSourceAfterReleaseBranchIsRemoved, Is.EqualTo(versionSourceBeforeReleaseBranchIsRemoved)); + fixture.AssertFullSemver("1.2.0-alpha.3"); + fixture.AssertFullSemver("1.2.0-alpha.3", configuration); } [Test] - public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommitsSinceVersionSourceShouldNotGoDownWhenMergingHotfixToDevelop() + public void WhenPreventIncrementOfMergedBranchVersionIsSetToTrueForDevelopCommitsSinceVersionSourceShouldNotGoDownWhenMergingReleaseToDevelop() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment, - Branches = new Dictionary - { - { "develop", new BranchConfig { PreventIncrementOfMergedBranchVersion = false } }, - { "hotfix", new BranchConfig { PreventIncrementOfMergedBranchVersion = true, Regex = "^(origin/)?hotfix[/-]" } } + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("develop", builder => builder.WithPreventIncrementOfMergedBranch(true)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + const string ReleaseBranch = "release/1.1.0"; + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.MakeATaggedCommit("1.0.0"); + fixture.Repository.MakeCommits(1); + + // Create a release branch and make some commits + fixture.BranchTo(ReleaseBranch); + fixture.Repository.MakeCommits(3); + + // Simulate a GitFlow release finish. + fixture.Checkout(MainBranch); + fixture.MergeNoFF(ReleaseBranch); + fixture.ApplyTag("v1.1.0"); + fixture.Checkout("develop"); + // Simulate some work done on develop while the release branch was open. + fixture.Repository.MakeCommits(2); + fixture.MergeNoFF(ReleaseBranch); + + // Version numbers will still be correct when the release branch is around. + fixture.AssertFullSemver("1.2.0-alpha.3"); + fixture.AssertFullSemver("1.2.0-alpha.3", configuration); + + var versionSourceBeforeReleaseBranchIsRemoved = fixture.GetVersion(configuration).Sha; + + fixture.Repository.Branches.Remove(ReleaseBranch); + var versionSourceAfterReleaseBranchIsRemoved = fixture.GetVersion(configuration).Sha; + Assert.That(versionSourceAfterReleaseBranchIsRemoved, Is.EqualTo(versionSourceBeforeReleaseBranchIsRemoved)); + fixture.AssertFullSemver("1.2.0-alpha.3"); + fixture.AssertFullSemver("1.2.0-alpha.3", configuration); + } - } - }; + [Test] + public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommitsSinceVersionSourceShouldNotGoDownWhenMergingHotfixToDevelop() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", builder => builder + .WithPreventIncrementOfMergedBranch(false) + ) + .WithBranch("hotfix", builder => builder + .WithPreventIncrementOfMergedBranch(true) + .WithRegularExpression(@"^(origin/)?hotfix[\/-]") + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -357,12 +407,12 @@ public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommi fixture.Checkout("develop"); fixture.Repository.MakeCommits(3); - fixture.AssertFullSemver("1.1.0-alpha.4", config); + fixture.AssertFullSemver("1.1.0-alpha.4", configuration); const string ReleaseBranch = "release/1.1.0"; Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch(ReleaseBranch)); fixture.Repository.MakeCommits(3); - fixture.AssertFullSemver("1.1.0-beta.3", config); + fixture.AssertFullSemver("1.1.0-beta.1+7", configuration); // Simulate a GitFlow release finish. fixture.Checkout(MainBranch); @@ -374,7 +424,7 @@ public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommi fixture.Repository.MakeCommits(2); fixture.MergeNoFF(ReleaseBranch); fixture.Repository.Branches.Remove(ReleaseBranch); - fixture.AssertFullSemver("1.2.0-alpha.6", config); + fixture.AssertFullSemver("1.2.0-alpha.3", configuration); // Create hotfix for defects found in release/1.1.0 const string HotfixBranch = "hotfix/1.1.1"; @@ -391,11 +441,116 @@ public void WhenPreventIncrementOfMergedBranchVersionIsSetToFalseForDevelopCommi fixture.Checkout("develop"); // Simulate some work done on develop while the hotfix branch was open. fixture.Repository.MakeCommits(3); - fixture.AssertFullSemver("1.2.0-alpha.9", config); + fixture.AssertFullSemver("1.2.0-alpha.6", configuration); fixture.Repository.MergeNoFF(HotfixBranch); - fixture.AssertFullSemver("1.2.0-alpha.19", config); + fixture.AssertFullSemver("1.2.0-alpha.7", configuration); fixture.Repository.Branches.Remove(HotfixBranch); - fixture.AssertFullSemver("1.2.0-alpha.19", config); + fixture.AssertFullSemver("1.2.0-alpha.7", configuration); + } + + [Test] + public void NextVersionShouldBeConsideredOnTheMainBranch() + { + using var fixture = new EmptyRepositoryFixture(); + + var configurationBuilder = GitFlowConfigurationBuilder.New; + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1", configurationBuilder.Build()); + + fixture.MakeACommit(); + configurationBuilder.WithNextVersion(null); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-2", configurationBuilder.Build()); + } + + /// + /// Prevent decrementation of versions on the develop branch #3177 + /// (see https://github.com/GitTools/GitVersion/discussions/3177) + /// + [Test] + public void PreventDecrementationOfVersionsOnTheMainBranch() + { + using var fixture = new EmptyRepositoryFixture("develop"); + + var configurationBuilder = GitFlowConfigurationBuilder.New; + + fixture.MakeACommit(); + configurationBuilder.WithNextVersion("1.0.0"); + + // now we are ready to start with the preparation of the 1.0.0 release + fixture.BranchTo("release/1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configurationBuilder.Build()); + + // now we make changes on develop that may or may not end up in the 1.0.0 release + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configurationBuilder.Build()); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configurationBuilder.Build()); + + // now we do the actual release of beta 1 + fixture.Checkout("release/1.0.0"); + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configurationBuilder.Build()); + + // continue with more work on develop that may or may not end up in the 1.0.0 release + fixture.Checkout("develop"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configurationBuilder.Build()); + + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.4", configurationBuilder.Build()); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.5", configurationBuilder.Build()); + + fixture.Repository.Tags.Remove("1.0.0-beta.1"); + + // Merge from develop to main + fixture.BranchTo("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-5", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-5", configurationBuilder.Build()); + + // Mark this version as RTM + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configurationBuilder.Build()); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamples.cs b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamples.cs index 5b1d12634a..71160f3a31 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamples.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamples.cs @@ -1,7 +1,4 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.IntegrationTests; @@ -60,9 +57,9 @@ public void GitFlowPullRequestBranch() // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.SequenceDiagram.Activate("pull/2/merge"); - fixture.AssertFullSemver("1.3.0-PullRequest0002.1"); + fixture.AssertFullSemver("1.3.0-PullRequest2.1"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.3.0-PullRequest0002.2"); + fixture.AssertFullSemver("1.3.0-PullRequest2.2"); // Merge into develop fixture.Checkout("develop"); @@ -94,7 +91,7 @@ public void GitFlowHotfixBranch() // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.2.1-beta.1"); - fixture.AssertFullSemver("1.2.1-beta.1"); + fixture.AssertFullSemver("1.2.1-beta.2+0"); fixture.Checkout(MainBranch); fixture.MergeNoFF("hotfix/1.2.1"); fixture.SequenceDiagram.Destroy("hotfix/1.2.1"); @@ -121,7 +118,7 @@ public void GitFlowMinorRelease() // Create release branch fixture.BranchTo("release/1.3.0", "release"); fixture.SequenceDiagram.Activate("release/1.3.0"); - fixture.AssertFullSemver("1.3.0-beta.1+0"); + fixture.AssertFullSemver("1.3.0-beta.1+1"); // Make another commit on develop fixture.Checkout("develop"); @@ -131,15 +128,15 @@ public void GitFlowMinorRelease() // Make a commit to release-1.3.0 fixture.Checkout("release/1.3.0"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.3.0-beta.1+1"); + fixture.AssertFullSemver("1.3.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.0-beta.1"); - fixture.AssertFullSemver("1.3.0-beta.1"); + fixture.AssertFullSemver("1.3.0-beta.2+0"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); - fixture.AssertFullSemver("1.3.0-beta.2+2"); + fixture.AssertFullSemver("1.3.0-beta.2+1"); // Complete release fixture.Checkout(MainBranch); @@ -155,7 +152,7 @@ public void GitFlowMinorRelease() // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); - fixture.AssertFullSemver("1.4.0-alpha.4"); + fixture.AssertFullSemver("1.4.0-alpha.2"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } @@ -176,7 +173,7 @@ public void GitFlowMajorRelease() // Create release branch fixture.BranchTo("release/2.0.0", "release"); fixture.SequenceDiagram.Activate("release/2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.1+0"); + fixture.AssertFullSemver("2.0.0-beta.1+1"); // Make another commit on develop fixture.Checkout("develop"); @@ -186,15 +183,15 @@ public void GitFlowMajorRelease() // Make a commit to release-2.0.0 fixture.Checkout("release/2.0.0"); fixture.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.1+1"); + fixture.AssertFullSemver("2.0.0-beta.1+2"); // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); - fixture.AssertFullSemver("2.0.0-beta.1"); + fixture.AssertFullSemver("2.0.0-beta.2+0"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.2+2"); + fixture.AssertFullSemver("2.0.0-beta.2+1"); // Complete release fixture.Checkout(MainBranch); @@ -205,13 +202,13 @@ public void GitFlowMajorRelease() fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0"); fixture.Checkout(MainBranch); - fixture.AssertFullSemver("2.0.0+0"); + fixture.AssertFullSemver("2.0.0-4"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); // Not 0 for commit count as we can't know the increment rules of the merged branch fixture.Checkout("develop"); - fixture.AssertFullSemver("2.1.0-alpha.4"); + fixture.AssertFullSemver("2.1.0-alpha.2"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } @@ -236,7 +233,7 @@ public void GitFlowSupportHotfixRelease() fixture.Checkout("1.3.0"); fixture.BranchToFromTag("support/1.x", "1.3.0", MainBranch, "support"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.3.1+1"); + fixture.AssertFullSemver("1.3.1-1"); fixture.BranchTo("hotfix/1.3.1", "hotfix2"); fixture.SequenceDiagram.Activate("hotfix/1.3.1"); @@ -246,12 +243,12 @@ public void GitFlowSupportHotfixRelease() // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.3.1-beta.1"); - fixture.AssertFullSemver("1.3.1-beta.1"); + fixture.AssertFullSemver("1.3.1-beta.2+0"); fixture.Checkout("support/1.x"); fixture.MergeNoFF("hotfix/1.3.1"); fixture.SequenceDiagram.Destroy("hotfix/1.3.1"); fixture.SequenceDiagram.NoteOver("Hotfix branches are deleted once merged", "hotfix/1.3.1"); - fixture.AssertFullSemver("1.3.1+4"); + fixture.AssertFullSemver("1.3.1-4"); fixture.ApplyTag("1.3.1"); fixture.AssertFullSemver("1.3.1"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); @@ -289,18 +286,17 @@ public void GitFlowSupportMinorRelease() // Apply beta.1 tag should be exact tag fixture.ApplyTag("1.4.0-beta.1"); - fixture.AssertFullSemver("1.4.0-beta.1"); + fixture.AssertFullSemver("1.4.0-beta.2+0"); fixture.Checkout("support/1.x"); fixture.MergeNoFF("release/1.4.0"); fixture.SequenceDiagram.Destroy("release/1.4.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/1.4.0"); - fixture.AssertFullSemver("1.4.0+0"); + fixture.AssertFullSemver("1.4.0-3"); fixture.ApplyTag("1.4.0"); fixture.AssertFullSemver("1.4.0"); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } - [Test] public void GitHubFlowFeatureBranch() { @@ -313,7 +309,7 @@ public void GitHubFlowFeatureBranch() // Branch to develop fixture.MakeACommit(); - fixture.AssertFullSemver("1.2.1+1"); + fixture.AssertFullSemver("1.2.1-1"); // Open Pull Request const string branchName = "feature/myFeature"; @@ -328,7 +324,7 @@ public void GitHubFlowFeatureBranch() fixture.MergeNoFF(branchName); fixture.SequenceDiagram.Destroy(branchName); fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); - fixture.AssertFullSemver("1.2.1+3"); + fixture.AssertFullSemver("1.2.1-3"); } [Test] @@ -343,14 +339,14 @@ public void GitHubFlowPullRequestBranch() // Branch to develop fixture.MakeACommit(); - fixture.AssertFullSemver("1.2.1+1"); + fixture.AssertFullSemver("1.2.1-1"); // Open Pull Request fixture.BranchTo("pull/2/merge", "pr"); fixture.SequenceDiagram.Activate("pull/2/merge"); - fixture.AssertFullSemver("1.2.1-PullRequest0002.1"); + fixture.AssertFullSemver("1.2.1-PullRequest2.1"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.2.1-PullRequest0002.2"); + fixture.AssertFullSemver("1.2.1-PullRequest2.2"); // Merge into main fixture.Checkout(MainBranch); @@ -358,7 +354,7 @@ public void GitHubFlowPullRequestBranch() fixture.SequenceDiagram.Destroy("pull/2/merge"); fixture.SequenceDiagram.NoteOver("Feature branches/pr's should\r\n" + "be deleted once merged", "pull/2/merge"); - fixture.AssertFullSemver("1.2.1+3"); + fixture.AssertFullSemver("1.2.1-3"); } [Test] @@ -380,15 +376,15 @@ public void GitHubFlowMajorRelease() // Apply beta.1 tag should be exact tag fixture.ApplyTag("2.0.0-beta.1"); - fixture.AssertFullSemver("2.0.0-beta.1"); + fixture.AssertFullSemver("2.0.0-beta.2+0"); // test that the CommitsSinceVersionSource should still return commit count var version = fixture.GetVersion(); - version.CommitsSinceVersionSource.ShouldBe("2"); + version.CommitsSinceVersionSource.ShouldBe("0"); // Make a commit after a tag should bump up the beta fixture.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.2+3"); + fixture.AssertFullSemver("2.0.0-beta.2+1"); // Complete release fixture.Checkout(MainBranch); @@ -396,11 +392,11 @@ public void GitHubFlowMajorRelease() fixture.SequenceDiagram.Destroy("release/2.0.0"); fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0"); - fixture.AssertFullSemver("2.0.0+0"); + fixture.AssertFullSemver("2.0.0-4"); fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); fixture.MakeACommit(); fixture.Repository.DumpGraph(); - fixture.AssertFullSemver("2.0.1+1"); + fixture.AssertFullSemver("2.0.1-1"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs new file mode 100644 index 0000000000..1fc0cd9df7 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs @@ -0,0 +1,1249 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; +using LibGit2Sharp; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class DocumentationSamplesForGitFlow +{ + [TestCase(false)] + [TestCase(true)] + public void FeatureFromMainBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Merge main to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-foo.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.0.0-foo.1"); + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-6", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void FeatureFromMainBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-foo.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.0.0-foo.1"); + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void FeatureFromDevelopBranch(bool withPullRequestIntoDevelop) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main to develop + fixture.BranchTo("develop", "develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + + // Branch from develop to feature + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.3.0-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-1", configuration); + fixture.ApplyTag("1.3.0"); + fixture.AssertFullSemver("1.3.0", configuration); + + // Merge main to develop branch + fixture.MergeTo("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.1", configuration); + + // Merge develop to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.4.0-foo.1+3", configuration); + + // Bump to major version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-foo.1+4", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.1.0-foo.1"); + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + fixture.Checkout("develop"); + + if (withPullRequestIntoDevelop) + { + // Create a PullRequest into develop + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.6", configuration); + fixture.Checkout("develop"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into develop branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.1.0-alpha.6", configuration); + + // Commit on develop branch + fixture.SequenceDiagram.Activate("develop"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.7", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void FeatureFromDevelopBranchWithMainline(bool withPullRequestIntoDevelop) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .WithBranch("feature", builder => builder.WithIncrement(IncrementStrategy.Minor)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main to develop + fixture.BranchTo("develop", "develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + + // Branch from develop to feature + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.3.0-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-1", configuration); + + // Merge main to develop branch + fixture.MergeTo("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.1", configuration); + + // Merge develop to feature branch + fixture.Checkout("main"); + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.4.0-foo.1+2", configuration); + + // Bump to major version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.1.0-foo.1"); + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + fixture.Checkout("develop"); + + if (withPullRequestIntoDevelop) + { + // Create a PullRequest into develop + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.6", configuration); + fixture.Checkout("develop"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into develop branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.1.0-alpha.6", configuration); + + // Commit on develop branch + fixture.SequenceDiagram.Activate("develop"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.7", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void HotfixBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "hotfix/next"; + fixture.BranchTo(branchName, "hotfix"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Merge main to hotfix branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-beta.1+3", configuration); + + // Create pre-release on hotfix branch + fixture.ApplyTag("2.0.0-beta.1"); + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-6", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void HotfixBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "hotfix/next"; + fixture.BranchTo(branchName, "hotfix"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to hotfix branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-beta.1+3", configuration); + + // Create pre-release on hotfix branch + fixture.ApplyTag("2.0.0-beta.1"); + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedHotfixBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "hotfix/2.2.1"; + fixture.BranchTo(branchName, "hotfix"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("2.2.1"); + fixture.AssertFullSemver("2.2.1", configuration); + + // Merge main to hotfix branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + // Create pre-release on hotfix branch + fixture.ApplyTag("3.0.1-beta.1"); + fixture.AssertFullSemver("3.0.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("3.0.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("3.0.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("3.0.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("3.0.1-6", configuration); + fixture.ApplyTag("3.0.1"); + fixture.AssertFullSemver("3.0.1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedHotfixBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "hotfix/2.2.1"; + fixture.BranchTo(branchName, "hotfix"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to hotfix branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.2.1-beta.1+3", configuration); + + // Create pre-release on hotfix branch + fixture.ApplyTag("2.2.2-beta.1"); + fixture.AssertFullSemver("2.2.2-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.2-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.2.2-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.2.2-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.3-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void ReleaseBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "release/next"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.0.1-beta.1"); + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-6", configuration); + fixture.ApplyTag("2.0.1"); + fixture.AssertFullSemver("2.0.1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void ReleaseBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "release/next"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.0.1-beta.1"); + fixture.AssertFullSemver("2.0.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.2-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedReleaseBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "release/2.2.1"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("2.2.1"); + fixture.AssertFullSemver("2.2.1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.3.0-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("3.0.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("3.0.1-beta.1"); + fixture.AssertFullSemver("3.0.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("3.0.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("3.0.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("3.0.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("3.0.1-6", configuration); + fixture.ApplyTag("3.0.1"); + fixture.AssertFullSemver("3.0.1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedReleaseBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "release/2.2.1"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.2.1-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.2.1-beta.1"); + fixture.AssertFullSemver("2.2.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.2.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.2.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.2-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void DevelopBranch(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "develop"; + fixture.BranchTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate(branchName); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-alpha.1", configuration); + + // Create release from develop branch + fixture.BranchTo("release/1.3.0", "release"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.SequenceDiagram.Activate("release"); + fixture.AssertFullSemver("1.3.0-beta.1+1", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-beta.1+2", configuration); + + // Bump to major version increment + fixture.Checkout("develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.0", configuration); + + // Merge release into develop branch + fixture.MergeNoFF("release/1.3.0"); + fixture.AssertFullSemver("1.4.0-alpha.2", configuration); + + // Merge release into main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MergeNoFF("release/1.3.0"); + fixture.Remove("release/1.3.0"); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", "release"); + fixture.ApplyTag("1.3.0"); + fixture.AssertFullSemver("1.3.0", configuration); + + // Create hotfix on main branch + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.1-1", configuration); + fixture.ApplyTag("1.3.1"); + fixture.AssertFullSemver("1.3.1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.4.0-alpha.2", configuration); + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-alpha.3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.1.0-alpha.1"); + fixture.AssertFullSemver("2.1.0-alpha.1", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.2", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge develop into main branch + fixture.MergeNoFF(branchName); + fixture.SequenceDiagram.Deactivate(branchName); + fixture.AssertFullSemver("2.1.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-6", configuration); + fixture.ApplyTag("2.1.0"); + fixture.AssertFullSemver("2.1.0", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void DevelopBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.TrackReleaseBranches, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "develop"; + fixture.BranchTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate(branchName); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-alpha.1", configuration); + + // Create release from develop branch + fixture.BranchTo("release/1.3.0", "release"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.SequenceDiagram.Activate("release"); + fixture.AssertFullSemver("1.3.0-beta.1+1", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-beta.1+2", configuration); + + // Bump to major version increment + fixture.Checkout("develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.0", configuration); + + // Merge release into develop branch + fixture.MergeNoFF("release/1.3.0"); + fixture.AssertFullSemver("1.4.0-alpha.2", configuration); + + // Merge release into main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MergeNoFF("release/1.3.0"); + fixture.Remove("release/1.3.0"); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", "release"); + + // Create hotfix on main branch + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.1-1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.4.0-alpha.2", configuration); + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-alpha.3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.1.0-alpha.1"); + fixture.AssertFullSemver("2.1.0-alpha.1", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.2", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge develop into main branch + fixture.MergeNoFF(branchName); + fixture.SequenceDiagram.Deactivate(branchName); + fixture.AssertFullSemver("2.1.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void SupportBranch(bool withPullRequestIntoSupport) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + fixture.BranchToFromTag("support/1.x", "1.2.0", "main", "support"); + fixture.SequenceDiagram.Activate("support"); + fixture.AssertFullSemver("1.2.0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-1", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); + + fixture.Checkout("support/1.x"); + fixture.BranchTo("hotfix/1.2.2", "hotfix"); + fixture.SequenceDiagram.Deactivate("support"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.AssertFullSemver("1.2.2-beta.1+1", configuration); + fixture.MakeACommit(); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.2-beta.1+3", configuration); + fixture.ApplyTag("1.2.3-beta.1"); + fixture.AssertFullSemver("1.2.3-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.3-beta.2+1", configuration); + fixture.Checkout("support/1.x"); + + if (withPullRequestIntoSupport) + { + // Create a PullRequest into support + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF("hotfix/1.2.2"); + fixture.AssertFullSemver("1.2.3-PullRequest2.5", configuration); + fixture.Checkout("support/1.x"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into support branch + fixture.MergeNoFF("hotfix/1.2.2"); + fixture.Remove("hotfix/1.2.2"); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", "hotfix/1.2.2"); + fixture.AssertFullSemver("1.2.3-5", configuration); + + // Commit on support branch + fixture.SequenceDiagram.Activate("support"); + fixture.ApplyTag("1.2.3"); + fixture.AssertFullSemver("1.2.3", configuration); + + fixture.Checkout("main"); + fixture.AssertFullSemver("2.0.0", configuration); + fixture.MergeNoFF("support/1.x"); + fixture.AssertFullSemver("2.0.1-6", configuration); + fixture.ApplyTag("2.0.1"); + fixture.AssertFullSemver("2.0.1", configuration); + + fixture.Checkout("support/1.x"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.4-1", configuration); + fixture.ApplyTag("1.2.4"); + fixture.AssertFullSemver("1.2.4", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("support/1.x"); + fixture.AssertFullSemver("2.0.2-2", configuration); + fixture.ApplyTag("2.0.2"); + fixture.AssertFullSemver("2.0.2", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void SupportBranchWithMainline(bool withPullRequestIntoSupport) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.TrackReleaseBranches, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + fixture.BranchToFromTag("support/1.x", "1.2.0", "main", "support"); + fixture.SequenceDiagram.Activate("support"); + fixture.AssertFullSemver("1.2.0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-1", configuration); + + fixture.Checkout("support/1.x"); + fixture.BranchTo("hotfix/1.2.2", "hotfix"); + fixture.SequenceDiagram.Deactivate("support"); + fixture.SequenceDiagram.Activate("hotfix"); + fixture.AssertFullSemver("1.2.2-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.2-beta.1+2", configuration); + fixture.ApplyTag("1.2.3-beta.1"); + fixture.AssertFullSemver("1.2.3-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.3-beta.2+1", configuration); + fixture.Checkout("support/1.x"); + + if (withPullRequestIntoSupport) + { + // Create a PullRequest into support + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF("hotfix/1.2.2"); + fixture.AssertFullSemver("1.2.3-PullRequest2.4", configuration); + fixture.Checkout("support/1.x"); + fixture.Remove("pull/2/merge"); + } + + // Merge hotfix into support branch + fixture.MergeNoFF("hotfix/1.2.2"); + fixture.Remove("hotfix/1.2.2"); + fixture.SequenceDiagram.NoteOver("Hotfix branches should\r\nbe deleted once merged", "hotfix/1.2.2"); + fixture.AssertFullSemver("1.2.3-4", configuration); + + // Commit on support branch + fixture.SequenceDiagram.Activate("support"); + + fixture.Checkout("main"); + fixture.AssertFullSemver("2.0.0-1", configuration); + //fixture.MergeNoFF("support/1.x"); + //fixture.AssertFullSemver("2.0.1-6", configuration); + + //fixture.Checkout("support/1.x"); + //fixture.MakeACommit(); + //fixture.AssertFullSemver("1.2.4-1", configuration); + + //fixture.Checkout("main"); + //fixture.MergeNoFF("support/1.x"); + //fixture.AssertFullSemver("2.0.2-2", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitHubFlow.cs b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitHubFlow.cs new file mode 100644 index 0000000000..cba4301309 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitHubFlow.cs @@ -0,0 +1,438 @@ +using GitVersion.Configuration; +using GitVersion.VersionCalculation; +using LibGit2Sharp; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class DocumentationSamplesForGitHubFlow +{ + [TestCase(false)] + [TestCase(true)] + public void FeatureBranch(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Merge main to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-foo.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.0.0-foo.1"); + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-6", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void FeatureBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-foo.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.0.0-foo.1"); + fixture.AssertFullSemver("2.0.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.0-foo.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.0.0-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.0.0-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.0.1-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void ReleaseBranch(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "release/next"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("1.3.1-beta.1"); + fixture.AssertFullSemver("1.3.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("1.3.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("1.3.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.1-6", configuration); + fixture.ApplyTag("1.3.1"); + fixture.AssertFullSemver("1.3.1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void ReleaseBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "release/next"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("1.3.1-beta.1"); + fixture.AssertFullSemver("1.3.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("1.3.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("1.3.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.2-1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedReleaseBranch(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main + const string branchName = "release/2.2.1"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + fixture.ApplyTag("2.2.1"); + fixture.AssertFullSemver("2.2.1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.2-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("2.3.0-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.3.1-beta.1"); + fixture.AssertFullSemver("2.3.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.3.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.3.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.3.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.3.1-6", configuration); + fixture.ApplyTag("2.3.1"); + fixture.AssertFullSemver("2.3.1", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void VersionedReleaseBranchWithMainline(bool withPullRequestIntoMain) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0-1", configuration); + fixture.Repository.ApplyTag("1.2.0"); + + // Branch from main + const string branchName = "release/2.2.1"; + fixture.BranchTo(branchName, "release"); + fixture.SequenceDiagram.Activate("release"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.1-1", configuration); + + // Merge main to release branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("2.2.1-beta.1+2", configuration); + + // Bump to minor version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.2.1-beta.1+3", configuration); + + // Create pre-release on release branch + fixture.ApplyTag("2.2.1-beta.1"); + fixture.AssertFullSemver("2.2.1-beta.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.1-beta.2+1", configuration); + fixture.Checkout("main"); + + if (withPullRequestIntoMain) + { + // Create a PullRequest into main + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.2.1-PullRequest2.5", configuration); + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + } + + // Merge release into main branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Release branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.2.1-5", configuration); + + // Commit on main branch + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.2.2-1", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/FallbackVersionStrategyScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/FallbackVersionStrategyScenarios.cs new file mode 100644 index 0000000000..9076c18b5c --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/FallbackVersionStrategyScenarios.cs @@ -0,0 +1,127 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class FallbackVersionStrategyScenarios : TestBase +{ + private static GitHubFlowConfigurationBuilder ConfigurationBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Fallback) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [TestCase(IncrementStrategy.None, "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "1.0.0-1+1")] + public void EnsureVersionIncrementOnMainWillBeUsed(IncrementStrategy increment, string expected) + { + var configuration = ConfigurationBuilder + .WithBranch("main", b => b.WithIncrement(increment)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver(expected, configuration); + } + + [TestCase(IncrementStrategy.None, "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "1.0.0-1+1")] + public void EnsureVersionIncrementOnMessageWillBeUsed(IncrementStrategy increment, string expected) + { + var configuration = ConfigurationBuilder + .WithBranch("main", b => b.WithIncrement(IncrementStrategy.None)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit($"+semver: {increment}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(expected, configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void TakeTheLatestCommitAsBaseVersion(bool mode) + { + var configuration = ConfigurationBuilder + .WithBranch("main", b => b + .WithIncrement(IncrementStrategy.Major) + .WithTrackMergeTarget(true) + .WithTracksReleaseBranches(false) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("release/foo"); + fixture.Checkout("main"); + + fixture.MakeACommit("B"); + if (mode) + { + fixture.MergeTo("release/foo"); + fixture.ApplyTag("0.0.0"); + fixture.Checkout("main"); + } + else + { + fixture.ApplyTag("0.0.0"); + } + + fixture.MakeACommit("C"); + if (mode) + { + fixture.ApplyTag("0.0.1"); + } + else + { + fixture.MergeTo("release/foo"); + fixture.ApplyTag("0.0.1"); + fixture.Checkout("main"); + } + + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1+1", configuration); + } + + [TestCase(false, "1.0.0-1+4")] + [TestCase(true, "1.0.0-1+2")] + public void TakeTheCommitBranchedFromAsBaseVersionWhenTracksReleaseBranchesIsTrue( + bool tracksReleaseBranches, string version) + { + var configuration = ConfigurationBuilder + .WithBranch("main", b => b + .WithIncrement(IncrementStrategy.Major) + .WithTrackMergeTarget(false) + .WithTracksReleaseBranches(tracksReleaseBranches) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.BranchTo("release/foo"); + fixture.Checkout("main"); + fixture.MakeACommit("C"); + fixture.Checkout("release/foo"); + fixture.MakeACommit("D"); + fixture.ApplyTag("0.0.0"); + fixture.Checkout("main"); + fixture.MakeACommit("D"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(version, configuration); + + fixture.Repository.DumpGraph(); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs index b5d81bc45d..05cd9a46cb 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs @@ -1,10 +1,7 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -39,22 +36,13 @@ public void ShouldInheritIncrementCorrectlyWithMultiplePossibleParentsAndWeirdly [Test] public void BranchCreatedAfterFastForwardMergeShouldInheritCorrectly() { - var config = new Config - { - Branches = - { - { - "unstable", - new BranchConfig - { - Increment = IncrementStrategy.Minor, - Regex = "unstable", - SourceBranches = new HashSet(), - IsSourceBranchFor = new HashSet { "feature" } - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("unstable", builder => builder + .WithIncrement(IncrementStrategy.Minor) + .WithRegularExpression("unstable") + .WithSourceBranches() + .WithIsSourceBranchFor("feature")) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); @@ -75,7 +63,7 @@ public void BranchCreatedAfterFastForwardMergeShouldInheritCorrectly() Commands.Checkout(fixture.Repository, "feature/JIRA-124"); fixture.Repository.MakeCommits(1); - fixture.AssertFullSemver("1.1.0-JIRA-124.1+2", config); + fixture.AssertFullSemver("1.1.0-JIRA-124.1+2", configuration); } [Test] @@ -141,7 +129,7 @@ public void WhenTwoFeatureBranchPointToTheSameCommit() fixture.Repository.CreateBranch("feature/feature2"); Commands.Checkout(fixture.Repository, "feature/feature2"); - fixture.AssertFullSemver("0.1.0-feature2.1+1"); + fixture.AssertFullSemver("0.1.0-feature2.1+2"); } [Test] @@ -168,21 +156,20 @@ public void ShouldBePossibleToMergeDevelopForALongRunningBranchWhereDevelopAndMa Commands.Checkout(fixture.Repository, branchName); fixture.Repository.Merge(fixture.Repository.Branches["develop"], Generate.SignatureNow()); - var configuration = new Config { VersioningMode = VersioningMode.ContinuousDeployment }; + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithBranch("feature", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); fixture.AssertFullSemver("1.2.0-longrunning.2", configuration); } [Test] public void CanUseBranchNameOffAReleaseBranch() { - var config = new Config - { - Branches = - { - { "release", new BranchConfig { Tag = "build" } }, - { "feature", new BranchConfig { Tag = "useBranchName" } } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("release", builder => builder.WithLabel("build")) + .WithBranch("feature", builder => builder.WithLabel(ConfigurationConstants.BranchNamePlaceholder)) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -192,31 +179,32 @@ public void CanUseBranchNameOffAReleaseBranch() fixture.BranchTo("feature/PROJ-1"); fixture.MakeACommit(); - fixture.AssertFullSemver("0.3.0-PROJ-1.1+2", config); + fixture.AssertFullSemver("0.3.0-PROJ-1.1+4", configuration); } - [TestCase("alpha", "JIRA-123", "alpha")] - [TestCase("useBranchName", "JIRA-123", "JIRA-123")] - [TestCase("alpha.{BranchName}", "JIRA-123", "alpha.JIRA-123")] - public void ShouldUseConfiguredTag(string tag, string featureName, string preReleaseTagName) + [TestCase("alpha", "JIRA-123", @"^features?[\/-](?.+)", "alpha")] + [TestCase($"alpha.{ConfigurationConstants.BranchNamePlaceholder}", "JIRA-123", @"^features?[\/-](?.+)", "alpha.JIRA-123")] + [TestCase("{BranchName}-of-task-number-{TaskNumber}", "4711_this-is-a-feature", @"^features?[\/-](?\d+)_(?.+)", "this-is-a-feature-of-task-number-4711")] + [TestCase("{BranchName}", "4711_this-is-a-feature", @"^features?[\/-](?.+)", "4711-this-is-a-feature")] + [TestCase("{BranchName}.xyz", "x_y.7.z", @"^features?[\/-](?.+)", "x-y-7-z.xyz")] + [TestCase("{BranchName}", "yourname/dash-separated-words", @".*\/(?[^\/]+)$", "dash-separated-words")] + [TestCase("{X}.{Z}-{Y}.{X}-{Z}.{X}", "xxxyyz", @"^features?[\/-](?x+)(?y+)(?z+)$", "xxx.z-yy.xxx-z.xxx")] + public void ShouldUseConfiguredLabel(string label, string featureName, string regularExpression, string preReleaseLabelName) { - var config = new Config - { - Branches = - { - { "feature", new BranchConfig { Tag = tag } } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("feature", builder => builder + .WithLabel(label) + .WithRegularExpression(regularExpression)) + .Build(); using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0.0"); + fixture.MakeATaggedCommit("1.0.0"); var featureBranchName = $"feature/{featureName}"; - fixture.Repository.CreateBranch(featureBranchName); - Commands.Checkout(fixture.Repository, featureBranchName); + fixture.BranchTo(featureBranchName); fixture.Repository.MakeCommits(5); - var expectedFullSemVer = $"1.0.1-{preReleaseTagName}.1+5"; - fixture.AssertFullSemver(expectedFullSemVer, config); + var expectedFullSemVer = $"1.0.1-{preReleaseLabelName}.1+5"; + fixture.AssertFullSemver(expectedFullSemVer, configuration); } [Test] @@ -229,7 +217,7 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMain Commands.Checkout(fixture.Repository, "release/0.2.0"); //validate release version - fixture.AssertFullSemver("0.2.0-beta.1+0"); + fixture.AssertFullSemver("0.2.0-beta.1+1"); fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release/0.2.0"); @@ -251,7 +239,7 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMain fixture.BranchTo("feature/TEST-1"); fixture.Repository.MakeACommit(); - //I'm not entirely sure what the + value should be but I know the semvar major/minor/patch should be 0.3.0 + //I'm not entirely sure what the + value should be, but I know the semver major/minor/patch should be 0.3.0 fixture.AssertFullSemver("0.3.0-TEST-1.1+2"); } @@ -263,7 +251,7 @@ public void ShouldPickUpVersionFromDevelopAfterReleaseBranchCreated() fixture.MakeACommit(); fixture.BranchTo("develop"); fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); fixture.Checkout("develop"); fixture.MakeACommit(); @@ -282,12 +270,12 @@ public void ShouldPickUpVersionFromDevelopAfterReleaseBranchMergedBack() fixture.MakeACommit(); fixture.BranchTo("develop"); fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); // merge release into develop fixture.Checkout("develop"); - fixture.MergeNoFF("release/1.0"); + fixture.MergeNoFF("release/1.0.0"); fixture.AssertFullSemver("1.1.0-alpha.2"); // create a feature branch from develop and verify the version @@ -300,65 +288,45 @@ public class WhenMainAsIsDevelop [Test] public void ShouldPickUpVersionFromMainAfterReleaseBranchCreated() { - var config = new Config - { - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - TracksReleaseBranches = true, - Regex = MainBranch - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithTracksReleaseBranches(true)) + .Build(); using var fixture = new EmptyRepositoryFixture(); // Create release branch fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.1+1", config); + fixture.AssertFullSemver("1.0.1-1", configuration); // create a feature branch from main and verify the version fixture.BranchTo("feature/test"); - fixture.AssertFullSemver("1.0.1-test.1+1", config); + fixture.AssertFullSemver("1.0.1-test.1+1", configuration); } [Test] public void ShouldPickUpVersionFromMainAfterReleaseBranchMergedBack() { - var config = new Config - { - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - TracksReleaseBranches = true, - Regex = MainBranch - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithTracksReleaseBranches(true)) + .Build(); using var fixture = new EmptyRepositoryFixture(); // Create release branch fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); // merge release into main fixture.Checkout(MainBranch); - fixture.MergeNoFF("release/1.0"); - fixture.AssertFullSemver("1.0.1+2", config); + fixture.MergeNoFF("release/1.0.0"); + fixture.AssertFullSemver("1.0.1-2", configuration); // create a feature branch from main and verify the version fixture.BranchTo("feature/test"); - fixture.AssertFullSemver("1.0.1-test.1+2", config); + fixture.AssertFullSemver("1.0.1-test.1+2", configuration); } } @@ -372,13 +340,13 @@ public void ShouldPickUpVersionFromMainAfterReleaseBranchCreated() fixture.MakeACommit(); fixture.BranchTo("develop"); fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); fixture.Checkout("develop"); fixture.MakeACommit(); fixture.AssertFullSemver("1.1.0-alpha.1"); - // create a misnamed feature branch (i.e. it uses the default config) from develop and verify the version + // create a misnamed feature branch (i.e. it uses the default configuration) from develop and verify the version fixture.BranchTo("misnamed"); fixture.AssertFullSemver("1.1.0-misnamed.1+1"); } @@ -391,15 +359,15 @@ public void ShouldPickUpVersionFromDevelopAfterReleaseBranchMergedBack() fixture.MakeACommit(); fixture.BranchTo("develop"); fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); // merge release into develop fixture.Checkout("develop"); - fixture.MergeNoFF("release/1.0"); + fixture.MergeNoFF("release/1.0.0"); fixture.AssertFullSemver("1.1.0-alpha.2"); - // create a misnamed feature branch (i.e. it uses the default config) from develop and verify the version + // create a misnamed feature branch (i.e. it uses the default configuration) from develop and verify the version fixture.BranchTo("misnamed"); fixture.AssertFullSemver("1.1.0-misnamed.1+2"); } @@ -410,65 +378,45 @@ public class WhenMainMarkedAsIsDevelop [Test] public void ShouldPickUpVersionFromMainAfterReleaseBranchCreated() { - var config = new Config - { - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - TracksReleaseBranches = true, - Regex = MainBranch - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithTracksReleaseBranches(true)) + .Build(); using var fixture = new EmptyRepositoryFixture(); // Create release branch fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.1+1", config); + fixture.AssertFullSemver("1.0.1-1", configuration); - // create a misnamed feature branch (i.e. it uses the default config) from main and verify the version + // create a misnamed feature branch (i.e. it uses the default configuration) from main and verify the version fixture.BranchTo("misnamed"); - fixture.AssertFullSemver("1.0.1-misnamed.1+1", config); + fixture.AssertFullSemver("1.0.1-misnamed.1+1", configuration); } [Test] public void ShouldPickUpVersionFromMainAfterReleaseBranchMergedBack() { - var config = new Config - { - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - TracksReleaseBranches = true, - Regex = MainBranch - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithTracksReleaseBranches(true)) + .Build(); using var fixture = new EmptyRepositoryFixture(); // Create release branch fixture.MakeACommit(); - fixture.BranchTo("release/1.0"); + fixture.BranchTo("release/1.0.0"); fixture.MakeACommit(); // merge release into main fixture.Checkout(MainBranch); - fixture.MergeNoFF("release/1.0"); - fixture.AssertFullSemver("1.0.1+2", config); + fixture.MergeNoFF("release/1.0.0"); + fixture.AssertFullSemver("1.0.1-2", configuration); - // create a misnamed feature branch (i.e. it uses the default config) from main and verify the version + // create a misnamed feature branch (i.e. it uses the default configuration) from main and verify the version fixture.BranchTo("misnamed"); - fixture.AssertFullSemver("1.0.1-misnamed.1+2", config); + fixture.AssertFullSemver("1.0.1-misnamed.1+2", configuration); } } } @@ -476,27 +424,12 @@ public void ShouldPickUpVersionFromMainAfterReleaseBranchMergedBack() [Test] public void PickUpVersionFromMainMarkedWithIsTracksReleaseBranches() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDelivery, - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - Tag = "pre", - TracksReleaseBranches = true - } - }, - { - "release", new BranchConfig - { - IsReleaseBranch = true, - Tag = "rc" - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithBranch("unknown", builder => builder.WithIncrement(IncrementStrategy.Patch).WithTracksReleaseBranches(true)) + .WithBranch(MainBranch, builder => builder.WithLabel("pre").WithTracksReleaseBranches(true)) + .WithBranch("release", builder => builder.WithLabel("rc")) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -505,46 +438,33 @@ public void PickUpVersionFromMainMarkedWithIsTracksReleaseBranches() fixture.BranchTo("release/0.10.0"); fixture.MakeACommit(); fixture.MakeACommit(); - fixture.AssertFullSemver("0.10.0-rc.1+2", config); + fixture.AssertFullSemver("0.10.0-rc.1+3", configuration); // switch to main and verify the version fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("0.10.1-pre.1+1", config); + fixture.AssertFullSemver("0.10.1-pre.1+1", configuration); // create a feature branch from main and verify the version fixture.BranchTo("MyFeatureD"); - fixture.AssertFullSemver("0.10.1-MyFeatureD.1+1", config); + fixture.AssertFullSemver("0.10.1-MyFeatureD.1+1", configuration); } [Test] public void ShouldHaveAGreaterSemVerAfterDevelopIsMergedIntoFeature() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment, - AssemblyVersioningScheme = AssemblyVersioningScheme.Major, - AssemblyFileVersioningFormat = "{MajorMinorPatch}.{env:WeightedPreReleaseNumber ?? 0}", - LegacySemVerPadding = 4, - BuildMetaDataPadding = 4, - CommitsSinceVersionSourcePadding = 4, - CommitMessageIncrementing = CommitMessageIncrementMode.Disabled, - Branches = new Dictionary - { - { - "develop", new BranchConfig - { - PreventIncrementOfMergedBranchVersion = true - } - }, - { - "feature", new BranchConfig - { - Tag = "feat-{BranchName}" - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.Major) + .WithAssemblyFileVersioningFormat("{MajorMinorPatch}.{env:WeightedPreReleaseNumber ?? 0}") + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithBranch("develop", builder => builder.WithPreventIncrementOfMergedBranch(true)) + .WithBranch("feature", builder => builder + .WithLabel($"feat-{ConfigurationConstants.BranchNamePlaceholder}") + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + ) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.BranchTo("develop"); @@ -557,6 +477,6 @@ public void ShouldHaveAGreaterSemVerAfterDevelopIsMergedIntoFeature() fixture.MakeACommit(); fixture.Checkout("feature/featX"); fixture.MergeNoFF("develop"); - fixture.AssertFullSemver("16.24.0-feat-featX.4", config); + fixture.AssertFullSemver("16.24.0-feat-featX.4", configuration); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/FileSystemTests.cs b/src/GitVersion.Core.Tests/IntegrationTests/FileSystemTests.cs deleted file mode 100644 index a2775f3198..0000000000 --- a/src/GitVersion.Core.Tests/IntegrationTests/FileSystemTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.IntegrationTests; - -[TestFixture] -public class FileSystemTests : TestBase -{ - public string TempFilePath { get; set; } - - [SetUp] - public void CreateTempFile() => TempFilePath = Path.GetTempFileName(); - - [TearDown] - public void Cleanup() => File.Delete(TempFilePath); - - [TestCase("utf-32")] - [TestCase("utf-32BE")] - [TestCase("utf-16")] - [TestCase("utf-16BE")] - [TestCase("utf-8")] - public void WhenFileExistsWithEncodingPreambleEncodingIsPreservedAfterWriteAll(string encodingName) - { - var encoding = Encoding.GetEncoding(encodingName); - - File.WriteAllText(TempFilePath, "(-‸ლ)", encoding); - - var fileSystem = new FileSystem(); - fileSystem.WriteAllText(TempFilePath, @"¯\(◉◡◔)/¯"); - - using var stream = File.OpenRead(TempFilePath); - var preamble = encoding.GetPreamble(); - var bytes = new byte[preamble.Length]; - stream.Read(bytes, 0, preamble.Length); - - bytes.ShouldBe(preamble); - } - - [Test] - public void WhenFileDoesNotExistCreateWithUtf8WithPreamble() - { - var encoding = Encoding.UTF8; - - var fileSystem = new FileSystem(); - fileSystem.WriteAllText(TempFilePath, "╚(ಠ_ಠ)=┐"); - - using var stream = File.OpenRead(TempFilePath); - var preamble = encoding.GetPreamble(); - var bytes = new byte[preamble.Length]; - stream.Read(bytes, 0, preamble.Length); - - bytes.ShouldBe(preamble); - } -} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/GitflowScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/GitflowScenarios.cs index 630400c766..a466855b43 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/GitflowScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/GitflowScenarios.cs @@ -1,85 +1,82 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; -namespace GitVersion.Core.Tests.IntegrationTests +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class GitflowScenarios : TestBase { - [TestFixture] - public class GitflowScenarios : TestBase + [Test] + public void GitflowComplexExample() { - [Test] - public void GitflowComplexExample() - { - const string developBranch = "develop"; - const string feature1Branch = "feature/f1"; - const string feature2Branch = "feature/f2"; - const string release1Branch = "release/1.1.0"; - const string release2Branch = "release/1.2.0"; - const string hotfixBranch = "hotfix/hf"; + const string developBranch = "develop"; + const string feature1Branch = "feature/f1"; + const string feature2Branch = "feature/f2"; + const string release1Branch = "release/1.1.0"; + const string release2Branch = "release/1.2.0"; + const string hotfixBranch = "hotfix/hf"; - using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); - fixture.AssertFullSemver("1.1.0-alpha.1"); + using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); + fixture.AssertFullSemver("1.1.0-alpha.1"); - // Feature 1 - fixture.BranchTo(feature1Branch); - fixture.MakeACommit("added feature 1"); - fixture.AssertFullSemver("1.1.0-f1.1+2"); - fixture.Checkout(developBranch); - fixture.MergeNoFF(feature1Branch); - fixture.Repository.Branches.Remove(fixture.Repository.Branches[feature1Branch]); - fixture.AssertFullSemver("1.1.0-alpha.3"); + // Feature 1 + fixture.BranchTo(feature1Branch); + fixture.MakeACommit("added feature 1"); + fixture.AssertFullSemver("1.1.0-f1.1+2"); + fixture.Checkout(developBranch); + fixture.MergeNoFF(feature1Branch); + fixture.Repository.Branches.Remove(fixture.Repository.Branches[feature1Branch]); + fixture.AssertFullSemver("1.1.0-alpha.3"); - // Release 1.1.0 - fixture.BranchTo(release1Branch); - fixture.MakeACommit("release stabilization"); - fixture.AssertFullSemver("1.1.0-beta.1+1"); - fixture.Checkout(MainBranch); - fixture.MergeNoFF(release1Branch); - fixture.AssertFullSemver("1.1.0+0"); - fixture.ApplyTag("1.1.0"); - fixture.AssertFullSemver("1.1.0"); - fixture.Checkout(developBranch); - fixture.MergeNoFF(release1Branch); - fixture.Repository.Branches.Remove(fixture.Repository.Branches[release1Branch]); - fixture.AssertFullSemver("1.2.0-alpha.2"); + // Release 1.1.0 + fixture.BranchTo(release1Branch); + fixture.MakeACommit("release stabilization"); + fixture.AssertFullSemver("1.1.0-beta.1+4"); + fixture.Checkout(MainBranch); + fixture.MergeNoFF(release1Branch); + fixture.AssertFullSemver("1.1.0-5"); + fixture.ApplyTag("1.1.0"); + fixture.AssertFullSemver("1.1.0"); + fixture.Checkout(developBranch); + fixture.MergeNoFF(release1Branch); + fixture.Repository.Branches.Remove(fixture.Repository.Branches[release1Branch]); + fixture.AssertFullSemver("1.2.0-alpha.1"); - // Feature 2 - fixture.BranchTo(feature2Branch); - fixture.MakeACommit("added feature 2"); - fixture.AssertFullSemver("1.2.0-f2.1+3"); - fixture.Checkout(developBranch); - fixture.MergeNoFF(feature2Branch); - fixture.Repository.Branches.Remove(fixture.Repository.Branches[feature2Branch]); - fixture.AssertFullSemver("1.2.0-alpha.4"); + // Feature 2 + fixture.BranchTo(feature2Branch); + fixture.MakeACommit("added feature 2"); + fixture.AssertFullSemver("1.2.0-f2.1+2"); + fixture.Checkout(developBranch); + fixture.MergeNoFF(feature2Branch); + fixture.Repository.Branches.Remove(fixture.Repository.Branches[feature2Branch]); + fixture.AssertFullSemver("1.2.0-alpha.3"); - // Release 1.2.0 - fixture.BranchTo(release2Branch); - fixture.MakeACommit("release stabilization"); - fixture.AssertFullSemver("1.2.0-beta.1+1"); - fixture.Checkout(MainBranch); - fixture.MergeNoFF(release2Branch); - fixture.AssertFullSemver("1.2.0+0"); - fixture.ApplyTag("1.2.0"); - fixture.AssertFullSemver("1.2.0"); - fixture.Checkout(developBranch); - fixture.MergeNoFF(release2Branch); - fixture.Repository.Branches.Remove(fixture.Repository.Branches[release2Branch]); - fixture.AssertFullSemver("1.3.0-alpha.2"); + // Release 1.2.0 + fixture.BranchTo(release2Branch); + fixture.MakeACommit("release stabilization"); + fixture.AssertFullSemver("1.2.0-beta.1+8"); + fixture.Checkout(MainBranch); + fixture.MergeNoFF(release2Branch); + fixture.AssertFullSemver("1.2.0-5"); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0"); + fixture.Checkout(developBranch); + fixture.MergeNoFF(release2Branch); + fixture.Repository.Branches.Remove(fixture.Repository.Branches[release2Branch]); + fixture.AssertFullSemver("1.3.0-alpha.1"); - // Hotfix - fixture.Checkout(MainBranch); - fixture.BranchTo(hotfixBranch); - fixture.MakeACommit("added hotfix"); - fixture.AssertFullSemver("1.2.1-beta.1+7"); - fixture.Checkout(MainBranch); - fixture.MergeNoFF(hotfixBranch); - fixture.AssertFullSemver("1.2.1+2"); - fixture.ApplyTag("1.2.1"); - fixture.AssertFullSemver("1.2.1"); - fixture.Checkout(developBranch); - fixture.MergeNoFF(hotfixBranch); - fixture.Repository.Branches.Remove(fixture.Repository.Branches[hotfixBranch]); - fixture.AssertFullSemver("1.3.0-alpha.9"); - } + // Hotfix + fixture.Checkout(MainBranch); + fixture.BranchTo(hotfixBranch); + fixture.MakeACommit("added hotfix"); + fixture.AssertFullSemver("1.2.1-beta.1+1"); + fixture.Checkout(MainBranch); + fixture.MergeNoFF(hotfixBranch); + fixture.AssertFullSemver("1.2.1-2"); + fixture.ApplyTag("1.2.1"); + fixture.AssertFullSemver("1.2.1"); + fixture.Checkout(developBranch); + fixture.MergeNoFF(hotfixBranch); + fixture.Repository.Branches.Remove(fixture.Repository.Branches[hotfixBranch]); + fixture.AssertFullSemver("1.3.0-alpha.2"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/HotfixBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/HotfixBranchScenarios.cs index 614260e171..8bd468453a 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/HotfixBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/HotfixBranchScenarios.cs @@ -1,10 +1,6 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -25,15 +21,15 @@ public void PatchLatestReleaseExample() fixture.Repository.MakeACommit(); fixture.AssertFullSemver("1.2.1-beta.1+2"); fixture.Repository.ApplyTag("1.2.1-beta.1"); - fixture.AssertFullSemver("1.2.1-beta.1"); + fixture.AssertFullSemver("1.2.1-beta.2+0"); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("1.2.1-beta.2+3"); + fixture.AssertFullSemver("1.2.1-beta.2+1"); // Merge hotfix branch to main Commands.Checkout(fixture.Repository, MainBranch); fixture.Repository.MergeNoFF("hotfix-1.2.1", Generate.SignatureNow()); - fixture.AssertFullSemver("1.2.1+4"); + fixture.AssertFullSemver("1.2.1-4"); fixture.Repository.ApplyTag("1.2.1"); fixture.AssertFullSemver("1.2.1"); @@ -43,7 +39,7 @@ public void PatchLatestReleaseExample() fixture.AssertFullSemver("1.3.0-alpha.1"); fixture.Repository.MergeNoFF("hotfix-1.2.1", Generate.SignatureNow()); - fixture.AssertFullSemver("1.3.0-alpha.5"); + fixture.AssertFullSemver("1.3.0-alpha.2"); } [Test] @@ -56,13 +52,15 @@ public void CanTakeVersionFromHotfixesBranch() r.MakeATaggedCommit("2.0.0"); }); // Merge hotfix branch to support - Commands.Checkout(fixture.Repository, MainBranch); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.FriendlyName == "1.1.0").Target)); + var branch = fixture.Repository.CreateBranch( + "support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.FriendlyName == "1.1.0").Target + ); + Commands.Checkout(fixture.Repository, branch); fixture.AssertFullSemver("1.1.0"); // create hotfix branch Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("hotfixes/1.1.1")); - fixture.AssertFullSemver("1.1.0"); // We are still on a tagged commit + fixture.AssertFullSemver("1.1.1-beta.1+0"); fixture.Repository.MakeACommit(); fixture.AssertFullSemver("1.1.1-beta.1+1"); @@ -80,44 +78,44 @@ public void PatchOlderReleaseExample() r.MakeATaggedCommit("2.0.0"); }); // Merge hotfix branch to support - Commands.Checkout(fixture.Repository, MainBranch); + fixture.Checkout(MainBranch); var tag = fixture.Repository.Tags.Single(t => t.FriendlyName == "1.1.0"); - var supportBranch = fixture.Repository.CreateBranch("support-1.1", (Commit)tag.Target); - Commands.Checkout(fixture.Repository, supportBranch); + fixture.Repository.CreateBranch("support-1.1", (Commit)tag.Target); + fixture.Checkout("support-1.1"); fixture.AssertFullSemver("1.1.0"); // create hotfix branch - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("hotfix-1.1.1")); - fixture.AssertFullSemver("1.1.0"); // We are still on a tagged commit - fixture.Repository.MakeACommit(); + fixture.BranchTo("hotfix-1.1.1"); + fixture.AssertFullSemver("1.1.1-beta.1+0"); + fixture.MakeACommit(); fixture.AssertFullSemver("1.1.1-beta.1+1"); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); fixture.AssertFullSemver("1.1.1-beta.1+2"); // Create feature branch off hotfix branch and complete - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("feature/fix")); + fixture.BranchTo("feature/fix"); fixture.AssertFullSemver("1.1.1-fix.1+2"); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); fixture.AssertFullSemver("1.1.1-fix.1+3"); - fixture.Repository.CreatePullRequestRef("feature/fix", "hotfix-1.1.1", normalise: true, prNumber: 8); - fixture.AssertFullSemver("1.1.1-PullRequest0008.4"); - Commands.Checkout(fixture.Repository, "hotfix-1.1.1"); - fixture.Repository.MergeNoFF("feature/fix", Generate.SignatureNow()); + fixture.Repository.CreatePullRequestRef("feature/fix", "hotfix-1.1.1", prNumber: 8, normalise: true); + fixture.AssertFullSemver("1.1.1-PullRequest8.4"); + fixture.Checkout("hotfix-1.1.1"); + fixture.MergeNoFF("feature/fix"); fixture.AssertFullSemver("1.1.1-beta.1+4"); // Merge hotfix into support branch to complete hotfix - Commands.Checkout(fixture.Repository, "support-1.1"); - fixture.Repository.MergeNoFF("hotfix-1.1.1", Generate.SignatureNow()); - fixture.AssertFullSemver("1.1.1+5"); - fixture.Repository.ApplyTag("1.1.1"); + fixture.Checkout("support-1.1"); + fixture.MergeNoFF("hotfix-1.1.1"); + fixture.AssertFullSemver("1.1.1-5"); + fixture.ApplyTag("1.1.1"); fixture.AssertFullSemver("1.1.1"); // Verify develop version - Commands.Checkout(fixture.Repository, "develop"); + fixture.Checkout("develop"); fixture.AssertFullSemver("2.1.0-alpha.1"); - fixture.Repository.MergeNoFF("support-1.1", Generate.SignatureNow()); + fixture.MergeNoFF("support-1.1"); fixture.AssertFullSemver("2.1.0-alpha.7"); } @@ -127,11 +125,9 @@ public void PatchOlderReleaseExample() [Test] public void FeatureOnHotfixFeatureBranchDeleted() { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .Build(); using var fixture = new EmptyRepositoryFixture(); const string release450 = "release/4.5.0"; @@ -140,38 +136,33 @@ public void FeatureOnHotfixFeatureBranchDeleted() const string tag450 = "4.5.0"; const string featureBranch = "feature/some-bug-fix"; - fixture.Repository.MakeACommit("initial"); - fixture.Repository.CreateBranch("develop"); - Commands.Checkout(fixture.Repository, "develop"); + fixture.MakeACommit("initial"); + fixture.BranchTo("develop"); // create release branch - fixture.Repository.CreateBranch(release450); - Commands.Checkout(fixture.Repository, release450); - fixture.AssertFullSemver("4.5.0-beta.0", config); - fixture.Repository.MakeACommit("blabla"); - Commands.Checkout(fixture.Repository, "develop"); - fixture.Repository.MergeNoFF(release450, Generate.SignatureNow()); - Commands.Checkout(fixture.Repository, MainBranch); - fixture.Repository.MergeNoFF(release450, Generate.SignatureNow()); + fixture.BranchTo(release450); + fixture.AssertFullSemver("4.5.0-beta.1+1", configuration); + fixture.MakeACommit("blabla"); + fixture.Checkout("develop"); + fixture.MergeNoFF(release450); + fixture.Checkout(MainBranch); + fixture.MergeNoFF(release450); // create support branch - fixture.Repository.CreateBranch(support45); - Commands.Checkout(fixture.Repository, support45); - fixture.Repository.ApplyTag(tag450); - fixture.AssertFullSemver("4.5.0", config); + fixture.BranchTo(support45); + fixture.ApplyTag(tag450); + fixture.AssertFullSemver("4.5.0", configuration); // create hotfix branch - fixture.Repository.CreateBranch(hotfix451); - Commands.Checkout(fixture.Repository, hotfix451); + fixture.BranchTo(hotfix451); // feature branch from hotfix - fixture.Repository.CreateBranch(featureBranch); - Commands.Checkout(fixture.Repository, featureBranch); - fixture.Repository.MakeACommit("blabla"); // commit 1 - Commands.Checkout(fixture.Repository, hotfix451); - fixture.Repository.MergeNoFF(featureBranch, Generate.SignatureNow()); // commit 2 + fixture.BranchTo(featureBranch); + fixture.MakeACommit("blabla"); // commit 1 + fixture.Checkout(hotfix451); + fixture.MergeNoFF(featureBranch); // commit 2 fixture.Repository.Branches.Remove(featureBranch); - fixture.AssertFullSemver("4.5.1-beta.2", config); + fixture.AssertFullSemver("4.5.1-beta.1+2", configuration); } /// @@ -180,11 +171,9 @@ public void FeatureOnHotfixFeatureBranchDeleted() [Test] public void FeatureOnHotfixFeatureBranchNotDeleted() { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .Build(); using var fixture = new EmptyRepositoryFixture(); const string release450 = "release/4.5.0"; @@ -193,37 +182,55 @@ public void FeatureOnHotfixFeatureBranchNotDeleted() const string tag450 = "4.5.0"; const string featureBranch = "feature/some-bug-fix"; - fixture.Repository.MakeACommit("initial"); - fixture.Repository.CreateBranch("develop"); - Commands.Checkout(fixture.Repository, "develop"); + fixture.MakeACommit("initial"); + fixture.BranchTo("develop"); // create release branch - fixture.Repository.CreateBranch(release450); - Commands.Checkout(fixture.Repository, release450); - fixture.AssertFullSemver("4.5.0-beta.0", config); - fixture.Repository.MakeACommit("blabla"); - Commands.Checkout(fixture.Repository, "develop"); - fixture.Repository.MergeNoFF(release450, Generate.SignatureNow()); - Commands.Checkout(fixture.Repository, MainBranch); - fixture.Repository.MergeNoFF(release450, Generate.SignatureNow()); + fixture.BranchTo(release450); + fixture.AssertFullSemver("4.5.0-beta.1+1", configuration); + fixture.MakeACommit("blabla"); + fixture.Checkout("develop"); + fixture.MergeNoFF(release450); + fixture.Checkout(MainBranch); + fixture.MergeNoFF(release450); // create support branch - fixture.Repository.CreateBranch(support45); - Commands.Checkout(fixture.Repository, support45); - fixture.Repository.ApplyTag(tag450); - fixture.AssertFullSemver("4.5.0", config); + fixture.BranchTo(support45); + fixture.ApplyTag(tag450); + fixture.AssertFullSemver("4.5.0", configuration); // create hotfix branch - fixture.Repository.CreateBranch(hotfix451); - Commands.Checkout(fixture.Repository, hotfix451); + fixture.BranchTo(hotfix451); // feature branch from hotfix - fixture.Repository.CreateBranch(featureBranch); - Commands.Checkout(fixture.Repository, featureBranch); - fixture.Repository.MakeACommit("blabla"); // commit 1 - Commands.Checkout(fixture.Repository, hotfix451); - fixture.Repository.MergeNoFF(featureBranch, Generate.SignatureNow()); // commit 2 - fixture.AssertFullSemver("4.5.1-beta.2", config); + fixture.BranchTo(featureBranch); + fixture.MakeACommit("blabla"); // commit 1 + fixture.Checkout(hotfix451); + fixture.MergeNoFF(featureBranch); // commit 2 + + fixture.AssertFullSemver("4.5.1-beta.1+2", configuration); } + [Test] + public void IsVersionTakenFromHotfixBranchName() + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new BaseGitFlowRepositoryFixture("4.20.4"); + + fixture.Checkout("develop"); + fixture.AssertFullSemver("4.21.0-alpha.1", configuration); + + fixture.BranchTo("release/4.21.1"); + fixture.AssertFullSemver("4.21.1-beta.1+1", configuration); + + fixture.MakeACommit(); + fixture.AssertFullSemver("4.21.1-beta.1+2", configuration); + + fixture.BranchTo("hotfix/4.21.1"); + fixture.AssertFullSemver("4.21.1-beta.1+2", configuration); + + fixture.MakeACommit(); + fixture.AssertFullSemver("4.21.1-beta.1+3", configuration); + } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs deleted file mode 100644 index 78ba4c9c25..0000000000 --- a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs +++ /dev/null @@ -1,33 +0,0 @@ -using GitTools.Testing; -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using NSubstitute; -using NUnit.Framework; - -namespace GitVersion.Core.Tests.IntegrationTests; - -[TestFixture] -public class IgnoreBeforeScenarios : TestBase -{ - [Test] - public void ShouldFallbackToBaseVersionWhenAllCommitsAreIgnored() - { - using var fixture = new EmptyRepositoryFixture(); - var objectId = fixture.Repository.MakeACommit(); - var commit = Substitute.For(); - commit.Sha.Returns(objectId.Sha); - commit.When.Returns(DateTimeOffset.Now); - - var config = new ConfigurationBuilder() - .Add(new Config - { - Ignore = new IgnoreConfig - { - Before = commit.When.AddMinutes(1) - } - }).Build(); - - fixture.AssertFullSemver("0.1.0+0", config); - } -} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs new file mode 100644 index 0000000000..a789867705 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs @@ -0,0 +1,436 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class IgnoreCommitScenarios : TestBase +{ + [Test] + public void ShouldThrowGitVersionExceptionWhenAllCommitsAreIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + var dateTimeNow = DateTimeOffset.Now; + fixture.MakeACommit(); + + var configuration = GitFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Before = dateTimeNow.AddYears(1) }).Build(); + + Should.Throw(() => fixture.GetVersion(configuration)) + .Message.ShouldBe("No commits found on the current branch."); + } + + [TestCase(null, "0.0.1-1")] + [TestCase("0.0.1", "0.0.1-1")] + [TestCase("0.1.0", "0.1.0-1")] + [TestCase("1.0.0", "1.0.0-1")] + public void ShouldNotFallbackToBaseVersionWhenAllCommitsAreNotIgnored(string? nextVersion, string expectedFullSemVer) + { + using var fixture = new EmptyRepositoryFixture(); + var dateTimeNow = DateTimeOffset.Now; + fixture.MakeACommit(); + + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion(nextVersion) + .WithIgnoreConfiguration(new IgnoreConfiguration { Before = dateTimeNow.AddYears(-1) }).Build(); + + fixture.AssertFullSemver(expectedFullSemVer, configuration); + } + + [Test] + public void GivenTrunkBasedWorkflowWithCommitParameterThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = TrunkBasedConfigurationBuilder.New.Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2", configuration, commitId: commitB.Sha); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", configuration); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitBAndCommitParameterAThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2", configuration, commitId: commitC.Sha); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitCAndCommitParameterCThenCommitBShouldBeUsed() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.2", configuration, commitId: commitC.Sha); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForTaggedCommitThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("D"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.3", configuration); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationBeforeCommitWithTagThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("D"); + + var before = commitC.Committer.When.AddSeconds(1); + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Before = before }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1", configuration); + } + + [TestCase(false, "1.0.1-0")] + [TestCase(true, "1.0.0")] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationOfCommitBThenTagShouldBeConsidered( + bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + var commitB = fixture.Repository.MakeACommit("B"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .WithBranch("main", b => b.WithIncrement(IncrementStrategy.Patch) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + .WithDeploymentMode(GitVersion.VersionCalculation.DeploymentMode.ContinuousDelivery) + ).Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration); + } + + [TestCase(false, "1.0.1-0")] + [TestCase(true, "1.0.0")] + public void GivenTrunkBasedWorkflowWithCommitParameterBThenTagShouldBeConsidered( + bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithBranch("main", b => b.WithIncrement(IncrementStrategy.Patch) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + .WithDeploymentMode(GitVersion.VersionCalculation.DeploymentMode.ContinuousDelivery) + ).Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration, commitId: commitA.Sha); + } + + [Test] + public void GivenGitHubFlowBasedWorkflowWithCommitParameterThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = GitHubFlowConfigurationBuilder.New.Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2", configuration, commitId: commitB.Sha); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-3", configuration); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitBAndCommitParameterAThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.MakeACommit("D"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2", configuration, commitId: commitC.Sha); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitCAndCommitParameterCThenCommitBShouldBeUsed() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-2", configuration, commitId: commitC.Sha); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForTaggedCommitThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("D"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-3", configuration); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationBeforeCommitWithTagThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("D"); + + var before = commitC.Committer.When.AddSeconds(1); + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Before = before }) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1", configuration); + } + + [TestCase(false, "1.0.1-0")] + [TestCase(true, "1.0.0")] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationOfCommitBThenTagShouldBeConsidered( + bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + var commitB = fixture.Repository.MakeACommit("B"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] }) + .WithBranch("main", b => b.WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged)) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration); + } + + [TestCase(false, "1.0.1-0")] + [TestCase(true, "1.0.0")] + public void GivenGitHubFlowWorkflowWithCommitParameterBThenTagShouldBeConsidered( + bool preventIncrementWhenCurrentCommitTagged, string semanticVersion) + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("B"); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", b => b.WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged)) + .Build(); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration, commitId: commitA.Sha); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForPathThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var ignoredPath = fixture.Repository.Diff.Compare(commitA.Tree, commitB.Tree).Select(element => element.Path).First(); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Paths = { ignoredPath } }) + .Build(); + + // commitB should be ignored, so version should be as if B didn't exist + fixture.AssertFullSemver("0.0.3", configuration); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForPathAndCommitParameterCThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + fixture.MakeACommit("B"); + var commitC = fixture.Repository.MakeACommit("C"); + fixture.MakeACommit("D"); + + var ignoredPath = fixture.Repository.Diff.Compare(commitA.Tree, commitC.Tree).Select(element => element.Path).First(); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Paths = { ignoredPath } }) + .Build(); + + // commitC should be ignored, so version should be as if C didn't exist + fixture.AssertFullSemver("0.0.2", configuration, commitId: commitC.Sha); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForPathThenVersionShouldBeCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + + var ignoredPath = fixture.Repository.Diff.Compare(commitA.Tree, commitB.Tree).Select(element => element.Path).First(); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Paths = { ignoredPath } }) + .Build(); + + // commitB should be ignored, so version should be as if B didn't exist + fixture.AssertFullSemver("0.0.1-3", configuration); + } + + [Test] + public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForTaggedCommitPathThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("C"); + + var ignoredPath = fixture.Repository.Diff.Compare(commitA.Tree, commitB.Tree).Select(element => element.Path).First(); + + var configuration = TrunkBasedConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Paths = { ignoredPath } }) + .Build(); + + // commitB should be ignored, so version should be as if B didn't exist + fixture.AssertFullSemver("0.0.2", configuration); + } + + [Test] + public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForTaggedCommitPathThenTagShouldBeIgnored() + { + using var fixture = new EmptyRepositoryFixture(); + + var commitA = fixture.Repository.MakeACommit("A"); + var commitB = fixture.Repository.MakeACommit("B"); + fixture.ApplyTag("1.0.0"); + fixture.MakeACommit("C"); + + var ignoredPath = fixture.Repository.Diff.Compare(commitA.Tree, commitB.Tree).Select(element => element.Path).First(); + + var configuration = GitHubFlowConfigurationBuilder.New + .WithIgnoreConfiguration(new IgnoreConfiguration { Paths = { ignoredPath } }) + .Build(); + + // commitB should be ignored, so version should be as if B didn't exist + fixture.AssertFullSemver("0.0.1-2", configuration); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs index 4b53420583..86f6280cd8 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs @@ -1,55 +1,52 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; [TestFixture] public class MainScenarios : TestBase { + [Test] + public void CanHandleManualDeployment() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeATaggedCommit("1.0.0"); + fixture.Repository.MakeCommits(2); + fixture.AssertFullSemver("1.0.1-1+2", configuration); + } + [Test] public void CanHandleContinuousDelivery() { - var config = new Config - { - Branches = - { - { - MainBranch, new BranchConfig - { - VersioningMode = VersioningMode.ContinuousDelivery - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder + .WithLabel("ci").WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("1.0.1+2", config); + fixture.AssertFullSemver("1.0.1-ci.2", configuration); } [Test] public void CanHandleContinuousDeployment() { - var config = new Config - { - Branches = - { - { - MainBranch, new BranchConfig - { - VersioningMode = VersioningMode.ContinuousDeployment - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder + .WithLabel("ci").WithDeploymentMode(DeploymentMode.ContinuousDeployment)) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("1.0.1-ci.2", config); + fixture.AssertFullSemver("1.0.1", configuration); } [Test] @@ -62,7 +59,7 @@ public void GivenARepositoryWithCommitsButNoTagsVersionShouldBe01() fixture.Repository.MakeACommit(); // When - fixture.AssertFullSemver("0.1.0+2"); + fixture.AssertFullSemver("0.0.1-3"); } [Test] @@ -76,7 +73,7 @@ public void GivenARepositoryWithCommitsButBadTagsVersionShouldBe01() fixture.Repository.MakeACommit(); // When - fixture.AssertFullSemver("0.1.0+2"); + fixture.AssertFullSemver("0.0.1-3"); } [Test] @@ -84,39 +81,79 @@ public void GivenARepositoryWithCommitsButNoTagsWithDetachedHeadVersionShouldBe0 { using var fixture = new EmptyRepositoryFixture(); // Given - fixture.Repository.MakeACommit(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeACommit(); + fixture.Repository.MakeACommit("one"); + fixture.Repository.MakeACommit("two"); + fixture.Repository.MakeACommit("three"); var commit = fixture.Repository.Head.Tip; fixture.Repository.MakeACommit(); Commands.Checkout(fixture.Repository, commit); // When - fixture.AssertFullSemver("0.1.0+2", onlyTrackedBranches: false); + fixture.AssertFullSemver("0.0.1-3", onlyTrackedBranches: false); } [Test] public void GivenARepositoryWithTagAndNextVersionInConfigVersionShouldMatchVersionTxtFile() { const string expectedNextVersion = "1.1.0"; - var config = new Config { NextVersion = expectedNextVersion }; + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion(expectedNextVersion).Build(); using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.1.0+5", config); + fixture.AssertFullSemver("1.1.0-5", configuration); } [Test] public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommitsVersionShouldBeTag() { + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.1.0").Build(); + using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.AssertFullSemver("1.0.3"); + fixture.AssertFullSemver("1.0.3", configuration); + } - fixture.AssertFullSemver("1.0.3", new Config { NextVersion = "1.1.0" }); + [Test] + public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommitsVersionShouldBeTag2() + { + using var fixture = new EmptyRepositoryFixture(); + const string taggedVersion = "1.0.3"; + fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.4-1"); + + // I'm not sure if the postfix +1 is correct here... + // but the next version configuration property is something for the user to manipulate the resulting version. + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.1.0").Build(); + fixture.AssertFullSemver("1.1.0-1", configuration); + } + + [Test] + public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommitsVersionShouldBeTag3() + { + using var fixture = new EmptyRepositoryFixture(); + const string taggedVersion = "1.0.3"; + fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.AssertFullSemver("1.0.3"); + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.0.2").Build(); + fixture.AssertFullSemver("1.0.3", configuration); + } + + [Test] + public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommitsVersionShouldBeTag4() + { + using var fixture = new EmptyRepositoryFixture(); + const string taggedVersion = "1.0.3"; + fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.4-1"); + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.0.4").Build(); + fixture.AssertFullSemver("1.0.4-1", configuration); } [Test] @@ -127,7 +164,7 @@ public void GivenARepositoryWithTagAndNoNextVersionTxtFileVersionShouldBeTagWith fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.0.4+5"); + fixture.AssertFullSemver("1.0.4-5"); } [Test] @@ -135,7 +172,7 @@ public void GivenARepositoryWithTagAndNoNextVersionTxtFileAndNoCommitsVersionSho { using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.0.3"; - fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.MakeATaggedCommit(taggedVersion); fixture.AssertFullSemver("1.0.3"); } @@ -145,10 +182,11 @@ public void GivenARepositoryWithTagAndOldNextVersionConfigVersionShouldBeTagWith { using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.1.0"; - fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.1.1+5", new Config { NextVersion = "1.0.0" }); + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.0.0").Build(); + fixture.AssertFullSemver("1.1.1-5", configuration); } [Test] @@ -158,7 +196,8 @@ public void GivenARepositoryWithTagAndOldNextVersionConfigAndNoCommitsVersionSho const string taggedVersion = "1.1.0"; fixture.Repository.MakeATaggedCommit(taggedVersion); - fixture.AssertFullSemver("1.1.0", new Config { NextVersion = "1.0.0" }); + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("1.0.0").Build(); + fixture.AssertFullSemver("1.1.0", configuration); } [Test] @@ -169,41 +208,214 @@ public void CanSpecifyTagPrefixes() fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.0.4+5", new Config { TagPrefix = "version-" }); + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefixPattern("version-").Build(); + fixture.AssertFullSemver("1.0.4-5", configuration); } [Test] public void CanSpecifyTagPrefixesAsRegex() { - var config = new Config { TagPrefix = "version-|[vV]" }; + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefixPattern($"version-|{RegexPatterns.Configuration.DefaultTagPrefixRegexPattern}").Build(); using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "v1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.0.4+5", config); + fixture.AssertFullSemver("1.0.4-5", configuration); taggedVersion = "version-1.0.5"; fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.0.6+5", config); + fixture.AssertFullSemver("1.0.6-5", configuration); } [Test] public void AreTagsNotAdheringToTagPrefixIgnored() { - var config = new Config { TagPrefix = "" }; + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefixPattern("").Build(); using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "version-1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("0.1.0+5", config); //Fallback version + 5 commits since tag + fixture.AssertFullSemver("0.0.1-6", configuration); taggedVersion = "bad/1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); - fixture.AssertFullSemver("0.1.0+6", config); //Fallback version + 6 commits since tag + fixture.AssertFullSemver("0.0.1-7", configuration); + } + + [Test] + public void NextVersionShouldBeConsideredOnTheDevelopmentBranch() + { + using var fixture = new EmptyRepositoryFixture("develop"); + + var configurationBuilder = GitFlowConfigurationBuilder.New; + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.1", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-alpha.1", configurationBuilder.Build()); + + fixture.MakeACommit(); + configurationBuilder.WithNextVersion(null); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-alpha.2", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-alpha.2", configurationBuilder.Build()); + } + + /// + /// Prevent decrementation of versions on the develop branch #3177 + /// (see https://github.com/GitTools/GitVersion/discussions/3177) + /// + [Test] + public void PreventDecrementationOfVersionsOnTheDevelopmentBranch() + { + using var fixture = new EmptyRepositoryFixture("develop"); + + var configurationBuilder = GitFlowConfigurationBuilder.New; + + configurationBuilder.WithNextVersion("1.0.0"); + fixture.MakeACommit(); + + // now we are ready to start with the preparation of the 1.0.0 release + fixture.BranchTo("release/1.0.0"); + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configurationBuilder.Build()); + + fixture.Checkout("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+1", configurationBuilder.Build()); + + // make another commit on release/1.0.0 to prepare the actual beta1 release + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.1+2", configurationBuilder.Build()); + + // now we make changes on develop that may or may not end up in the 1.0.0 release + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configurationBuilder.Build()); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configurationBuilder.Build()); + + // now we do the actual release of beta 1 + fixture.Checkout("release/1.0.0"); + fixture.ApplyTag("1.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+0", configurationBuilder.Build()); + + // continue with more work on develop that may or may not end up in the 1.0.0 release + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1", configurationBuilder.Build()); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.2", configurationBuilder.Build()); + + // now we decide that the new on develop should be part of the beta 2 release, + // so we merge it into release/1.0.0 with --no-ff because it is a protected branch, + // but we don't do the release of beta 2 just yet + fixture.Checkout("release/1.0.0"); + fixture.MergeNoFF("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.2+3", configurationBuilder.Build()); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configurationBuilder.Build()); + + fixture.Checkout("release/1.0.0"); + fixture.ApplyTag("1.0.0-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-beta.3+0", configurationBuilder.Build()); + + fixture.Checkout("develop"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.0", configurationBuilder.Build()); + + fixture.MergeNoFF("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.3", configurationBuilder.Build()); + + fixture.Repository.Branches.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.6", configurationBuilder.Build()); + + fixture.Repository.Tags.Remove("1.0.0-beta.1"); + fixture.Repository.Tags.Remove("1.0.0-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.6", configurationBuilder.Build()); + + configurationBuilder.WithNextVersion("1.1.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.6", configurationBuilder.Build()); + } + + [TestCase(true, "1.1.0-4")] + [TestCase(false, "1.0.1-4")] + public void TrackMergeMessageShouldBeConsideredOnTheMainBranch(bool trackMergeMessage, string expectedSemanticVersion) + { + using var fixture = new EmptyRepositoryFixture(); + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder.WithTrackMergeMessage(trackMergeMessage)) + .Build(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("release/1.1.0"); + fixture.MakeACommit(); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+2", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1", configuration); + + fixture.MergeNoFF("release/1.1.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(expectedSemanticVersion, configuration); + + fixture.Remove("release/1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(expectedSemanticVersion, configuration); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentMode.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentScenarios.cs similarity index 55% rename from src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentMode.cs rename to src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentScenarios.cs index 202820d0e8..2ac097c7c9 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentMode.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainlineDevelopmentScenarios.cs @@ -1,59 +1,68 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; -using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.IntegrationTests; -public class MainlineDevelopmentMode : TestBase +public class MainlineDevelopmentScenarios : TestBase { - private readonly Config config = new() { VersioningMode = VersioningMode.Mainline }; - - [Test] - public void VerifyNonMainMainlineVersionIdenticalAsMain() - { - using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit("1"); - - fixture.BranchTo("feature/foo", "foo"); - fixture.MakeACommit("2 +semver: major"); - fixture.Checkout(MainBranch); - fixture.MergeNoFF("feature/foo"); - - fixture.AssertFullSemver("1.0.0", this.config); - - fixture.BranchTo("support/1.0", "support"); - - fixture.AssertFullSemver("1.0.0", this.config); - } + private static GitFlowConfigurationBuilder GetConfigurationBuilder() => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", builder => builder + .WithIsMainBranch(true).WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ContinuousDeployment) + .WithSourceBranches() + ) + .WithBranch("develop", builder => builder + .WithIsMainBranch(false).WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithSourceBranches("main") + ) + .WithBranch("feature", builder => builder + .WithIsMainBranch(false).WithIncrement(IncrementStrategy.Minor) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithSourceBranches("main") + ) + .WithBranch("hotfix", builder => builder + .WithIsMainBranch(false).WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithRegularExpression(@"^hotfix[\/-](?.+)").WithLabel("{BranchName}") + .WithSourceBranches("main") + ) + .WithBranch("pull-request", builder => builder + .WithIsMainBranch(false).WithIncrement(IncrementStrategy.Inherit) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithSourceBranches("main") + ); [Test] public void MergedFeatureBranchesToMainImpliesRelease() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("1"); fixture.MakeATaggedCommit("1.0.0"); fixture.BranchTo("feature/foo", "foo"); fixture.MakeACommit("2"); - fixture.AssertFullSemver("1.0.1-foo.1", this.config); + fixture.AssertFullSemver("1.0.1-foo.1", configuration); fixture.MakeACommit("2.1"); - fixture.AssertFullSemver("1.0.1-foo.2", this.config); + fixture.AssertFullSemver("1.0.1-foo.2", configuration); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.0.1", this.config); + fixture.AssertFullSemver("1.0.1", configuration); fixture.BranchTo("feature/foo2", "foo2"); fixture.MakeACommit("3 +semver: minor"); - fixture.AssertFullSemver("1.1.0-foo2.1", this.config); + fixture.AssertFullSemver("1.1.0-foo2.1", configuration); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo2"); - fixture.AssertFullSemver("1.1.0", this.config); + fixture.AssertFullSemver("1.1.0", configuration); fixture.BranchTo("feature/foo3", "foo3"); fixture.MakeACommit("4"); @@ -62,94 +71,97 @@ public void MergedFeatureBranchesToMainImpliesRelease() fixture.SequenceDiagram.NoteOver("Merge message contains '+semver: minor'", MainBranch); var commit = fixture.Repository.Head.Tip; // Put semver increment in merge message - fixture.Repository.Commit(commit.Message + " +semver: minor", commit.Author, commit.Committer, new CommitOptions { AmendPreviousCommit = true }); - fixture.AssertFullSemver("1.2.0", this.config); + fixture.Repository.Commit(commit.Message + " +semver: minor", commit.Author, commit.Committer, new() { AmendPreviousCommit = true }); + fixture.AssertFullSemver("1.2.0", configuration); fixture.BranchTo("feature/foo4", "foo4"); fixture.MakeACommit("5 +semver: major"); - fixture.AssertFullSemver("2.0.0-foo4.1", this.config); + fixture.AssertFullSemver("2.0.0-foo4.1", configuration); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo4"); - fixture.AssertFullSemver("2.0.0", this.config); + fixture.AssertFullSemver("2.0.0", configuration); // We should evaluate any commits not included in merge commit calculations for direct commit/push or squash to merge commits fixture.MakeACommit("6 +semver: major"); - fixture.AssertFullSemver("3.0.0", this.config); + fixture.AssertFullSemver("3.0.0", configuration); fixture.MakeACommit("7 +semver: minor"); - fixture.AssertFullSemver("3.1.0", this.config); + fixture.AssertFullSemver("3.1.0", configuration); fixture.MakeACommit("8"); - fixture.AssertFullSemver("3.1.1", this.config); + fixture.AssertFullSemver("3.1.1", configuration); // Finally verify that the merge commits still function properly fixture.BranchTo("feature/foo5", "foo5"); fixture.MakeACommit("9 +semver: minor"); - fixture.AssertFullSemver("3.2.0-foo5.1", this.config); + fixture.AssertFullSemver("3.2.0-foo5.1", configuration); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo5"); - fixture.AssertFullSemver("3.2.0", this.config); + fixture.AssertFullSemver("3.2.0", configuration); // One more direct commit for good measure fixture.MakeACommit("10 +semver: minor"); - fixture.AssertFullSemver("3.3.0", this.config); + fixture.AssertFullSemver("3.3.0", configuration); // And we can commit without bumping semver fixture.MakeACommit("11 +semver: none"); - fixture.AssertFullSemver("3.3.0", this.config); + fixture.AssertFullSemver("3.3.1", configuration); Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); } [Test] - public void VerifyPullRequestsActLikeContinuousDelivery() + public void VerifyPullRequestsActLikeContinuousDeliveryOnFeatureBranch() { + var configuration = GetConfigurationBuilder().Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit("1"); + + fixture.MakeACommit("1"); + + fixture.AssertFullSemver("0.0.1", configuration); + fixture.MakeATaggedCommit("1.0.0"); - fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.1", this.config); + fixture.MakeACommit("2"); + + fixture.AssertFullSemver("1.0.1", configuration); fixture.BranchTo("feature/foo", "foo"); - fixture.AssertFullSemver("1.0.2-foo.0", this.config); - fixture.MakeACommit(); - fixture.MakeACommit(); - fixture.Repository.CreatePullRequestRef("feature/foo", MainBranch, normalise: true, prNumber: 8); - fixture.AssertFullSemver("1.0.2-PullRequest0008.3", this.config); + fixture.AssertFullSemver("1.1.0-foo.0", configuration); + fixture.MakeACommit("3"); + fixture.MakeACommit("4"); + fixture.Repository.CreatePullRequestRef("feature/foo", MainBranch, prNumber: 8, normalise: true); + fixture.AssertFullSemver("1.1.0-PullRequest8.3", configuration); } [Test] - public void SupportBranches() + public void VerifyPullRequestsActLikeContinuousDeliveryOnHotfixBranch() { + var configuration = GetConfigurationBuilder().Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit("1"); + + fixture.MakeACommit("1"); + + fixture.AssertFullSemver("0.0.1", configuration); + fixture.MakeATaggedCommit("1.0.0"); - fixture.MakeACommit(); // 1.0.1 - fixture.MakeACommit(); // 1.0.2 - fixture.AssertFullSemver("1.0.2", this.config); + fixture.MakeACommit("2"); - fixture.BranchTo("support/1.0", "support10"); - fixture.AssertFullSemver("1.0.2", this.config); + fixture.AssertFullSemver("1.0.1", configuration); - // Move main on - fixture.Checkout(MainBranch); - fixture.MakeACommit("+semver: major"); // 2.0.0 (on main) - fixture.AssertFullSemver("2.0.0", this.config); - - // Continue on support/1.0 - fixture.Checkout("support/1.0"); - fixture.MakeACommit(); // 1.0.3 - fixture.MakeACommit(); // 1.0.4 - fixture.AssertFullSemver("1.0.4", this.config); - fixture.BranchTo("feature/foo", "foo"); - fixture.AssertFullSemver("1.0.5-foo.0", this.config); - fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.5-foo.1", this.config); - fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.5-foo.2", this.config); - fixture.Repository.CreatePullRequestRef("feature/foo", "support/1.0", normalise: true, prNumber: 7); - fixture.AssertFullSemver("1.0.5-PullRequest0007.3", this.config); + fixture.BranchTo("hotfix/foo", "foo"); + fixture.AssertFullSemver("1.0.2-foo.0", configuration); + fixture.MakeACommit("3"); + fixture.MakeACommit("4"); + fixture.Repository.CreatePullRequestRef("hotfix/foo", MainBranch, prNumber: 8, normalise: true); + fixture.AssertFullSemver("1.0.2-PullRequest8.3", configuration); } [Test] public void VerifyForwardMerge() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("1"); fixture.MakeATaggedCommit("1.0.0"); @@ -157,53 +169,27 @@ public void VerifyForwardMerge() fixture.BranchTo("feature/foo", "foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.2-foo.1", this.config); + fixture.AssertFullSemver("1.0.2-foo.1", configuration); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.2-foo.2", this.config); + fixture.AssertFullSemver("1.0.2-foo.2", configuration); fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.2", this.config); + fixture.AssertFullSemver("1.0.2", configuration); fixture.Checkout("feature/foo"); // This may seem surprising, but this happens because we branched off mainline // and incremented. Mainline has then moved on. We do not follow mainline // in feature branches, you need to merge mainline in to get the mainline version - fixture.AssertFullSemver("1.0.2-foo.2", this.config); + fixture.AssertFullSemver("1.0.2-foo.2", configuration); fixture.MergeNoFF(MainBranch); - fixture.AssertFullSemver("1.0.3-foo.3", this.config); - } - - [Test] - public void VerifySupportForwardMerge() - { - using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit("1"); - fixture.MakeATaggedCommit("1.0.0"); - fixture.MakeACommit(); // 1.0.1 - - fixture.BranchTo("support/1.0", "support10"); - fixture.MakeACommit(); - fixture.MakeACommit(); - - fixture.Checkout(MainBranch); - fixture.MakeACommit("+semver: minor"); - fixture.AssertFullSemver("1.1.0", this.config); - fixture.MergeNoFF("support/1.0"); - fixture.AssertFullSemver("1.1.1", this.config); - fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.2", this.config); - fixture.Checkout("support/1.0"); - fixture.AssertFullSemver("1.0.3", this.config); - - fixture.BranchTo("feature/foo", "foo"); - fixture.MakeACommit(); - fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.4-foo.2", this.config); // TODO This probably should be 1.0.5 + fixture.AssertFullSemver("1.0.3-foo.3", configuration); } [Test] public void VerifyDevelopTracksMainVersion() { + var configuration = GetConfigurationBuilder().Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("1"); fixture.MakeATaggedCommit("1.0.0"); @@ -211,36 +197,40 @@ public void VerifyDevelopTracksMainVersion() // branching increments the version fixture.BranchTo("develop"); - fixture.AssertFullSemver("1.1.0-alpha.0", this.config); + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); // merging develop into main increments minor version on main fixture.Checkout(MainBranch); fixture.MergeNoFF("develop"); - fixture.AssertFullSemver("1.1.0", this.config); + fixture.AssertFullSemver("1.1.0", configuration); // a commit on develop before the merge still has the same version number fixture.Checkout("develop"); - fixture.AssertFullSemver("1.1.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); // moving on to further work on develop tracks main's version from the merge fixture.MakeACommit(); - fixture.AssertFullSemver("1.2.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); // adding a commit to main increments patch fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.1", this.config); + fixture.AssertFullSemver("1.1.1", configuration); - // adding a commit to main doesn't change develop's version + // adding a commit to main doesn't change develop 's version fixture.Checkout("develop"); - fixture.AssertFullSemver("1.2.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.2", configuration); } [Test] public void VerifyDevelopFeatureTracksMainVersion() { + var configuration = GetConfigurationBuilder().WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("1"); fixture.MakeATaggedCommit("1.0.0"); @@ -248,46 +238,51 @@ public void VerifyDevelopFeatureTracksMainVersion() // branching increments the version fixture.BranchTo("develop"); - fixture.AssertFullSemver("1.1.0-alpha.0", this.config); + fixture.AssertFullSemver("1.1.0-alpha.0", configuration); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); // merging develop into main increments minor version on main fixture.Checkout(MainBranch); fixture.MergeNoFF("develop"); - fixture.AssertFullSemver("1.1.0", this.config); + fixture.AssertFullSemver("1.1.0", configuration); // a commit on develop before the merge still has the same version number fixture.Checkout("develop"); - fixture.AssertFullSemver("1.1.0-alpha.1", this.config); + fixture.AssertFullSemver("1.1.0-alpha.1", configuration); // a branch from develop before the merge tracks the pre-merge version from main // (note: the commit on develop looks like a commit to this branch, thus the .1) fixture.BranchTo("feature/foo"); - fixture.AssertFullSemver("1.0.2-foo.1", this.config); + fixture.AssertFullSemver("1.1.0-foo.1", configuration); // further work on the branch tracks the merged version from main fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.1-foo.1", this.config); + fixture.AssertFullSemver("1.1.0-foo.2", configuration); // adding a commit to main increments patch fixture.Checkout(MainBranch); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.1", this.config); + fixture.AssertFullSemver("1.1.1", configuration); // adding a commit to main doesn't change the feature's version fixture.Checkout("feature/foo"); - fixture.AssertFullSemver("1.1.1-foo.1", this.config); + fixture.AssertFullSemver("1.1.0-foo.2", configuration); // merging the feature to develop increments develop fixture.Checkout("develop"); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.2.0-alpha.2", this.config); + fixture.AssertFullSemver("1.1.0-alpha.3", configuration); } [Test] public void VerifyMergingMainToFeatureDoesNotCauseBranchCommitsToIncrementVersion() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit($"first in {MainBranch}"); @@ -305,12 +300,17 @@ public void VerifyMergingMainToFeatureDoesNotCauseBranchCommitsToIncrementVersio fixture.MakeATaggedCommit("1.0.0"); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.0.1", this.config); + fixture.AssertFullSemver("1.0.1", configuration); } [Test] public void VerifyMergingMainToFeatureDoesNotStopMainCommitsIncrementingVersion() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit($"first in {MainBranch}"); @@ -327,14 +327,20 @@ public void VerifyMergingMainToFeatureDoesNotStopMainCommitsIncrementingVersion( fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.0.2", this.config); + fixture.AssertFullSemver("1.0.2", configuration); } [Test] public void VerifyIssue1154CanForwardMergeMainToFeatureBranch() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); + fixture.AssertFullSemver("0.0.1", configuration); fixture.BranchTo("feature/branch2"); fixture.BranchTo("feature/branch1"); fixture.MakeACommit(); @@ -342,7 +348,7 @@ public void VerifyIssue1154CanForwardMergeMainToFeatureBranch() fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/branch1"); - fixture.AssertFullSemver("0.1.1", this.config); + fixture.AssertFullSemver("0.0.2", configuration); fixture.Checkout("feature/branch2"); fixture.MakeACommit(); @@ -350,12 +356,17 @@ public void VerifyIssue1154CanForwardMergeMainToFeatureBranch() fixture.MakeACommit(); fixture.MergeNoFF(MainBranch); - fixture.AssertFullSemver("0.1.2-branch2.4", this.config); + fixture.AssertFullSemver("0.0.3-branch2.4", configuration); } [Test] public void VerifyMergingMainIntoAFeatureBranchWorksWithMultipleBranches() { + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithIncrement(IncrementStrategy.Patch) + ).Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit($"first in {MainBranch}"); @@ -381,49 +392,55 @@ public void VerifyMergingMainIntoAFeatureBranchWorksWithMultipleBranches() fixture.MergeNoFF("feature/foo"); fixture.MergeNoFF("feature/bar"); - fixture.AssertFullSemver("1.0.2", this.config); + fixture.AssertFullSemver("1.0.2", configuration); } [Test] public void MergingFeatureBranchThatIncrementsMinorNumberIncrementsMinorVersionOfMain() { - var currentConfig = new Config { VersioningMode = VersioningMode.Mainline, Branches = new Dictionary { { "feature", new BranchConfig { VersioningMode = VersioningMode.ContinuousDeployment, Increment = IncrementStrategy.Minor } } } }; + var configuration = GetConfigurationBuilder() + .WithBranch("feature", builder => builder + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithIncrement(IncrementStrategy.Minor) + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit($"first in {MainBranch}"); fixture.MakeATaggedCommit("1.0.0"); - fixture.AssertFullSemver("1.0.0", currentConfig); + fixture.AssertFullSemver("1.0.0", configuration); fixture.BranchTo("feature/foo", "foo"); fixture.MakeACommit("first in foo"); fixture.MakeACommit("second in foo"); - fixture.AssertFullSemver("1.1.0-foo.2", currentConfig); + fixture.AssertFullSemver("1.1.0-foo.2", configuration); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.1.0", currentConfig); + fixture.AssertFullSemver("1.1.0", configuration); } [Test] public void VerifyIncrementConfigIsHonoured() { - var minorIncrementConfig = new Config - { - VersioningMode = VersioningMode.Mainline, - Increment = IncrementStrategy.Minor, - Branches = new Dictionary - { - { MainBranch, new BranchConfig { Increment = IncrementStrategy.Minor, Name = MainBranch, Regex = MainBranch } }, - { "feature", new BranchConfig { Increment = IncrementStrategy.Minor, Name = "feature", Regex = "features?[/-]" } } - } - }; + var minorIncrementConfig = GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", builder => builder + .WithDeploymentMode(DeploymentMode.ContinuousDeployment) + .WithIncrement(IncrementStrategy.None) + ) + .WithBranch("feature", builder => builder + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithIncrement(IncrementStrategy.None) + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("1"); fixture.MakeATaggedCommit("1.0.0"); fixture.BranchTo("feature/foo", "foo"); - fixture.MakeACommit("2"); + fixture.MakeACommit("2 +semver: minor"); fixture.AssertFullSemver("1.1.0-foo.1", minorIncrementConfig); fixture.MakeACommit("2.1"); fixture.AssertFullSemver("1.1.0-foo.2", minorIncrementConfig); @@ -446,20 +463,21 @@ public void VerifyIncrementConfigIsHonoured() fixture.SequenceDiagram.NoteOver("Merge message contains '+semver: patch'", MainBranch); var commit = fixture.Repository.Head.Tip; // Put semver increment in merge message - fixture.Repository.Commit(commit.Message + " +semver: patch", commit.Author, commit.Committer, new CommitOptions { AmendPreviousCommit = true }); + fixture.Repository.Commit(commit.Message + " +semver: patch", commit.Author, commit.Committer, new() { AmendPreviousCommit = true }); fixture.AssertFullSemver("1.1.2", minorIncrementConfig); + var configuration = GetConfigurationBuilder().Build(); fixture.BranchTo("feature/foo4", "foo4"); fixture.MakeACommit("5 +semver: major"); fixture.AssertFullSemver("2.0.0-foo4.1", minorIncrementConfig); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo4"); - fixture.AssertFullSemver("2.0.0", this.config); + fixture.AssertFullSemver("2.0.0", configuration); // We should evaluate any commits not included in merge commit calculations for direct commit/push or squash to merge commits fixture.MakeACommit("6 +semver: major"); fixture.AssertFullSemver("3.0.0", minorIncrementConfig); - fixture.MakeACommit("7"); + fixture.MakeACommit("7 +semver: minor"); fixture.AssertFullSemver("3.1.0", minorIncrementConfig); fixture.MakeACommit("8 +semver: patch"); fixture.AssertFullSemver("3.1.1", minorIncrementConfig); @@ -484,66 +502,56 @@ public void VerifyIncrementConfigIsHonoured() [Test] public void BranchWithoutMergeBaseMainlineBranchIsFound() { - var currentConfig = new Config { VersioningMode = VersioningMode.Mainline, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatchTag }; + var configuration = GetConfigurationBuilder() + .WithBranch("unknown", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDelivery)) + .WithAssemblyFileVersioningScheme(AssemblyFileVersioningScheme.MajorMinorPatchTag) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("master")); + fixture.AssertFullSemver("0.0.1", configuration); + fixture.BranchTo("master"); fixture.Repository.Branches.Remove(fixture.Repository.Branches["main"]); + fixture.AssertFullSemver("0.0.1", configuration); fixture.Repository.MakeCommits(2); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("issue-branch")); + fixture.AssertFullSemver("0.0.3", configuration); + fixture.BranchTo("issue-branch"); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("0.1.3-issue-branch.1", currentConfig); + fixture.AssertFullSemver("0.0.4-issue-branch.1", configuration); } [Test] public void GivenARemoteGitRepositoryWithCommitsThenClonedLocalDevelopShouldMatchRemoteVersion() { + var configuration = GetConfigurationBuilder().Build(); + using var fixture = new RemoteRepositoryFixture(); - fixture.AssertFullSemver("0.1.4", config); + fixture.AssertFullSemver("0.0.5", configuration); // RemoteRepositoryFixture creates 5 commits. fixture.BranchTo("develop"); - fixture.AssertFullSemver("0.2.0-alpha.0", config); - Console.WriteLine(fixture.SequenceDiagram.GetDiagram()); + fixture.AssertFullSemver("0.1.0-alpha.0", configuration); + fixture.Repository.DumpGraph(); var local = fixture.CloneRepository(); - fixture.AssertFullSemver("0.2.0-alpha.0", config, repository: local.Repository); + fixture.AssertFullSemver("0.1.0-alpha.0", configuration, repository: local.Repository); local.Repository.DumpGraph(); } - [Test] - public void GivenNoMainThrowsWarning() + [TestCase("feat!: Break stuff +semver: none")] + [TestCase("feat: Add stuff +semver: none")] + [TestCase("fix: Fix stuff +semver: none")] + public void NoBumpMessageTakesPrecedenceOverBumpMessage(string commitMessage) { + // Same configuration as found here: https://gitversion.net/docs/reference/version-increments#conventional-commit-messages + var conventionalCommitsConfig = GetConfigurationBuilder() + .WithMajorVersionBumpMessage(@"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w\s-]*\))?(!:|:.*\n\n((.+\n)+\n)?BREAKING CHANGE:\s.+)") + .WithMinorVersionBumpMessage(@"^(feat)(\([\w\s-]*\))?:") + .WithPatchVersionBumpMessage(@"^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\([\w\s-]*\))?:") + .Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - fixture.Repository.Branches.Remove(fixture.Repository.Branches["main"]); + fixture.MakeATaggedCommit("1.0.0"); - var exception = Assert.Throws(() => fixture.AssertFullSemver("1.1.0-alpha.1", config)); - exception.ShouldNotBeNull(); - exception.Message.ShouldMatch("No branches can be found matching the commit .* in the configured Mainline branches: main, support"); - } -} + fixture.MakeACommit(commitMessage); -internal static class CommitExtensions -{ - public static void MakeACommit(this RepositoryFixtureBase fixture, string commitMsg) - { - fixture.Repository.MakeACommit(commitMsg); - var diagramBuilder = (StringBuilder?)typeof(SequenceDiagram) - .GetField("diagramBuilder", BindingFlags.Instance | BindingFlags.NonPublic) - ?.GetValue(fixture.SequenceDiagram); - - string? GetParticipant(string participant) => - (string?)typeof(SequenceDiagram).GetMethod("GetParticipant", BindingFlags.Instance | BindingFlags.NonPublic) - ?.Invoke(fixture.SequenceDiagram, - new object[] - { - participant - }); - - var participant = GetParticipant(fixture.Repository.Head.FriendlyName); - if (participant != null) - diagramBuilder?.AppendLineFormat("{0} -> {0}: Commit '{1}'", participant, commitMsg); + fixture.AssertFullSemver("1.0.1", conventionalCommitsConfig); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs index 0525ca66de..8412d0b015 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs @@ -1,26 +1,136 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; +using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.IntegrationTests; [TestFixture] public class OtherBranchScenarios : TestBase { + [TestCase("", "NotAVersion", "2.0.0-1", "1.9.0", "1.9.0", "1.9.1-1")] + [TestCase("", "1.5.0", "1.5.0", "1.9.0", "1.9.0", "1.9.1-1")] + [TestCase("prefix", "1.5.0", "2.0.0-1", "1.9.0", "2.0.0-1", "2.0.0-2")] + [TestCase("prefix", "1.5.0", "2.0.0-1", "prefix1.9.0", "1.9.0", "1.9.1-1")] + [TestCase("prefix", "prefix1.5.0", "1.5.0", "1.9.0", "1.5.0", "1.5.1-1")] + public void CanUseCommitMessagesToBumpVersion_TagsTakePriorityOnlyIfVersions( + string tagPrefix, + string firstTag, + string expectedAfterFirstTag, + string secondTag, + string expectedAfterSecondTag, + string expectedVersionAfterNewCommit) + { + var configuration = GitFlowConfigurationBuilder.New + .WithTagPrefixPattern(tagPrefix) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + var repo = fixture.Repository; + + repo.MakeATaggedCommit($"{tagPrefix}1.0.0"); + repo.MakeACommit("+semver:major"); + fixture.AssertFullSemver("2.0.0-1", configuration); + + repo.ApplyTag(firstTag); + fixture.AssertFullSemver(expectedAfterFirstTag, configuration); + + repo.ApplyTag(secondTag); + fixture.AssertFullSemver(expectedAfterSecondTag, configuration); + + repo.MakeACommit(); + fixture.AssertFullSemver(expectedVersionAfterNewCommit, configuration); + } + + [TestCase("", null, "1.9.0-1", "2.0.0-1+1", ExpectedResult = "1.9.0-1")] + [TestCase("", "", "1.9.0-1", "2.0.0-1+1", ExpectedResult = "1.9.0-1")] + [TestCase("", "foo", "1.9.0-1", "2.0.0-foo.1+1", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase("", "bar", "1.9.0-1", "2.0.0-bar.1+1", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase("prefix", null, "1.9.0-1", "2.0.0-1+1", ExpectedResult = "2.0.0-1+1")] + [TestCase("prefix", "", "1.9.0-1", "2.0.0-1+1", ExpectedResult = "2.0.0-1+1")] + [TestCase("prefix", "foo", "1.9.0-1", "2.0.0-foo.1+1", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase("prefix", "bar", "1.9.0-1", "2.0.0-bar.1+1", ExpectedResult = "2.0.0-bar.1+1")] + + [TestCase("", null, "2.1.0-1", "2.0.0-1+1", ExpectedResult = "2.1.0-1")] + [TestCase("", "", "2.1.0-1", "2.0.0-1+1", ExpectedResult = "2.1.0-1")] + [TestCase("", "foo", "2.1.0-1", "2.0.0-foo.1+1", ExpectedResult = "2.1.0-foo.1+1")] + [TestCase("", "bar", "2.1.0-1", "2.0.0-bar.1+1", ExpectedResult = "2.1.0-bar.1+1")] + [TestCase("prefix", null, "2.1.0-1", "2.0.0-1+1", ExpectedResult = "2.0.0-1+1")] + [TestCase("prefix", "", "2.1.0-1", "2.0.0-1+1", ExpectedResult = "2.0.0-1+1")] + [TestCase("prefix", "foo", "2.1.0-1", "2.0.0-foo.1+1", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase("prefix", "bar", "2.1.0-1", "2.0.0-bar.1+1", ExpectedResult = "2.0.0-bar.1+1")] + public string WhenTaggingACommitAsPreRelease(string tagPrefix, string? label, string tag, string expectedVersion) + { + var configuration = GitFlowConfigurationBuilder.New.WithLabel(null).WithTagPrefixPattern(tagPrefix) + .WithBranch("main", b => b.WithLabel(label).WithDeploymentMode(DeploymentMode.ManualDeployment)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit($"{tagPrefix}1.0.0"); + fixture.MakeACommit("+semver:major"); + fixture.AssertFullSemver(expectedVersion, configuration); + fixture.ApplyTag(tag); + + return fixture.GetVersion(configuration).FullSemVer; + } + + /// + /// https://github.com/GitTools/GitVersion/issues/2340 + /// + [Test] + public void ShouldOnlyConsiderTagsMatchingOfCurrentBranch() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", builder => builder.WithLabel("snapshot")) + .WithBranch("release", builder => builder.WithLabel("rc")) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.MakeACommit(); + fixture.MakeATaggedCommit("0.1.2-snapshot.2"); + fixture.BranchTo("release/0.1.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.2-rc.1+3", configuration); + } + [Test] public void CanTakeVersionFromReleaseBranch() { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("release", b => b.WithLabel("{BranchName}").WithRegularExpression("(?.+)")) + .Build(); + using var fixture = new EmptyRepositoryFixture(); + const string taggedVersion = "1.0.3"; - fixture.Repository.MakeATaggedCommit(taggedVersion); + fixture.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.Repository.CreateBranch("release/beta-2.0.0"); - Commands.Checkout(fixture.Repository, "release/beta-2.0.0"); + fixture.BranchTo("release/2.0.0-LTS"); + fixture.MakeACommit(); + + fixture.AssertFullSemver("2.0.0-LTS.1+6", configuration); + } - fixture.AssertFullSemver("2.0.0-beta.1+0"); + [Test] + public void CanTakeVersionFromHotfixBranch() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("hotfix", b => b.WithLabel("{BranchName}").WithRegularExpression("(?.+)")) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + const string taggedVersion = "1.0.3"; + fixture.MakeATaggedCommit(taggedVersion); + fixture.BranchTo("hotfix/1.0.5-LTS"); + fixture.MakeACommit(); + + fixture.AssertFullSemver("1.0.5-LTS.1+1", configuration); } [Test] @@ -39,43 +149,41 @@ public void BranchesWithIllegalCharsShouldNotBeUsedInVersionNames() [Test] public void ShouldNotGetVersionFromFeatureBranchIfNotMerged() { + // * 1c08923 54 minutes ago (HEAD -> develop) + // | * 03dd6d5 56 minutes ago (tag: 1.0.1-feature.1, feature) + // |/ + // * e2ff13b 58 minutes ago (tag: 1.0.0-unstable.0, main) + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", builder => builder.WithTrackMergeTarget(false)) + .Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0.0-unstable.0"); // initial commit in main - fixture.Repository.CreateBranch("feature"); - Commands.Checkout(fixture.Repository, "feature"); - fixture.Repository.MakeATaggedCommit("1.0.1-feature.1"); + fixture.MakeATaggedCommit("1.0.0-unstable.0"); // initial commit in main + + fixture.BranchTo("feature"); + fixture.MakeATaggedCommit("1.0.1-feature.1"); + fixture.Checkout(MainBranch); + fixture.BranchTo("develop"); + fixture.MakeACommit(); - Commands.Checkout(fixture.Repository, MainBranch); - fixture.Repository.CreateBranch("develop"); - Commands.Checkout(fixture.Repository, "develop"); - fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.0-alpha.2", configuration); - var version = fixture.GetVersion(); - version.SemVer.ShouldBe("1.0.0-alpha.1"); + fixture.Repository.DumpGraph(); } [TestCase("alpha", "JIRA-123", "alpha")] - [TestCase("useBranchName", "JIRA-123", "JIRA-123")] - [TestCase("alpha.{BranchName}", "JIRA-123", "alpha.JIRA-123")] - public void TagIsBranchNameForBranchesWithoutPrefixedBranchName(string tag, string branchName, string preReleaseTagName) + [TestCase($"alpha.{ConfigurationConstants.BranchNamePlaceholder}", "JIRA-123", "alpha.JIRA-123")] + public void LabelIsBranchNameForBranchesWithoutPrefixedBranchName(string label, string branchName, string preReleaseTagName) { - var config = new Config - { - Branches = - { - { - "other", - new BranchConfig - { - Increment = IncrementStrategy.Patch, - Regex = ".*", - SourceBranches = new HashSet(), - Tag = tag - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("other", builder => builder + .WithIncrement(IncrementStrategy.Patch) + .WithRegularExpression("(?.+)") + .WithSourceBranches() + .WithLabel(label)) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); @@ -83,7 +191,7 @@ public void TagIsBranchNameForBranchesWithoutPrefixedBranchName(string tag, stri Commands.Checkout(fixture.Repository, branchName); fixture.Repository.MakeCommits(5); - var expectedFullSemVer = $"1.0.1-{preReleaseTagName}.1+5"; - fixture.AssertFullSemver(expectedFullSemVer, config); + var expectedFullSemVer = $"1.0.1-{preReleaseTagName}.5"; + fixture.AssertFullSemver(expectedFullSemVer, configuration); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs index eb6c77a110..39c2c3ba45 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/OtherScenarios.cs @@ -1,10 +1,12 @@ using System.Globalization; -using GitTools.Testing; +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; using GitVersion.Helpers; +using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; +using Microsoft.Extensions.DependencyInjection; namespace GitVersion.Core.Tests.IntegrationTests; @@ -18,26 +20,26 @@ public class OtherScenarios : TestBase public void DoNotBlowUpWhenMainAndDevelopPointAtSameCommit() { using var fixture = new RemoteRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); fixture.Repository.CreateBranch("develop"); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.Repository.Head.Tip); fixture.LocalRepositoryFixture.Repository.Branches.Remove(MainBranch); - fixture.InitializeRepo(); - fixture.AssertFullSemver("1.0.1+1"); + fixture.InitializeRepository(); + fixture.AssertFullSemver("1.0.1-1"); } [Test] public void AllowNotHavingMain() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + fixture.BranchTo("develop"); fixture.Repository.Branches.Remove(fixture.Repository.Branches[MainBranch]); fixture.AssertFullSemver("1.1.0-alpha.1"); @@ -47,10 +49,10 @@ public void AllowNotHavingMain() public void AllowHavingVariantsStartingWithMaster() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("masterfix")); + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + fixture.BranchTo("masterfix"); fixture.AssertFullSemver("1.0.1-masterfix.1+1"); } @@ -59,23 +61,22 @@ public void AllowHavingVariantsStartingWithMaster() public void AllowHavingMasterInsteadOfMain() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("master")); - fixture.Repository.Branches.Remove(fixture.Repository.Branches["main"]); + fixture.MakeACommit("one"); + fixture.BranchTo("develop"); + fixture.BranchTo("master"); + fixture.Repository.Branches.Remove("main"); - fixture.AssertFullSemver("0.1.0+0"); + fixture.AssertFullSemver("0.0.1-1"); } [Test] public void AllowHavingVariantsStartingWithMain() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("mainfix")); - + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + fixture.BranchTo("mainfix"); fixture.AssertFullSemver("1.0.1-mainfix.1+1"); } @@ -83,17 +84,17 @@ public void AllowHavingVariantsStartingWithMain() public void DoNotBlowUpWhenDevelopAndFeatureBranchPointAtSameCommit() { using var fixture = new RemoteRepositoryFixture(); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); fixture.Repository.CreateBranch("feature/someFeature"); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.Repository.Head.Tip); fixture.LocalRepositoryFixture.Repository.Branches.Remove(MainBranch); - fixture.InitializeRepo(); + fixture.InitializeRepository(); fixture.AssertFullSemver("1.1.0-alpha.1"); } @@ -101,17 +102,18 @@ public void DoNotBlowUpWhenDevelopAndFeatureBranchPointAtSameCommit() [TestCase(false, 1)] [TestCase(true, 5)] [TestCase(false, 5)] - public void HasDirtyFlagWhenUncommittedChangesAreInRepo(bool stageFile, int numberOfFiles) + public void HasDirtyFlagWhenUncommittedChangesAreInRepository(bool stageFile, int numberOfFiles) { + var sp = ConfigureServices(); + var fileSystem = sp.GetRequiredService(); using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); - for (int i = 0; i < numberOfFiles; i++) + for (var i = 0; i < numberOfFiles; i++) { - var tempFile = Path.GetTempFileName(); - var repoFile = PathHelper.Combine(fixture.RepositoryPath, Path.GetFileNameWithoutExtension(tempFile) + ".txt"); - File.Move(tempFile, repoFile); - File.WriteAllText(repoFile, $"Hello world / testfile {i}"); + var tempFile = FileSystemHelper.Path.GetRandomFileName(); + var repoFile = FileSystemHelper.Path.Combine(fixture.RepositoryPath, FileSystemHelper.Path.GetFileNameWithoutExtension(tempFile) + ".txt"); + fileSystem.File.WriteAllText(repoFile, $"Hello world / testfile {i}"); if (stageFile) Commands.Stage(fixture.Repository, repoFile); @@ -125,10 +127,1285 @@ public void HasDirtyFlagWhenUncommittedChangesAreInRepo(bool stageFile, int numb public void NoDirtyFlagInCleanRepository() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); var version = fixture.GetVersion(); const int zero = 0; version.UncommittedChanges.ShouldBe(zero.ToString(CultureInfo.InvariantCulture)); } + + [TestCase(false, "1.1.0-alpha.2")] + [TestCase(true, "1.2.0-alpha.1")] + public void EnsureTrackMergeTargetStrategyWhichWillLookForTaggedMergeCommits(bool trackMergeTarget, string expectedVersion) + { + // * 9daa6ea 53 minutes ago (HEAD -> develop) + // | * 85536f2 55 minutes ago (tag: 1.1.0, main) + // | |\ + // | |/ + // |/| + // * | 4a5ef1a 56 minutes ago + // |/ + // * c7f68af 58 minutes ago (tag: 1.0.0) + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithIsMainBranch(false)) + .WithBranch("develop", builder => builder + .WithTrackMergeTarget(trackMergeTarget).WithTracksReleaseBranches(false) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + fixture.MakeACommit(); + fixture.Checkout("main"); + fixture.MergeNoFF("develop"); + fixture.ApplyTag("1.1.0"); + fixture.Checkout("develop"); + fixture.MakeACommit(); + + fixture.AssertFullSemver(expectedVersion, configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void EnsurePreReleaseTagLabelWillBeConsideredIfCurrentBranchIsRelease() + { + var configuration = GitHubFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture("release/2.0.0"); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); + + fixture.ApplyTag("2.0.0-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+0", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-beta.2+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWillBeConsideredIfNoLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel(null).WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+2", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2+1", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.3+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber + 1}-1+1", configuration); + + fixture.Repository.DumpGraph(); + } + + [Test] + public void EnsurePreReleaseTagLabelWithInitialTagForPatchNumberOneWillBeConsideredIfNoLabelIsDefined() + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel(null).WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + + fixture.ApplyTag("1.0.1-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-alpha.2+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-alpha.2+2", configuration); + + fixture.MakeATaggedCommit("1.0.1-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.2+1", configuration); + + fixture.MakeATaggedCommit("1.0.1-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.3+1", configuration); + + fixture.ApplyTag("1.0.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.2-1+1", configuration); + + fixture.Repository.DumpGraph(); + } + + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWithInitialTagForPatchNumberTwoAndThreeWillBeConsideredIfNoLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel(null).WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+2", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.2+1", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.3+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber + 1}-1+1", configuration); + + fixture.Repository.DumpGraph(); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWillBeConsideredIfLabelIsEmpty(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel(string.Empty).WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-1+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+3", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+5", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+6", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-1+7", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber + 1}-1+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfLabelIsEmpty(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel(string.Empty).WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-1+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+3", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+5", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+6", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-1+7", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber + 1}-1+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWillBeConsideredIfAlphaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("alpha").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-alpha.1+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+2", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+4", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+5", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+6", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber + 1}-alpha.1+1", configuration); + + fixture.Repository.DumpGraph(); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfAlphaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("alpha").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-alpha.1+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+2", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+3", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+4", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+5", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-alpha.2+6", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber + 1}-alpha.1+1", configuration); + + fixture.Repository.DumpGraph(); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWillBeConsideredIfBetaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("beta").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-beta.1+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+3", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2+1", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-beta.3+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber + 1}-beta.1+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfBetaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("beta").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-beta.1+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.1+3", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.2+1", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-beta.3+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber + 1}-beta.1+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWillBeConsideredIfGammaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("gamma").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.1-gamma.1+1", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+3", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+5", configuration); + + fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+6", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+7", configuration); + + fixture.ApplyTag($"0.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"0.0.{patchNumber + 1}-gamma.1+1", configuration); + } + + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void EnsurePreReleaseTagLabelWithInitialTagWillBeConsideredIfGammaLabelIsDefined(long patchNumber) + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", branchBuilder => branchBuilder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithLabel("gamma").WithIncrement(IncrementStrategy.Patch) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.1-gamma.1+1", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}-alpha.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+2", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+3", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+5", configuration); + + fixture.MakeATaggedCommit($"1.0.{patchNumber}-beta.2"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+6", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}-gamma.1+7", configuration); + + fixture.ApplyTag($"1.0.{patchNumber}"); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber}", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver($"1.0.{patchNumber + 1}-gamma.1+1", configuration); + } + + [TestCase(null)] + [TestCase("")] + public void IncreaseVersionWithBumpMessageWhenCommitMessageIncrementIsEnabledAndIncrementStrategyIsNoneForBranchWithNoLabel(string? label) + { + var configuration = GitFlowConfigurationBuilder.New.WithLabel(null) + .WithBranch("main", b => b + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Enabled) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithIncrement(IncrementStrategy.None) + .WithLabel(label) + .WithIsMainBranch(false) + ) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-1", configuration); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-2", configuration); + + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.MakeACommit("+semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1", configuration); + + fixture.ApplyTag("2.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-1", configuration); + } + + [Test] + public void IncreaseVersionWithBumpMessageWhenCommitMessageIncrementIsEnabledAndIncrementStrategyIsNoneForBranchWithAlphaLabel() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", b => b + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Enabled) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithIncrement(IncrementStrategy.None) + .WithLabel("pre") + .WithIsMainBranch(false) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.0.0-pre.1", configuration); + + fixture.MakeACommit("+semver: minor"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("0.1.0-pre.2", configuration); + + fixture.ApplyTag("1.0.0"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.MakeACommit("+semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-pre.1", configuration); + + fixture.ApplyTag("2.0.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-pre.1", configuration); + } + + [Test] + public void ShouldProvideTheCorrectVersionEvenIfPreReleaseLabelExistsInTheGitTagMain() + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("5.0") + .WithSemanticVersionFormat(SemanticVersionFormat.Loose) + .WithBranch("main", b => b + .WithLabel("beta") + .WithIncrement(IncrementStrategy.Patch) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithIsMainBranch(false) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("5.0.0-beta.1", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("5.0.0-beta.2", configuration); + + fixture.ApplyTag("5.0.0-beta.3"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("5.0.0-beta.3", configuration); + + fixture.MakeATaggedCommit("5.0.0-rc.1"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("5.0.0-beta.4", configuration); + + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("5.0.0-beta.5", configuration); + } + + /// + /// https://github.com/GitTools/GitVersion/issues/2347 + /// + [Test] + public void EnsureThePreReleaseTagIsCorrectlyGeneratedWhenPreReleaseLabelIsEmpty() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", b => b + .WithLabel(string.Empty).WithIsMainBranch(false) + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeCommits(5); + + _ = fixture.GetVersion(configuration); + + fixture.AssertFullSemver("0.0.1-5", configuration); + } + + [TestCase("0.0.1-alpha.2", true, "0.0.1-alpha.2")] + [TestCase("0.0.1-alpha.2", false, "0.0.1-alpha.3+0")] + [TestCase("0.1.0-alpha.2", true, "0.1.0-alpha.2")] + [TestCase("0.1.0-alpha.2", false, "0.1.0-alpha.3+0")] + [TestCase("0.0.1", true, "0.0.1")] + [TestCase("0.0.1", false, "0.1.0-alpha.1+0")] + [TestCase("0.0.1-beta.2", true, "0.1.0-alpha.1+1")] + [TestCase("0.0.1-beta.2", false, "0.1.0-alpha.1+1")] + [TestCase("0.1.0-beta.2", true, "0.1.0-alpha.1+1")] + [TestCase("0.1.0-beta.2", false, "0.1.0-alpha.1+1")] + [TestCase("0.2.0-beta.2", true, "0.2.0-alpha.1+1")] + [TestCase("0.2.0-beta.2", false, "0.2.0-alpha.1+1")] + public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeploymentModeManualDeployment( + string tag, bool preventIncrementWhenCurrentCommitTagged, string version) + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit("A"); + if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); + fixture.BranchTo("develop"); + + fixture.AssertFullSemver(version, configuration); + } + + [TestCase("0.0.1-alpha.2", true, "0.0.1-alpha.2")] + [TestCase("0.0.1-alpha.2", false, "0.0.1-alpha.2")] + [TestCase("0.1.0-alpha.2", true, "0.1.0-alpha.2")] + [TestCase("0.1.0-alpha.2", false, "0.1.0-alpha.2")] + [TestCase("0.0.1", true, "0.0.1")] + [TestCase("0.0.1", false, "0.1.0-alpha.0")] + [TestCase("0.0.1-beta.2", true, "0.1.0-alpha.1")] + [TestCase("0.0.1-beta.2", false, "0.1.0-alpha.1")] + [TestCase("0.1.0-beta.2", true, "0.1.0-alpha.1")] + [TestCase("0.1.0-beta.2", false, "0.1.0-alpha.1")] + [TestCase("0.2.0-beta.2", true, "0.2.0-alpha.1")] + [TestCase("0.2.0-beta.2", false, "0.2.0-alpha.1")] + public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeploymentModeContinuousDelivery( + string tag, bool preventIncrementWhenCurrentCommitTagged, string version) + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", b => b + .WithDeploymentMode(DeploymentMode.ContinuousDelivery) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit("A"); + if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); + fixture.BranchTo("develop"); + + fixture.AssertFullSemver(version, configuration); + } + + [TestCase("0.0.1-alpha.2", true, "0.0.1")] + [TestCase("0.0.1-alpha.2", false, "0.0.1")] + [TestCase("0.1.0-alpha.2", true, "0.1.0")] + [TestCase("0.1.0-alpha.2", false, "0.1.0")] + [TestCase("0.0.1", true, "0.0.1")] + [TestCase("0.0.1", false, "0.1.0")] + [TestCase("0.0.1-beta.2", true, "0.1.0")] + [TestCase("0.0.1-beta.2", false, "0.1.0")] + [TestCase("0.1.0-beta.2", true, "0.1.0")] + [TestCase("0.1.0-beta.2", false, "0.1.0")] + [TestCase("0.2.0-beta.2", true, "0.2.0")] + [TestCase("0.2.0-beta.2", false, "0.2.0")] + public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithDeploymentModeContinuousDeployment( + string tag, bool preventIncrementWhenCurrentCommitTagged, string version) + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("develop", b => b + .WithDeploymentMode(DeploymentMode.ContinuousDeployment) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit("A"); + if (!tag.IsNullOrEmpty()) fixture.ApplyTag(tag); + fixture.BranchTo("develop"); + + fixture.AssertFullSemver(version, configuration); + } + + [TestCase(true, "1.0.0")] + [TestCase(false, "6.0.0-alpha.1+0")] + public void EnsurePreventIncrementWhenCurrentCommitTaggedOnDevelopWithNextVersion(bool preventIncrementWhenCurrentCommitTagged, string semVersion) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("6.0.0") + .WithBranch("develop", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit(); + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + + fixture.AssertFullSemver(semVersion, configuration); + } + + [TestCase(null, true, "6.0.0-beta.1+1")] + [TestCase(null, false, "6.0.0-beta.1+1")] + [TestCase(new[] { "5.0.0" }, true, "5.0.0")] + [TestCase(new[] { "5.0.0" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "6.0.0" }, true, "6.0.0")] + [TestCase(new[] { "6.0.0" }, false, "6.1.0-beta.1+0")] + [TestCase(new[] { "7.0.0" }, true, "7.0.0")] + [TestCase(new[] { "7.0.0" }, false, "7.1.0-beta.1+0")] + [TestCase(new[] { "5.0.0-alpha.2" }, true, "6.0.0-beta.1+1")] + [TestCase(new[] { "5.0.0-alpha.2" }, false, "6.0.0-beta.1+1")] + [TestCase(new[] { "6.0.0-alpha.2" }, true, "6.0.0-beta.1+1")] + [TestCase(new[] { "6.0.0-alpha.2" }, false, "6.0.0-beta.1+1")] + [TestCase(new[] { "7.0.0-alpha.2" }, true, "7.0.0-beta.1+1")] + [TestCase(new[] { "7.0.0-alpha.2" }, false, "7.0.0-beta.1+1")] + [TestCase(new[] { "5.0.0-beta.2" }, true, "5.0.0-beta.2")] + [TestCase(new[] { "5.0.0-beta.2" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "6.0.0-beta.2" }, true, "6.0.0-beta.2")] + [TestCase(new[] { "6.0.0-beta.2" }, false, "6.0.0-beta.3+0")] + [TestCase(new[] { "7.0.0-beta.2" }, true, "7.0.0-beta.2")] + [TestCase(new[] { "7.0.0-beta.2" }, false, "7.0.0-beta.3+0")] + [TestCase(new[] { "5.0.0", "6.0.0" }, true, "6.0.0")] + [TestCase(new[] { "5.0.0", "6.0.0" }, false, "6.1.0-beta.1+0")] + [TestCase(new[] { "6.0.0", "5.0.0" }, true, "6.0.0")] + [TestCase(new[] { "6.0.0", "5.0.0" }, false, "6.1.0-beta.1+0")] + [TestCase(new[] { "6.0.0", "7.0.0" }, true, "7.0.0")] + [TestCase(new[] { "6.0.0", "7.0.0" }, false, "7.1.0-beta.1+0")] + [TestCase(new[] { "7.0.0", "6.0.0" }, true, "7.0.0")] + [TestCase(new[] { "7.0.0", "6.0.0" }, false, "7.1.0-beta.1+0")] + [TestCase(new[] { "4.0.0", "5.0.0-alpha.2" }, true, "4.0.0")] + [TestCase(new[] { "4.0.0", "5.0.0-alpha.2" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "5.0.0-alpha.2", "4.0.0" }, true, "4.0.0")] + [TestCase(new[] { "5.0.0-alpha.2", "4.0.0" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "4.0.0", "5.0.0-beta.2" }, true, "5.0.0-beta.2")] + [TestCase(new[] { "4.0.0", "5.0.0-beta.2" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "5.0.0-beta.2", "4.0.0" }, true, "5.0.0-beta.2")] + [TestCase(new[] { "5.0.0-beta.2", "4.0.0" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "4.0.0-alpha.2", "5.0.0-beta.2" }, true, "5.0.0-beta.2")] + [TestCase(new[] { "4.0.0-alpha.2", "5.0.0-beta.2" }, false, "6.0.0-beta.1+0")] + [TestCase(new[] { "5.0.0-beta.2", "4.0.0-alpha.2" }, true, "5.0.0-beta.2")] + [TestCase(new[] { "5.0.0-beta.2", "4.0.0-alpha.2" }, false, "6.0.0-beta.1+0")] + public void EnsurePreventIncrementWhenCurrentCommitTaggedOnReleaseBranchAndIncrementMinor( + string[]? tags, bool preventIncrementWhenCurrentCommitTagged, string semVersion) + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("release", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged) + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit(); + + if (tags is not null) + { + foreach (var tag in tags) + { + fixture.ApplyTag(tag); + } + } + + fixture.BranchTo("release/6.0.0"); + + fixture.AssertFullSemver(semVersion, configuration); + } + + [Test] + public void EnsureVersionAfterMainIsMergedBackToDevelopIsCorrect() + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("develop"); + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.1"); + + fixture.Checkout("main"); + fixture.MakeACommit("B"); + fixture.BranchTo("hotfix/just-a-hotfix"); + fixture.MakeACommit("C +semver: major"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + fixture.Checkout("develop"); + fixture.MakeACommit("D"); + fixture.Checkout("main"); + fixture.MakeACommit("E"); + fixture.ApplyTag("1.0.1"); + fixture.Checkout("develop"); + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-alpha.3"); + } + + [TestCase(false, "2.0.0-alpha.2")] + [TestCase(true, "2.0.0-alpha.2")] + public void EnsureVersionAfterMainIsMergedBackToDevelopIsCorrectForMainline(bool applyTag, string semanticVersion) + { + var configuration = GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + fixture.BranchTo("develop"); + fixture.MakeACommit("B +semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-alpha.1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + if (applyTag) fixture.ApplyTag("1.0.1"); + fixture.Checkout("develop"); + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration); + } + + [TestCase(false, "2.0.0-alpha.3")] + [TestCase(true, "3.0.0-alpha.2")] + public void EnsureVersionAfterMainIsMergedBackToDevelopIsCorrectForGitFlow(bool applyTag, string semanticVersion) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("1.0.0"); + fixture.BranchTo("develop"); + fixture.MakeACommit("B +semver: major"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-alpha.1", configuration); + + fixture.Checkout("main"); + fixture.MakeACommit("C"); + if (applyTag) fixture.ApplyTag("2.0.0"); + fixture.Checkout("develop"); + fixture.MergeNoFF("main"); + + // ✅ succeeds as expected + fixture.AssertFullSemver(semanticVersion, configuration); + } + + /// + /// see https://github.com/GitTools/GitVersion/issues/2394 + /// + [Test] + public void EnsureVersionSourceIsSetToTheRightTag() + { + // Arrange + var configuration = GitFlowConfigurationBuilder.New.Build(); + + // Act + using var fixture = new BaseGitFlowRepositoryFixture("0.1.0"); + + fixture.Checkout("main"); + fixture.MergeNoFF("develop"); + fixture.Checkout("develop"); + fixture.MakeACommit("Feature commit 1"); + fixture.BranchTo("release/0.2.0"); + fixture.MakeACommit("Release commit 1"); + fixture.Checkout("main"); + fixture.MergeNoFF("release/0.2.0"); + fixture.ApplyTag("0.2.0"); + var tag = fixture.Repository.Head.Tip; + fixture.Checkout("develop"); + fixture.MergeNoFF("main"); + var version = fixture.GetVersion(configuration); + + // Assert + version.VersionSourceSha.ShouldBe(tag.Sha); + } + + /// + /// see https://github.com/GitTools/GitVersion/issues/3689 + /// + [Test] + public void UnversionedHotfix() + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new BaseGitFlowRepositoryFixture("1.2.0"); + + // create hotfix + Commands.Checkout(fixture.Repository, "main"); + Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("hotfix/put-out-the-fire")); + fixture.Repository.MakeACommit(); + + fixture.AssertFullSemver("1.2.1-beta.1+1", configuration); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.2.1-beta.1+2", configuration); + + // Merge hotfix branch to main + Commands.Checkout(fixture.Repository, "main"); + + fixture.Repository.MergeNoFF("hotfix/put-out-the-fire", Generate.SignatureNow()); + + fixture.AssertFullSemver("1.2.1-3", configuration); + } + + [Test] + public void AlternativeSemanticVersionsShouldBeConsidered() + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeATaggedCommit("4.0.0-beta.14"); + fixture.MakeACommit("B"); + + fixture.AssertFullSemver("4.0.0-3", configuration); + } + + [TestCase(null, "6.0.0-beta.6")] + [TestCase("beta", "6.0.0-beta.6")] + [TestCase("gamma", "6.0.0-gamma.21")] + public void AlternativeSemanticVersionsShouldBeConsidered(string? labelOnMain, string version) + { + var configuration = GitFlowConfigurationBuilder.New + .WithLabel(null) + .WithBranch("main", b => b.WithLabel(labelOnMain)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit("A"); + fixture.ApplyTag("4.0.0-beta.14"); + fixture.ApplyTag("4.0.0-gamma.14"); + fixture.MakeACommit("B"); + fixture.MakeATaggedCommit("6.0.0-alpha.1"); + fixture.MakeATaggedCommit("6.0.0-alpha.2"); + fixture.MakeATaggedCommit("6.0.0-alpha.3"); + fixture.MakeACommit("C"); + fixture.MakeATaggedCommit("6.0.0-beta.5"); + fixture.MakeACommit("D"); + + fixture.AssertFullSemver(version, configuration); + } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/PerformanceScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/PerformanceScenarios.cs new file mode 100644 index 0000000000..cb92616ac8 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/PerformanceScenarios.cs @@ -0,0 +1,34 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; + +namespace GitVersion.Core.Tests.IntegrationTests; + +public class PerformanceScenarios : TestBase +{ + [Test] + public void RepositoryWithALotOfTags() + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + Random random = new(4711); + var semanticVersion = SemanticVersion.Empty; + for (var i = 0; i < 500; i++) + { + var versionField = (VersionField)random.Next(1, 4); + semanticVersion = semanticVersion.Increment(versionField, string.Empty, forceIncrement: true); + fixture.MakeATaggedCommit(semanticVersion.ToString("j")); + } + + fixture.BranchTo("feature"); + fixture.MakeACommit(); + + var sw = Stopwatch.StartNew(); + + fixture.AssertFullSemver("170.3.3-feature.1+1", configuration); + sw.Stop(); + + sw.ElapsedMilliseconds.ShouldBeLessThan(2500); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/PullRequestScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/PullRequestScenarios.cs index ce3aa66d62..683d3dbec7 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/PullRequestScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/PullRequestScenarios.cs @@ -1,13 +1,54 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; [TestFixture] public class PullRequestScenarios : TestBase { + /// + /// GitHubFlow - Pull requests (increment major on main and minor on feature) + /// + [Test] + public void EnsurePullRequestWithIncrementMajorOnMainAndMinorOnFeatureBranch() + { + var configuration = GitHubFlowConfigurationBuilder.New + .WithBranch("main", b => b + .WithIncrement(IncrementStrategy.Major) + ).WithBranch("feature", b => b + .WithIncrement(IncrementStrategy.Minor) + ).Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.0.0-1", configuration); + + fixture.ApplyTag("1.0.0"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-foo.1+1", configuration); + + fixture.Checkout("main"); + fixture.BranchTo("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-PullRequest2.2", configuration); + + fixture.Checkout("main"); + fixture.Remove("pull/2/merge"); + fixture.MergeNoFF("feature/foo"); + + // ✅ succeeds as expected + fixture.AssertFullSemver("2.0.0-2", configuration); + } + [Test] public void CanCalculatePullRequestChanges() { @@ -19,7 +60,7 @@ public void CanCalculatePullRequestChanges() fixture.Repository.CreatePullRequestRef("feature/Foo", MainBranch, normalise: true); fixture.Repository.DumpGraph(); - fixture.AssertFullSemver("0.1.1-PullRequest0002.2"); + fixture.AssertFullSemver("0.1.1-PullRequest2.2"); } [Test] @@ -35,7 +76,7 @@ public void CanCalculatePullRequestChangesInheritingConfig() fixture.Repository.CreatePullRequestRef("feature/Foo", "develop", 44, true); fixture.Repository.DumpGraph(); - fixture.AssertFullSemver("0.2.0-PullRequest0044.3"); + fixture.AssertFullSemver("0.2.0-PullRequest44.3"); } [Test] @@ -46,11 +87,10 @@ public void CanCalculatePullRequestChangesFromRemoteRepo() Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("feature/Foo")); fixture.Repository.MakeACommit(); - fixture.Repository.CreatePullRequestRef("feature/Foo", MainBranch, normalise: true); fixture.Repository.DumpGraph(); - fixture.AssertFullSemver("0.1.1-PullRequest0002.2"); + fixture.AssertFullSemver("0.1.1-PullRequest2.2"); } [Test] @@ -65,7 +105,7 @@ public void CanCalculatePullRequestChangesInheritingConfigFromRemoteRepo() fixture.Repository.CreatePullRequestRef("feature/Foo", "develop", normalise: true); - fixture.AssertFullSemver("0.2.0-PullRequest0002.3"); + fixture.AssertFullSemver("0.2.0-PullRequest2.3"); } [Test] @@ -81,7 +121,7 @@ public void CanCalculatePullRequestChangesWhenThereAreMultipleMergeCandidates() fixture.Repository.CreatePullRequestRef("feature/Foo", "develop", normalise: true); - fixture.AssertFullSemver("0.2.0-PullRequest0002.3"); + fixture.AssertFullSemver("0.2.0-PullRequest2.3"); } [Test] @@ -89,13 +129,13 @@ public void CalculatesCorrectVersionAfterReleaseBranchMergedToMain() { using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.0"); - fixture.Repository.MakeACommit(); + fixture.Repository.MakeACommit("one"); Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release/2.0.0")); - fixture.Repository.MakeACommit(); - fixture.Repository.MakeACommit(); + fixture.Repository.MakeACommit("two"); + fixture.Repository.MakeACommit("three"); fixture.Repository.CreatePullRequestRef("release/2.0.0", MainBranch, normalise: true); - fixture.AssertFullSemver("2.0.0-PullRequest0002.0"); + fixture.AssertFullSemver("2.0.0-PullRequest2.4"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs index 0fd75f14a8..8437c3fd33 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs @@ -1,11 +1,6 @@ -using GitTools.Testing; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -47,13 +42,13 @@ public void NoMergeBacksToDevelopInCaseThereAreChangesInReleaseBranch() // Merge to develop fixture.Checkout("develop"); + fixture.AssertFullSemver("1.1.0-alpha.0"); fixture.Repository.MergeNoFF("release/1.0.0"); - fixture.AssertFullSemver("1.1.0-alpha.2"); - + fixture.AssertFullSemver("1.1.0-alpha.1"); fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.1.0-alpha.2"); fixture.Repository.Branches.Remove("release/1.0.0"); - - fixture.AssertFullSemver("1.1.0-alpha.3"); + fixture.AssertFullSemver("1.1.0-alpha.2"); } [Test] @@ -65,9 +60,9 @@ public void CanTakeVersionFromReleaseBranch() fixture.Repository.CreateBranch("release-2.0.0"); fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.1+0"); + fixture.AssertFullSemver("2.0.0-beta.1+5"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0-beta.1+2"); + fixture.AssertFullSemver("2.0.0-beta.1+7"); } [Test] @@ -79,9 +74,9 @@ public void CanTakeVersionFromReleasesBranch() fixture.Repository.CreateBranch("releases/2.0.0"); fixture.Checkout("releases/2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.1+0"); + fixture.AssertFullSemver("2.0.0-beta.1+5"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0-beta.1+2"); + fixture.AssertFullSemver("2.0.0-beta.1+7"); } [Test] @@ -91,47 +86,41 @@ public void CanTakePreReleaseVersionFromReleasesBranchWithNumericPreReleaseTag() fixture.Repository.MakeCommits(5); fixture.Repository.CreateBranch("releases/2.0.0"); fixture.Checkout("releases/2.0.0"); - fixture.Repository.ApplyTag("v2.0.0-1"); + fixture.Repository.ApplyTag("v2.0.0-beta.1"); var variables = fixture.GetVersion(); - Assert.AreEqual("2.0.0-1", variables.FullSemVer); + Assert.That(variables.FullSemVer, Is.EqualTo("2.0.0-beta.2+0")); } [Test] public void ReleaseBranchWithNextVersionSetInConfig() { - var config = new Config - { - NextVersion = "2.0.0" - }; + var configuration = GitFlowConfigurationBuilder.New.WithNextVersion("2.0.0").Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeCommits(5); fixture.BranchTo("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.1+0", config); + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0-beta.1+2", config); + fixture.AssertFullSemver("2.0.0-beta.1+7", configuration); } [Test] - public void CanTakeVersionFromReleaseBranchWithTagOverridden() + public void CanTakeVersionFromReleaseBranchWithLabelOverridden() { - var config = new Config - { - Branches = - { - { "release", new BranchConfig { Tag = "rc" } } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("release", builder => builder.WithLabel("rc")) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.3"); fixture.Repository.MakeCommits(5); fixture.Repository.CreateBranch("release-2.0.0"); fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-rc.1+0", config); + fixture.AssertFullSemver("2.0.0-rc.1+5", configuration); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0-rc.1+2", config); + fixture.AssertFullSemver("2.0.0-rc.1+7", configuration); } [Test] @@ -144,9 +133,9 @@ public void CanHandleReleaseBranchWithStability() fixture.Repository.CreateBranch("release-2.0.0-Final"); fixture.Checkout("release-2.0.0-Final"); - fixture.AssertFullSemver("2.0.0-beta.1+0"); + fixture.AssertFullSemver("2.0.0-beta.1+5"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0-beta.1+2"); + fixture.AssertFullSemver("2.0.0-beta.1+7"); } [Test] @@ -163,9 +152,9 @@ public void WhenReleaseBranchOffDevelopIsMergedIntoMainAndDevelopVersionIsTakenW fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); - fixture.AssertFullSemver("2.0.0+0"); + fixture.AssertFullSemver("2.0.0-6"); fixture.Repository.MakeCommits(2); - fixture.AssertFullSemver("2.0.0+2"); + fixture.AssertFullSemver("2.0.0-8"); } [Test] @@ -180,7 +169,7 @@ public void WhenReleaseBranchOffMainIsMergedIntoMainVersionIsTakenWithIt() fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); - fixture.AssertFullSemver("2.0.0+0"); + fixture.AssertFullSemver("2.0.0-6"); } [Test] @@ -195,10 +184,12 @@ public void MainVersioningContinuousCorrectlyAfterMergingReleaseBranch() fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); - fixture.AssertFullSemver("2.0.0+0"); + fixture.AssertFullSemver("2.0.0-6"); + fixture.Repository.Branches.Remove("release-2.0.0"); + fixture.AssertFullSemver("2.0.0-6"); fixture.Repository.ApplyTag("2.0.0"); fixture.Repository.MakeCommits(1); - fixture.AssertFullSemver("2.0.1+1"); + fixture.AssertFullSemver("2.0.1-1"); } [Test] @@ -243,7 +234,7 @@ public void WhenReleaseBranchIsMergedIntoMainHighestVersionIsTakenWithIt() fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release-1.0.0", Generate.SignatureNow()); - fixture.AssertFullSemver("2.0.0+5"); + fixture.AssertFullSemver("2.0.0-11"); } [Test] @@ -271,7 +262,7 @@ public void WhenReleaseBranchIsMergedIntoMainHighestVersionIsTakenWithItEvenWith fixture.Checkout(MainBranch); fixture.Repository.MergeNoFF("release-1.0.0", Generate.SignatureNow()); - fixture.AssertFullSemver("3.0.0+10"); + fixture.AssertFullSemver("3.0.0-16"); } [Test] @@ -290,14 +281,14 @@ public void WhenMergingReleaseBackToDevShouldNotResetBetaVersion() fixture.Checkout("release-2.0.0"); fixture.Repository.MakeCommits(1); - fixture.AssertFullSemver("2.0.0-beta.1+1"); + fixture.AssertFullSemver("2.0.0-beta.1+2"); //tag it to bump to beta 2 fixture.Repository.ApplyTag("2.0.0-beta1"); fixture.Repository.MakeCommits(1); - fixture.AssertFullSemver("2.0.0-beta.2+2"); + fixture.AssertFullSemver("2.0.0-beta.2+1"); //merge down to develop fixture.Checkout("develop"); @@ -305,18 +296,15 @@ public void WhenMergingReleaseBackToDevShouldNotResetBetaVersion() //but keep working on the release fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.2+2"); + fixture.AssertFullSemver("2.0.0-beta.2+1"); fixture.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.2+3"); + fixture.AssertFullSemver("2.0.0-beta.2+2"); } [Test] public void HotfixOffReleaseBranchShouldNotResetCount() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); @@ -329,12 +317,12 @@ public void HotfixOffReleaseBranchShouldNotResetCount() fixture.Checkout("release-2.0.0"); fixture.Repository.MakeCommits(1); - fixture.AssertFullSemver("2.0.0-beta.1", config); + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); //tag it to bump to beta 2 fixture.Repository.MakeCommits(4); - fixture.AssertFullSemver("2.0.0-beta.5", config); + fixture.AssertFullSemver("2.0.0-beta.1+6", configuration); //merge down to develop fixture.Repository.CreateBranch("hotfix-2.0.0"); @@ -344,17 +332,16 @@ public void HotfixOffReleaseBranchShouldNotResetCount() fixture.Checkout("release-2.0.0"); fixture.Repository.MergeNoFF("hotfix-2.0.0", Generate.SignatureNow()); fixture.Repository.Branches.Remove(fixture.Repository.Branches["hotfix-2.0.0"]); - fixture.AssertFullSemver("2.0.0-beta.7", config); + fixture.AssertFullSemver("2.0.0-beta.1+8", configuration); } [Test] public void MergeOnReleaseBranchShouldNotResetCount() { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .Build(); + using var fixture = new EmptyRepositoryFixture(); const string taggedVersion = "1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); @@ -367,23 +354,20 @@ public void MergeOnReleaseBranchShouldNotResetCount() fixture.Repository.CreateBranch("release/2.0.0-xxx"); fixture.Checkout("release/2.0.0-xxx"); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.1", config); + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); fixture.Checkout("release/2.0.0"); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.1", config); + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); fixture.Repository.MergeNoFF("release/2.0.0-xxx"); - fixture.AssertFullSemver("2.0.0-beta.2", config); + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); } [Test] public void CommitOnDevelopAfterReleaseBranchMergeToDevelopShouldNotResetCount() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("initial"); @@ -391,12 +375,12 @@ public void CommitOnDevelopAfterReleaseBranchMergeToDevelopShouldNotResetCount() // Create release from develop fixture.BranchTo("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.0", config); + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); // Make some commits on release fixture.MakeACommit("release 1"); fixture.MakeACommit("release 2"); - fixture.AssertFullSemver("2.0.0-beta.2", config); + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); // First forward merge release to develop fixture.Checkout("develop"); @@ -405,24 +389,24 @@ public void CommitOnDevelopAfterReleaseBranchMergeToDevelopShouldNotResetCount() // Make some new commit on release fixture.Checkout("release-2.0.0"); fixture.Repository.MakeACommit("release 3 - after first merge"); - fixture.AssertFullSemver("2.0.0-beta.3", config); + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); // Make new commit on develop fixture.Checkout("develop"); // Checkout to release (no new commits) fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.3", config); + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); fixture.Checkout("develop"); fixture.Repository.MakeACommit("develop after merge"); // Checkout to release (no new commits) fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.3", config); + fixture.AssertFullSemver("2.0.0-beta.1+4", configuration); // Make some new commit on release fixture.Repository.MakeACommit("release 4"); fixture.Repository.MakeACommit("release 5"); - fixture.AssertFullSemver("2.0.0-beta.5", config); + fixture.AssertFullSemver("2.0.0-beta.1+6", configuration); // Second merge release to develop fixture.Checkout("develop"); @@ -430,16 +414,13 @@ public void CommitOnDevelopAfterReleaseBranchMergeToDevelopShouldNotResetCount() // Checkout to release (no new commits) fixture.Checkout("release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.5", config); + fixture.AssertFullSemver("2.0.0-beta.1+6", configuration); } [Test] - public void CommitBeetweenMergeReleaseToDevelopShouldNotResetCount() + public void CommitBetweenMergeReleaseToDevelopShouldNotResetCount() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("initial"); @@ -447,30 +428,35 @@ public void CommitBeetweenMergeReleaseToDevelopShouldNotResetCount() Commands.Checkout(fixture.Repository, "develop"); fixture.Repository.CreateBranch("release-2.0.0"); Commands.Checkout(fixture.Repository, "release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.0", config); + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); // Make some commits on release var commit1 = fixture.Repository.MakeACommit(); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.2", config); + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); // Merge release to develop - emulate commit between other person release commit push and this commit merge to develop Commands.Checkout(fixture.Repository, "develop"); - fixture.Repository.Merge(commit1, Generate.SignatureNow(), new MergeOptions { FastForwardStrategy = FastForwardStrategy.NoFastForward }); + fixture.Repository.Merge(commit1, Generate.SignatureNow(), new() { FastForwardStrategy = FastForwardStrategy.NoFastForward }); fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow()); // Check version on release after merge to develop Commands.Checkout(fixture.Repository, "release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.2", config); + fixture.AssertFullSemver("2.0.0-beta.1+3", configuration); // Check version on release after making some new commits fixture.Repository.MakeACommit(); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("2.0.0-beta.4", config); + fixture.AssertFullSemver("2.0.0-beta.1+5", configuration); } - public static void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousCommit() + [Test] + public void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousCommit() { + var configuration = GitFlowConfigurationBuilder.New + .WithSemanticVersionFormat(SemanticVersionFormat.Loose) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0"); fixture.Repository.MakeACommit("+semver:major"); @@ -478,18 +464,18 @@ public static void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousC fixture.BranchTo("release/2.0"); - fixture.AssertFullSemver("2.0.0-beta.1+2"); + fixture.AssertFullSemver("2.0.0-beta.1+2", configuration); } [Test] public void ReleaseBranchWithACommitShouldUseBranchNameVersionDespiteBumpInPreviousCommit() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0"); + fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit("+semver:major"); fixture.Repository.MakeACommit(); - fixture.BranchTo("release/2.0"); + fixture.BranchTo("release/2.0.0"); fixture.Repository.MakeACommit(); @@ -500,10 +486,10 @@ public void ReleaseBranchWithACommitShouldUseBranchNameVersionDespiteBumpInPrevi public void ReleaseBranchedAtCommitWithSemverMessageShouldUseBranchNameVersion() { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeATaggedCommit("1.0"); + fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit("+semver:major"); - fixture.BranchTo("release/2.0"); + fixture.BranchTo("release/2.0.0"); fixture.AssertFullSemver("2.0.0-beta.1+1"); } @@ -511,10 +497,7 @@ public void ReleaseBranchedAtCommitWithSemverMessageShouldUseBranchNameVersion() [Test] public void FeatureFromReleaseBranchShouldNotResetCount() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit("initial"); @@ -522,11 +505,11 @@ public void FeatureFromReleaseBranchShouldNotResetCount() Commands.Checkout(fixture.Repository, "develop"); fixture.Repository.CreateBranch("release-2.0.0"); Commands.Checkout(fixture.Repository, "release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.0", config); + fixture.AssertFullSemver("2.0.0-beta.1+1", configuration); // Make some commits on release fixture.Repository.MakeCommits(10); - fixture.AssertFullSemver("2.0.0-beta.10", config); + fixture.AssertFullSemver("2.0.0-beta.1+11", configuration); // Create feature from release fixture.BranchTo("feature/xxx"); @@ -535,9 +518,9 @@ public void FeatureFromReleaseBranchShouldNotResetCount() // Check version on release Commands.Checkout(fixture.Repository, "release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.10", config); + fixture.AssertFullSemver("2.0.0-beta.1+11", configuration); fixture.Repository.MakeACommit("release 11"); - fixture.AssertFullSemver("2.0.0-beta.11", config); + fixture.AssertFullSemver("2.0.0-beta.1+12", configuration); // Make new commit on feature Commands.Checkout(fixture.Repository, "feature/xxx"); @@ -545,52 +528,39 @@ public void FeatureFromReleaseBranchShouldNotResetCount() // Checkout to release (no new commits) Commands.Checkout(fixture.Repository, "release-2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.11", config); + fixture.AssertFullSemver("2.0.0-beta.1+12", configuration); // Merge feature to release fixture.Repository.MergeNoFF("feature/xxx", Generate.SignatureNow()); - fixture.AssertFullSemver("2.0.0-beta.15", config); + fixture.AssertFullSemver("2.0.0-beta.1+16", configuration); fixture.Repository.MakeACommit("release 13 - after feature merge"); - fixture.AssertFullSemver("2.0.0-beta.16", config); + fixture.AssertFullSemver("2.0.0-beta.1+17", configuration); } [Test] public void AssemblySemFileVerShouldBeWeightedByPreReleaseWeight() { - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - Branches = - { - { - "release", new BranchConfig - { - PreReleaseWeight = 1000 - } - } - } - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") + .WithBranch("release", builder => builder.WithPreReleaseWeight(1000)) .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeATaggedCommit("1.0.3"); fixture.Repository.MakeCommits(5); fixture.Repository.CreateBranch("release-2.0.0"); fixture.Checkout("release-2.0.0"); - var variables = fixture.GetVersion(config); - Assert.AreEqual("2.0.0.1001", variables.AssemblySemFileVer); + var variables = fixture.GetVersion(configuration); + Assert.That(variables.AssemblySemFileVer, Is.EqualTo("2.0.0.1001")); } [Test] public void AssemblySemFileVerShouldBeWeightedByDefaultPreReleaseWeight() { - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}" - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") .Build(); using var fixture = new EmptyRepositoryFixture(); @@ -598,8 +568,8 @@ public void AssemblySemFileVerShouldBeWeightedByDefaultPreReleaseWeight() fixture.Repository.MakeCommits(5); fixture.Repository.CreateBranch("release-2.0.0"); fixture.Checkout("release-2.0.0"); - var variables = fixture.GetVersion(config); - Assert.AreEqual("2.0.0.30001", variables.AssemblySemFileVer); + var variables = fixture.GetVersion(configuration); + Assert.That(variables.AssemblySemFileVer, Is.EqualTo("2.0.0.30001")); } /// @@ -608,11 +578,9 @@ public void AssemblySemFileVerShouldBeWeightedByDefaultPreReleaseWeight() [Test] public void FeatureOnReleaseFeatureBranchDeleted() { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .Build(); using var fixture = new EmptyRepositoryFixture(); const string release450 = "release/4.5.0"; @@ -625,7 +593,7 @@ public void FeatureOnReleaseFeatureBranchDeleted() // begin the release branch fixture.Repository.CreateBranch(release450); Commands.Checkout(fixture.Repository, release450); - fixture.AssertFullSemver("4.5.0-beta.0", config); + fixture.AssertFullSemver("4.5.0-beta.1+1", configuration); fixture.Repository.CreateBranch(featureBranch); Commands.Checkout(fixture.Repository, featureBranch); @@ -634,7 +602,7 @@ public void FeatureOnReleaseFeatureBranchDeleted() fixture.Repository.MergeNoFF(featureBranch, Generate.SignatureNow()); // commit 2 fixture.Repository.Branches.Remove(featureBranch); - fixture.AssertFullSemver("4.5.0-beta.2", config); + fixture.AssertFullSemver("4.5.0-beta.1+3", configuration); } /// @@ -643,11 +611,9 @@ public void FeatureOnReleaseFeatureBranchDeleted() [Test] public void FeatureOnReleaseFeatureBranchNotDeleted() { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, - VersioningMode = VersioningMode.ContinuousDeployment - }; + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .Build(); using var fixture = new EmptyRepositoryFixture(); const string release450 = "release/4.5.0"; @@ -660,7 +626,7 @@ public void FeatureOnReleaseFeatureBranchNotDeleted() // begin the release branch fixture.Repository.CreateBranch(release450); Commands.Checkout(fixture.Repository, release450); - fixture.AssertFullSemver("4.5.0-beta.0", config); + fixture.AssertFullSemver("4.5.0-beta.1+1", configuration); fixture.Repository.CreateBranch(featureBranch); Commands.Checkout(fixture.Repository, featureBranch); @@ -668,6 +634,21 @@ public void FeatureOnReleaseFeatureBranchNotDeleted() Commands.Checkout(fixture.Repository, release450); fixture.Repository.MergeNoFF(featureBranch, Generate.SignatureNow()); // commit 2 - fixture.AssertFullSemver("4.5.0-beta.2", config); + fixture.AssertFullSemver("4.5.0-beta.1+3", configuration); + } + + [TestCase("release/1.2.0", "1.2.0-beta.1+1", SemanticVersionFormat.Loose)] + [TestCase("release/1.2.0", "1.2.0-beta.1+1", SemanticVersionFormat.Strict)] + [TestCase("release/1.2", "1.2.0-beta.1+1", SemanticVersionFormat.Loose)] + [TestCase("release/1", "1.0.0-beta.1+1", SemanticVersionFormat.Loose)] + public void ShouldDetectVersionInReleaseBranch(string branchName, string expectedVersion, SemanticVersionFormat semanticVersionFormat) + { + var configuration = GitFlowConfigurationBuilder.New + .WithSemanticVersionFormat(semanticVersionFormat) + .Build(); + + using var fixture = new EmptyRepositoryFixture(branchName); + fixture.MakeACommit(); + fixture.AssertFullSemver(expectedVersion, configuration); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs index cafed1dfcc..af76ec7acd 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs @@ -1,10 +1,8 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests.Helpers; using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -15,14 +13,14 @@ public class RemoteRepositoryScenarios : TestBase public void GivenARemoteGitRepositoryWithCommitsThenClonedLocalShouldMatchRemoteVersion() { using var fixture = new RemoteRepositoryFixture(); - fixture.AssertFullSemver("0.1.0+4"); - fixture.AssertFullSemver("0.1.0+4", repository: fixture.LocalRepositoryFixture.Repository); + fixture.AssertFullSemver("0.0.1-5"); + fixture.AssertFullSemver("0.0.1-5", repository: fixture.LocalRepositoryFixture.Repository); } [Test] public void GivenARemoteGitRepositoryWithCommitsAndBranchesThenClonedLocalShouldMatchRemoteVersion() { - const string targetBranch = "release-1.0"; + const string targetBranch = "release-1.0.0"; using var fixture = new RemoteRepositoryFixture( path => { @@ -65,12 +63,14 @@ public void GivenARemoteGitRepositoryWithCommitsAndBranchesThenClonedLocalShould services.AddSingleton(environment); }); + sp.DiscoverRepository(); + var gitPreparer = sp.GetRequiredService(); gitPreparer.Prepare(); - fixture.AssertFullSemver("1.0.0-beta.1+5"); - fixture.AssertFullSemver("1.0.0-beta.1+5", repository: fixture.LocalRepositoryFixture.Repository); + fixture.AssertFullSemver("1.0.0-beta.1+10"); + fixture.AssertFullSemver("1.0.0-beta.1+10", repository: fixture.LocalRepositoryFixture.Repository); } [Test] @@ -78,11 +78,11 @@ public void GivenARemoteGitRepositoryAheadOfLocalRepositoryThenChangesShouldPull { using var fixture = new RemoteRepositoryFixture(); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("0.1.0+5"); - fixture.AssertFullSemver("0.1.0+4", repository: fixture.LocalRepositoryFixture.Repository); - var buildSignature = fixture.LocalRepositoryFixture.Repository.Config.BuildSignature(new DateTimeOffset(DateTime.Now)); - Commands.Pull((Repository)fixture.LocalRepositoryFixture.Repository, buildSignature, new PullOptions()); - fixture.AssertFullSemver("0.1.0+5", repository: fixture.LocalRepositoryFixture.Repository); + fixture.AssertFullSemver("0.0.1-6"); + fixture.AssertFullSemver("0.0.1-5", repository: fixture.LocalRepositoryFixture.Repository); + var buildSignature = fixture.LocalRepositoryFixture.Repository.Config.BuildSignature(new(DateTime.Now)); + Commands.Pull(fixture.LocalRepositoryFixture.Repository, buildSignature, new()); + fixture.AssertFullSemver("0.0.1-6", repository: fixture.LocalRepositoryFixture.Repository); } [Test] @@ -93,17 +93,16 @@ public void GivenARemoteGitRepositoryWhenCheckingOutDetachedHeadUsingExistingImp fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Head.Tip); - fixture.AssertFullSemver("0.1.0--no-branch-.1+4", repository: fixture.LocalRepositoryFixture.Repository, onlyTrackedBranches: false); + fixture.AssertFullSemver("0.0.1--no-branch-.1+5", repository: fixture.LocalRepositoryFixture.Repository, onlyTrackedBranches: false); } [Test] - [Ignore("Needs more investigations.")] public void GivenARemoteGitRepositoryWhenCheckingOutDetachedHeadUsingTrackingBranchOnlyBehaviourShouldReturnVersion014Plus5() { using var fixture = new RemoteRepositoryFixture(); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Head.Tip); - fixture.AssertFullSemver("0.1.0+4", repository: fixture.LocalRepositoryFixture.Repository); + fixture.AssertFullSemver("0.0.1--no-branch-.1+5", repository: fixture.LocalRepositoryFixture.Repository); } [Test] @@ -124,18 +123,34 @@ public void GivenARemoteGitRepositoryTheLocalAndRemoteBranchAreTreatedAsSamePare local.AssertFullSemver("1.0.2-bug-hotfix.1+1"); } - private static void CopyRemoteBranchesToHeads(IRepository repository) + private static void CopyRemoteBranchesToHeads(Repository repository) { foreach (var branch in repository.Branches) { - if (branch.IsRemote) + if (!branch.IsRemote) continue; + var localName = branch.FriendlyName.Replace($"{branch.RemoteName}/", ""); + if (repository.Branches[localName] == null) { - var localName = branch.FriendlyName.Replace($"{branch.RemoteName}/", ""); - if (repository.Branches[localName] == null) - { - repository.CreateBranch(localName, branch.FriendlyName); - } + repository.CreateBranch(localName, branch.FriendlyName); } } } + + [TestCase("origin", "release-2.0.0", "2.1.0-alpha.0")] + [TestCase("custom", "release-2.0.0", "0.1.0-alpha.5")] + [TestCase("origin", "release/3.0.0", "3.1.0-alpha.0")] + [TestCase("custom", "release/3.0.0", "0.1.0-alpha.5")] + public void EnsureRemoteReleaseBranchesAreTracked(string origin, string branchName, string expectedVersion) + { + using var fixture = new RemoteRepositoryFixture("develop"); + + fixture.CreateBranch(branchName); + fixture.MakeACommit(); + + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); + fixture.LocalRepositoryFixture.Fetch(origin); + fixture.LocalRepositoryFixture.Checkout("develop"); + + fixture.LocalRepositoryFixture.AssertFullSemver(expectedVersion); + } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/RepositoryFixtureExtensions.cs b/src/GitVersion.Core.Tests/IntegrationTests/RepositoryFixtureExtensions.cs new file mode 100644 index 0000000000..79706e422a --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/RepositoryFixtureExtensions.cs @@ -0,0 +1,40 @@ +using GitVersion.Extensions; + +namespace GitVersion.Core.Tests.IntegrationTests; + +internal static class RepositoryFixtureExtensions +{ + public static void MakeACommit(this RepositoryFixtureBase fixture, string commitMsg) + { + fixture.Repository.MakeACommit(commitMsg); + var diagramBuilder = (StringBuilder?)typeof(SequenceDiagram) + .GetField("diagramBuilder", BindingFlags.Instance | BindingFlags.NonPublic) + ?.GetValue(fixture.SequenceDiagram); + + var participant = GetParticipant(fixture.Repository.Head.FriendlyName); + if (participant != null) + { + AddTheCommitMessage(fixture, commitMsg, diagramBuilder, participant); + } + + string? GetParticipant(string participantName) => + (string?)typeof(SequenceDiagram).GetMethod("GetParticipant", BindingFlags.Instance | BindingFlags.NonPublic) + ?.Invoke(fixture.SequenceDiagram, + [ + participantName + ]); + } + + private static void AddTheCommitMessage(RepositoryFixtureBase fixture, string commitMsg, StringBuilder? diagramBuilder, string participant) + { + if (commitMsg.Length < 40) + { + diagramBuilder?.AppendLineFormat("{0} -> {0}: Commit '{1}'", participant, commitMsg); + } + else + { + var formattedCommitMsg = string.Join(System.Environment.NewLine, $"Commit '{commitMsg}'".SplitIntoLines(60)); + fixture.SequenceDiagram.NoteOver(formattedCommitMsg, participant); + } + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/SemVerOfAFeatureBranchStartedFromAReleaseBranchGetsDecrementedScenario.cs b/src/GitVersion.Core.Tests/IntegrationTests/SemVerOfAFeatureBranchStartedFromAReleaseBranchGetsDecrementedScenario.cs new file mode 100644 index 0000000000..b150e366b6 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/SemVerOfAFeatureBranchStartedFromAReleaseBranchGetsDecrementedScenario.cs @@ -0,0 +1,31 @@ +namespace GitVersion.Core.Tests.IntegrationTests; + +/// +/// [Bug] SemVer of a feature branch started from a release branch gets decremented #3151 +/// +[TestFixture] +public class SemVerOfAFeatureBranchStartedFromAReleaseBranchGetsDecrementedScenario +{ + [Test] + public void ShouldPickUpReleaseVersionAfterCreatedFromRelease() + { + using var fixture = new EmptyRepositoryFixture(); + + // Create develop and a release branch + fixture.MakeATaggedCommit("1.0.0"); + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.BranchTo("release/1.1.0"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-beta.1+2"); + + // Create a feature branch from the release/1.1.0 branch + fixture.BranchTo("feature/test"); + fixture.MakeACommit(); + + // ✅ succeeds as expected + fixture.AssertFullSemver("1.1.0-test.1+3"); + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/StringExtensions.cs b/src/GitVersion.Core.Tests/IntegrationTests/StringExtensions.cs new file mode 100644 index 0000000000..50577f3327 --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/StringExtensions.cs @@ -0,0 +1,50 @@ +namespace GitVersion.Core.Tests.IntegrationTests; + +public static class StringExtensions +{ + public static IEnumerable SplitIntoLines(this string str, int maxLineLength) + { + if (string.IsNullOrEmpty(str)) yield break; + + foreach (var line in SplitByNewlines(str)) + { + foreach (var wrapped in WrapWithWordBoundaries(line, maxLineLength)) + { + yield return wrapped; + } + } + } + + private static IEnumerable SplitByNewlines(string str) + => str.Split(["\r\n", "\n"], StringSplitOptions.None); + + private static IEnumerable WrapWithWordBoundaries(string line, int maxLength) + { + if (string.IsNullOrWhiteSpace(line)) + { + yield return string.Empty; + yield break; + } + + var index = 0; + while (index < line.Length) + { + var wrapAt = GetWrapIndex(line, index, maxLength); + yield return line.Substring(index, wrapAt - index).TrimEnd(); + index = wrapAt; + } + } + + private static int GetWrapIndex(string line, int start, int maxLength) + { + var remaining = line.Length - start; + if (remaining <= maxLength) + { + return line.Length; + } + + var end = start + maxLength; + var lastBreak = line.LastIndexOfAny([' ', '-'], end - 1, maxLength); + return lastBreak > start ? lastBreak + 1 : end; + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/SupportBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/SupportBranchScenarios.cs index d0706e436b..284077f656 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/SupportBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/SupportBranchScenarios.cs @@ -1,7 +1,6 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -13,42 +12,42 @@ public void SupportIsCalculatedCorrectly() { using var fixture = new EmptyRepositoryFixture(); // Start at 1.0.0 - fixture.Repository.MakeACommit(); - fixture.Repository.ApplyTag("1.1.0"); + fixture.MakeACommit(); + fixture.ApplyTag("1.1.0"); // Create 2.0.0 release - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release-2.0.0")); + fixture.BranchTo("release-2.0.0"); fixture.Repository.MakeCommits(2); // Merge into develop and main - Commands.Checkout(fixture.Repository, MainBranch); - fixture.Repository.MergeNoFF("release-2.0.0"); - fixture.Repository.ApplyTag("2.0.0"); + fixture.Checkout(MainBranch); + fixture.MergeNoFF("release-2.0.0"); + fixture.ApplyTag("2.0.0"); fixture.AssertFullSemver("2.0.0"); // Now lets support 1.x release - Commands.Checkout(fixture.Repository, "1.1.0"); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("support/1.0.0")); + fixture.Checkout("1.1.0"); + fixture.BranchTo("support/1.0.0"); fixture.AssertFullSemver("1.1.0"); // Create release branch from support branch - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release/1.2.0")); - fixture.Repository.MakeACommit(); + fixture.BranchTo("release/1.2.0"); + fixture.MakeACommit(); fixture.AssertFullSemver("1.2.0-beta.1+1"); // Create 1.2.0 release Commands.Checkout(fixture.Repository, "support/1.0.0"); fixture.Repository.MergeNoFF("release/1.2.0"); - fixture.AssertFullSemver("1.2.0+0"); + fixture.AssertFullSemver("1.2.0-2"); fixture.Repository.ApplyTag("1.2.0"); // Create 1.2.1 hotfix - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("hotfix/1.2.1")); - fixture.Repository.MakeACommit(); + fixture.BranchTo("hotfix/1.2.1"); + fixture.MakeACommit(); fixture.AssertFullSemver("1.2.1-beta.1+1"); - Commands.Checkout(fixture.Repository, "support/1.0.0"); - fixture.Repository.MergeNoFF("hotfix/1.2.1"); - fixture.AssertFullSemver("1.2.1+2"); + fixture.Checkout("support/1.0.0"); + fixture.MergeNoFF("hotfix/1.2.1"); + fixture.AssertFullSemver("1.2.1-2"); } [Test] @@ -69,33 +68,39 @@ public void WhenSupportIsBranchedAndTaggedFromAnotherSupportEnsureNewMinorIsUsed fixture.Repository.MakeACommit(); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("1.3.1+2"); + fixture.AssertFullSemver("1.3.1-2"); } [Test] public void WhenSupportIsBranchedFromMainWithSpecificTag() { + var configuration = GitFlowConfigurationBuilder.New.Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("0.1.0+0"); - fixture.Repository.ApplyTag("1.4.0-rc"); - fixture.Repository.MakeACommit(); - fixture.Repository.CreateBranch("support/1"); - Commands.Checkout(fixture.Repository, "support/1"); - fixture.AssertFullSemver("1.4.0+1"); + fixture.MakeACommit(); + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.ApplyTag("1.4.0-rc"); + fixture.MakeACommit(); + fixture.BranchTo("support/1"); + + fixture.AssertFullSemver("1.4.0-2", configuration); } [Test] public void WhenSupportIsBranchedFromMainWithSpecificTagOnCommit() { + var configuration = GitFlowConfigurationBuilder.New.Build(); + using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("0.1.0+0"); - fixture.Repository.ApplyTag("1.4.0-rc"); - fixture.Repository.CreateBranch("support/1"); - Commands.Checkout(fixture.Repository, "support/1"); - fixture.AssertFullSemver("1.4.0"); + fixture.MakeACommit(); + fixture.AssertFullSemver("0.0.1-1", configuration); + + fixture.ApplyTag("1.4.0-rc"); + fixture.BranchTo("support/1"); + + fixture.AssertFullSemver("1.4.0-1", configuration); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/SwitchingToGitFlowScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/SwitchingToGitFlowScenarios.cs index 6f8fd6fce9..8a5cb57179 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/SwitchingToGitFlowScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/SwitchingToGitFlowScenarios.cs @@ -1,7 +1,5 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -13,7 +11,7 @@ public void WhenDevelopBranchedFromMainWithLegacyVersionTagsDevelopCanUseReachab { using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeCommits(5); - fixture.Repository.MakeATaggedCommit("1.0.0.0"); + fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeCommits(2); Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); fixture.AssertFullSemver("1.1.0-alpha.2"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/TagCheckoutScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/TagCheckoutScenarios.cs index 6a1cc117fc..fbb56eb558 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/TagCheckoutScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/TagCheckoutScenarios.cs @@ -1,6 +1,4 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs index c119fbefbd..459fc5ef80 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs @@ -1,9 +1,7 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -11,27 +9,18 @@ namespace GitVersion.Core.Tests.IntegrationTests; public class VersionBumpingScenarios : TestBase { [Test] - public void AppliedPrereleaseTagCausesBump() + public void AppliedPreReleaseLabelCausesBump() { - var configuration = new Config - { - Branches = - { - { - MainBranch, new BranchConfig - { - Tag = "pre", - SourceBranches = new HashSet() - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, builder => builder.WithLabel("pre").WithSourceBranches()) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); fixture.Repository.MakeATaggedCommit("1.0.0-pre.1"); fixture.Repository.MakeACommit(); - fixture.AssertFullSemver("1.0.0-pre.2+1", configuration); + fixture.AssertFullSemver("1.0.0-pre.2", configuration); } [Test] @@ -42,11 +31,11 @@ public void CanUseCommitMessagesToBumpVersion() fixture.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit("+semver:minor"); - fixture.AssertFullSemver("1.1.0+1"); + fixture.AssertFullSemver("1.1.0-1"); fixture.Repository.MakeACommit("+semver:major"); - fixture.AssertFullSemver("2.0.0+2"); + fixture.AssertFullSemver("2.0.0-2"); } [Test] @@ -57,13 +46,13 @@ public void CanUseCommitMessagesToBumpVersion_TagTakesPriority() repo.MakeATaggedCommit("1.0.0"); repo.MakeACommit("+semver:major"); - fixture.AssertFullSemver("2.0.0+1"); + fixture.AssertFullSemver("2.0.0-1"); repo.ApplyTag("1.1.0"); fixture.AssertFullSemver("1.1.0"); repo.MakeACommit(); - fixture.AssertFullSemver("1.1.1+1"); + fixture.AssertFullSemver("1.1.1-1"); } [Theory] @@ -90,19 +79,17 @@ public void CanUseCommitMessagesToBumpVersion_TagTakesPriority() [TestCase("feat: Major update\n\nSome descriptive text\nWith a second line\n\nBREAKING CHANGE: A reason", "2.0.0")] public void CanUseConventionalCommitsToBumpVersion(string commitMessage, string expectedVersion) { - var configuration = new Config - { - VersioningMode = VersioningMode.Mainline, - + var configuration = GitFlowConfigurationBuilder.New // For future debugging of this regex: https://regex101.com/r/CRoBol/2 - MajorVersionBumpMessage = "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)", - + .WithMajorVersionBumpMessage(@"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w\s-]*\))?(!:|:.*\n\n((.+\n)+\n)?BREAKING CHANGE:\s.+)") // For future debugging of this regex: https://regex101.com/r/9ccNam/3 - MinorVersionBumpMessage = "^(feat)(\\([\\w\\s-]*\\))?:", - + .WithMinorVersionBumpMessage(@"^(feat)(\([\w\s-]*\))?:") // For future debugging of this regex: https://regex101.com/r/oFpqxA/2 - PatchVersionBumpMessage = "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:" - }; + .WithPatchVersionBumpMessage(@"^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\([\w\s-]*\))?:") + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", builder => builder.WithDeploymentMode(DeploymentMode.ContinuousDeployment)) + .Build(); + using var fixture = new EmptyRepositoryFixture(); fixture.Repository.MakeACommit(); fixture.MakeATaggedCommit("1.0.0"); @@ -118,7 +105,7 @@ public void CanUseCommitMessagesToBumpVersionBaseVersionTagIsAppliedToSameCommit fixture.Repository.MakeACommit(); fixture.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit("+semver:minor"); - fixture.AssertFullSemver("1.1.0+1"); + fixture.AssertFullSemver("1.1.0-1"); fixture.ApplyTag("2.0.0"); @@ -126,6 +113,6 @@ public void CanUseCommitMessagesToBumpVersionBaseVersionTagIsAppliedToSameCommit // Default bump is patch - fixture.AssertFullSemver("2.0.1+1"); + fixture.AssertFullSemver("2.0.1-1"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs index 33ac445def..387559ff4e 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs @@ -1,8 +1,6 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -15,7 +13,7 @@ public void TakesVersionFromNameOfReleaseBranch() using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); fixture.BranchTo("release/2.0.0"); - fixture.AssertFullSemver("2.0.0-beta.1+0"); + fixture.AssertFullSemver("2.0.0-beta.1+1"); } [Test] @@ -30,15 +28,14 @@ public void DoesNotTakeVersionFromNameOfNonReleaseBranch() [Test] public void TakesVersionFromNameOfBranchThatIsReleaseByConfig() { - var config = new Config - { - Branches = new Dictionary { { "support", new BranchConfig { IsReleaseBranch = true } } } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("support", builder => builder.WithIsReleaseBranch(true)) + .Build(); using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); fixture.BranchTo("support/2.0.0"); - fixture.AssertFullSemver("2.0.0+1", config); + fixture.AssertFullSemver("2.0.0-1", configuration); } [Test] @@ -47,24 +44,24 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() using var fixture = new RemoteRepositoryFixture(); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); fixture.LocalRepositoryFixture.Checkout("origin/release/2.0.0"); - fixture.LocalRepositoryFixture.AssertFullSemver("2.0.0-beta.1+1"); + fixture.LocalRepositoryFixture.AssertFullSemver("2.0.0-beta.1+6"); } [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); fixture.LocalRepositoryFixture.Checkout("upstream/release/2.0.0"); - fixture.LocalRepositoryFixture.AssertFullSemver("0.1.0-beta.1+5"); + fixture.LocalRepositoryFixture.AssertFullSemver("0.0.1-upstream-release-2-0-0.1+6"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs index fe026c9d13..8da8e0ce2c 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs @@ -1,8 +1,6 @@ -using GitTools.Testing; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; using LibGit2Sharp; -using NUnit.Framework; namespace GitVersion.Core.Tests.IntegrationTests; @@ -28,18 +26,32 @@ public void DoesNotTakeVersionFromNameOfNonReleaseBranch() fixture.AssertFullSemver("1.1.0-alpha.5"); } + [TestCase("release")] + [TestCase("hotfix")] + public void DoesNotTakeVersionFromBranchWithAccidentalVersion(string branch) + { + using var fixture = new EmptyRepositoryFixture(); + + fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo($"{branch}/downgrade-some-lib-to-3.2.1"); + fixture.MakeACommit(); + fixture.Checkout("main"); + fixture.MergeNoFF($"{branch}/downgrade-some-lib-to-3.2.1"); + + fixture.AssertFullSemver("1.0.1-2"); + } + [Test] public void TakesVersionFromNameOfBranchThatIsReleaseByConfig() { - var config = new Config - { - Branches = new Dictionary { { "support", new BranchConfig { IsReleaseBranch = true } } } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("support", builder => builder.WithIsReleaseBranch(true)) + .Build(); using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); fixture.CreateAndMergeBranchIntoDevelop("support/2.0.0"); - fixture.AssertFullSemver("2.1.0-alpha.2", config); + fixture.AssertFullSemver("2.1.0-alpha.2", configuration); } [Test] @@ -48,25 +60,25 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() using var fixture = new RemoteRepositoryFixture(); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); fixture.LocalRepositoryFixture.MergeNoFF("origin/release/2.0.0"); - fixture.LocalRepositoryFixture.AssertFullSemver("2.0.0+0"); + fixture.LocalRepositoryFixture.AssertFullSemver("2.0.0-7"); } [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + fixture.LocalRepositoryFixture.Fetch("upstream"); fixture.LocalRepositoryFixture.MergeNoFF("upstream/release/2.0.0"); - fixture.LocalRepositoryFixture.AssertFullSemver("0.1.0+6"); + fixture.LocalRepositoryFixture.AssertFullSemver("0.0.1-7"); } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs index 0253a5ac5f..f03603c417 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs @@ -1,10 +1,5 @@ -using GitTools.Testing; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.IntegrationTests; @@ -15,17 +10,14 @@ internal class VersionInTagScenarios public void TagPreReleaseWeightIsNotConfigured_HeadIsATaggedCommit_WeightedPreReleaseNumberShouldBeTheDefaultValue() { // Arrange - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}" - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") .Build(); // Act - using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.1.0"); - var version = fixture.GetVersion(config); + var version = fixture.GetVersion(configuration); // Assert version.AssemblySemFileVer.ShouldBe("1.1.0.60000"); @@ -35,18 +27,15 @@ public void TagPreReleaseWeightIsNotConfigured_HeadIsATaggedCommit_WeightedPreRe public void TagPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreReleaseNumberShouldBeTheSameAsTheTagPreReleaseWeight() { // Arrange - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - TagPreReleaseWeight = 65535 - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") + .WithTagPreReleaseWeight(65535) .Build(); // Act - using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); + using var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.1.0"); - var version = fixture.GetVersion(config); + var version = fixture.GetVersion(configuration); // Assert version.AssemblySemFileVer.ShouldBe("1.1.0.65535"); @@ -56,13 +45,9 @@ public void TagPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreRelea public void TagPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPreReleaseNumberShouldBeTheSameAsTheTagPreReleaseWeight() { // Arrange - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - TagPreReleaseWeight = 65535, - VersioningMode = VersioningMode.ContinuousDeployment - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") + .WithTagPreReleaseWeight(65535) .Build(); // Act @@ -73,9 +58,12 @@ public void TagPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPre fixture.MakeACommit("Feature commit 1"); fixture.BranchTo("release/1.1.0"); fixture.MakeACommit("Release commit 1"); - fixture.AssertFullSemver("1.1.0-beta.1", config); + fixture.AssertFullSemver("1.1.0-beta.1+3", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("release/1.1.0"); fixture.ApplyTag("1.1.0"); - var version = fixture.GetVersion(config); + var version = fixture.GetVersion(configuration); // Assert version.AssemblySemFileVer.ShouldBe("1.1.0.65535"); @@ -85,12 +73,8 @@ public void TagPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPre public void TagPreReleaseWeightIsNotConfigured_GitFlowReleaseIsFinished_WeightedPreReleaseNumberShouldBeTheDefaultValue() { // Arrange - var config = new ConfigurationBuilder() - .Add(new Config - { - AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - VersioningMode = VersioningMode.ContinuousDeployment - }) + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") .Build(); // Act @@ -101,9 +85,12 @@ public void TagPreReleaseWeightIsNotConfigured_GitFlowReleaseIsFinished_Weighted fixture.MakeACommit("Feature commit 1"); fixture.BranchTo("release/1.1.0"); fixture.MakeACommit("Release commit 1"); - fixture.AssertFullSemver("1.1.0-beta.1", config); + fixture.AssertFullSemver("1.1.0-beta.1+3", configuration); + + fixture.Checkout("main"); + fixture.MergeNoFF("release/1.1.0"); fixture.ApplyTag("1.1.0"); - var version = fixture.GetVersion(config); + var version = fixture.GetVersion(configuration); // Assert version.AssemblySemFileVer.ShouldBe("1.1.0.60000"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs index c5b66e8055..89cfd4c2ce 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs @@ -1,26 +1,24 @@ -using GitTools.Testing; +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; +using Microsoft.Extensions.DependencyInjection; namespace GitVersion.Core.Tests.IntegrationTests; [TestFixture] public class WorktreeScenarios : TestBase { - [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UseWorktreeRepositoryForVersion() { + var sp = ConfigureServices(); + var fileSystem = sp.GetRequiredService(); using var fixture = new EmptyRepositoryFixture(); - var repoDir = new DirectoryInfo(fixture.RepositoryPath); + var repoDir = fileSystem.DirectoryInfo.New(fixture.RepositoryPath); repoDir.Parent.ShouldNotBeNull(); - var worktreePath = PathHelper.Combine(repoDir.Parent.FullName, $"{repoDir.Name}-v1"); + var worktreePath = FileSystemHelper.Path.Combine(repoDir.Parent.FullName, $"{repoDir.Name}-v1"); fixture.Repository.MakeATaggedCommit("v1.0.0"); var branchV1 = fixture.Repository.CreateBranch("support/1.0"); @@ -29,8 +27,7 @@ public void UseWorktreeRepositoryForVersion() fixture.AssertFullSemver("2.0.0"); fixture.Repository.Worktrees.Add(branchV1.CanonicalName, "1.0", worktreePath, false); - using var worktreeFixture = new LocalRepositoryFixture(new Repository(worktreePath)); + using var worktreeFixture = new LocalRepositoryFixture(new(worktreePath)); worktreeFixture.AssertFullSemver("1.0.0"); } - } diff --git a/src/GitVersion.Core.Tests/Logging/LoggerTest.cs b/src/GitVersion.Core.Tests/Logging/LoggerTest.cs index 4c1d4129cb..25fd83ab0a 100644 --- a/src/GitVersion.Core.Tests/Logging/LoggerTest.cs +++ b/src/GitVersion.Core.Tests/Logging/LoggerTest.cs @@ -1,7 +1,5 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.Logging; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -17,14 +15,15 @@ public void LoggerObscuresPassword(string protocol) const string password = "password"; var s = string.Empty; - void Action(string info) => s = info; - var logAppender = new TestLogAppender(Action); var log = new Log(logAppender); log.Info($"{protocol}://{username}:{password}@workspace.visualstudio.com/DefaultCollection/_git/CAS"); s.Contains(password).ShouldBe(false); + return; + + void Action(string info) => s = info; } [Test] @@ -32,15 +31,16 @@ public void UsernameWithoutPassword() { var s = string.Empty; - void Action(string info) => s = info; - var logAppender = new TestLogAppender(Action); var log = new Log(logAppender); - const string repoUrl = "http://username@workspace.visualstudio.com/DefaultCollection/_git/CAS"; + const string repoUrl = "https://username@workspace.visualstudio.com/DefaultCollection/_git/CAS"; log.Info(repoUrl); s.Contains(repoUrl).ShouldBe(true); + return; + + void Action(string info) => s = info; } } diff --git a/src/GitVersion.Core.Tests/Logging/LoggingTests.cs b/src/GitVersion.Core.Tests/Logging/LoggingTests.cs index 72e611b939..9a8b45ab8a 100644 --- a/src/GitVersion.Core.Tests/Logging/LoggingTests.cs +++ b/src/GitVersion.Core.Tests/Logging/LoggingTests.cs @@ -1,5 +1,4 @@ using GitVersion.Logging; -using NUnit.Framework; namespace GitVersion.Core.Tests.Logging; diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs new file mode 100644 index 0000000000..dd9618f778 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhen.cs @@ -0,0 +1,98 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenADevelopBranchWithOneCommitMergedToMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New.WithLabel(null) + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("develop", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 55 minutes ago (HEAD -> main) + // |\ + // | * 56 minutes ago (develop) + // |/ + // * 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("develop"); + fixture.MakeACommit("B"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-alpha.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-alpha.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-alpha.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.1-alpha.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.2-alpha.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-alpha.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.1.0-alpha.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.1.1-alpha.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.2.0-alpha.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("develop", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("develop", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs new file mode 100644 index 0000000000..6e560d4fcd --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitFlow+GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable.cs @@ -0,0 +1,100 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New.WithLabel(null) + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("develop", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 55 minutes ago (tag: 1.0.0, main) + // |\ + // | * 56 minutes ago (HEAD -> develop) + // |/ + // * 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("develop"); + fixture.MakeACommit("B"); + fixture.MergeTo("main"); + fixture.ApplyTag("1.0.0"); + fixture.Checkout("develop"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+0")] + public string GetVersionWithTrackMergeTargetOnDevelop(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("develop", b => b.WithIncrement(increment).WithTrackMergeTarget(true)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-alpha.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-alpha.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-alpha.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.1-alpha.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.2-alpha.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-alpha.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.1.0-alpha.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.1.1-alpha.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.2.0-alpha.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-alpha.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "1.0.0-alpha.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "1.0.1-alpha.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "1.1.0-alpha.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "2.0.0-alpha.1+1")] + public string GetVersionWithNoTrackMergeTargetOnDevelop(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("develop", b => b.WithIncrement(increment).WithTrackMergeTarget(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs new file mode 100644 index 0000000000..94aa15cd6d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen.cs @@ -0,0 +1,238 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithAMergeCommitFromMainMergedBackToMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New.WithLabel(null) + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 52 minutes ago (HEAD -> main) + // |\ + // | * 53 minutes ago (feature/foo) + // | |\ + // | |/ + // |/| + // C | 54 minutes ago + // | B 56 minutes ago + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.Checkout("main"); + fixture.MakeACommit("C"); + fixture.Checkout("main"); + fixture.MergeTo("feature/foo"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+3")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+3")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+3")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+3")] + public string GetVersion(IncrementStrategy increment, IncrementStrategy incrementOnFeature, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .WithBranch("feature", b => b.WithIncrement(incrementOnFeature)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+3")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+3")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.3.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.3.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+3")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "3.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "3.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "3.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+3")] + public string GetVersionWithPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy increment, IncrementStrategy incrementOnFeature, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(incrementOnFeature)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs new file mode 100644 index 0000000000..40cd7b368e --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithAMergeCommitFromMainWhen.cs @@ -0,0 +1,177 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithAMergeCommitFromMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New.WithLabel(null) + .WithVersionStrategy(VersionStrategies.Mainline) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 53 minutes ago (HEAD -> feature/foo) + // |\ + // | B 54 minutes ago + // C | 56 minutes ago (main) + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.Checkout("main"); + fixture.MakeACommit("C"); + fixture.MergeTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, ExpectedResult = "0.0.3-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.2.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.3.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, ExpectedResult = "0.3.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "2.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "2.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "3.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, ExpectedResult = "3.0.0-foo.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, ExpectedResult = "0.0.3-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.2.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.3.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, ExpectedResult = "0.3.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "2.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "2.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "3.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, ExpectedResult = "3.0.0-foo.1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-foo.3+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, ExpectedResult = "0.0.0-foo.3+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.2-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, ExpectedResult = "0.0.3-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.2.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.2.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.3.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, ExpectedResult = "0.3.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "2.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "2.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "2.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "3.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, ExpectedResult = "3.0.0-foo.1+2")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, ExpectedResult = "0.0.3-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, ExpectedResult = "0.2.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, ExpectedResult = "0.3.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, ExpectedResult = "0.3.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, ExpectedResult = "2.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, ExpectedResult = "2.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, ExpectedResult = "3.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, ExpectedResult = "3.0.0-foo.1+2")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs new file mode 100644 index 0000000000..1e04bf98ff --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhen.cs @@ -0,0 +1,490 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs new file mode 100644 index 0000000000..d50c5f70c7 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor.cs @@ -0,0 +1,1411 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: major"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs new file mode 100644 index 0000000000..a00d17cd06 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor.cs @@ -0,0 +1,1411 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: minor"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs new file mode 100644 index 0000000000..0ad6e69527 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch.cs @@ -0,0 +1,1410 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitAHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: patch"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs new file mode 100644 index 0000000000..219be0a0d1 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) (tag 0.0.0-4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-4"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..0a5374d23d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) (tag 0.0.0-bar) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-bar"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..7bf83c189f --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) (tag 0.0.0-foo.4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-foo.4"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs new file mode 100644 index 0000000000..97efbbf7ce --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable.cs @@ -0,0 +1,495 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitATaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) (tag 0.0.0) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs new file mode 100644 index 0000000000..8ebc1e8f73 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor.cs @@ -0,0 +1,1418 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B +semver: major"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs new file mode 100644 index 0000000000..2e640520c0 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor.cs @@ -0,0 +1,1418 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B +semver: minor"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs new file mode 100644 index 0000000000..3b71db21b8 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch.cs @@ -0,0 +1,1418 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B +semver: patch"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b + .WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs new file mode 100644 index 0000000000..b249171f7b --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-4) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..eca7cd7cf8 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-bar) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-bar"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..e039a08a3b --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0-foo.4) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-foo.4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs new file mode 100644 index 0000000000..2c8e51e591 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable.cs @@ -0,0 +1,871 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitBranchedFromMainWhenCommitBTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 47 minutes ago (HEAD -> feature/foo) (tag 0.0.0) + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithNoLabelOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithEmptyLabelOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithLabelFooOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithLabelBarOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs new file mode 100644 index 0000000000..0d4c52125e --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhen.cs @@ -0,0 +1,958 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 54 minutes ago (HEAD -> main) + // |\ + // | B 56 minutes ago (feature/foo) + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs new file mode 100644 index 0000000000..d2b9587ce7 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease.cs @@ -0,0 +1,952 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + fixture = new EmptyRepositoryFixture(); + + // * 54 minutes ago (HEAD -> main) + // |\ + // | B 56 minutes ago (feature/foo) (tag 0.0.0-4) + // |/ + // A 58 minutes ago + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-4"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-5+1")] + + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..36d496fc6b --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar.cs @@ -0,0 +1,951 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + fixture = new EmptyRepositoryFixture(); + + // * 55 minutes ago (HEAD -> main) + // |\ + // | B 56 minutes ago (feature/foo) (tag 0.0.0-bar) + // |/ + // A 58 minutes ago + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-bar"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar+1")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..e3a96954a6 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo.cs @@ -0,0 +1,951 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + fixture = new EmptyRepositoryFixture(); + + // * 55 minutes ago (HEAD -> main) + // |\ + // | B 56 minutes ago (feature/foo) (tag 0.0.0-foo.4) + // |/ + // A 58 minutes ago + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0-foo.4"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+2")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+1")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+2")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs new file mode 100644 index 0000000000..854811f409 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable.cs @@ -0,0 +1,951 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWhenCommitBTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + fixture = new EmptyRepositoryFixture(); + + // * 55 minutes ago (HEAD -> main) + // |\ + // | B 56 minutes ago (feature/foo) (tag 0.0.0) + // |/ + // A 58 minutes ago + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.0.0"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-1+1")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+1")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.1+1")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-bar.1+1")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-bar.1+1")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs new file mode 100644 index 0000000000..28c9ea8f94 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen.cs @@ -0,0 +1,963 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitMergedToMainWithOneCommitBranchedToFeatureWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 53 minutes ago (HEAD -> feature/foo) (main) + // |\ + // C | 54 minutes ago + // | B 56 minutes ago + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.Checkout("main"); + fixture.MakeACommit("C"); + fixture.Checkout("feature/foo"); + fixture.MergeTo("main", removeBranchAfterMerging: true); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.2-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelNullOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.3.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "3.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.3.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "3.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.3.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "3.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.3.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.3.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "3.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "3.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "3.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.3.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "3.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.2-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.3.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "3.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.3.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "3.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.3.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "3.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "3.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.2-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.3.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "3.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.3.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "3.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.3.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "3.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "3.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.3.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "3.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.2-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.2-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.2-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.2.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.3+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.3+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.2-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.3+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.2-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.3.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.3.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "3.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "3.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "3.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.3.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.4.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "3.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "3.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "4.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "4.0.0-1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "4.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.4+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.3.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.3.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.4.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "3.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "3.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "3.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "4.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "4.0.0-bar.1+0")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.3.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.4.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "3.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "3.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "4.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhen.cs new file mode 100644 index 0000000000..76c4839581 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhen.cs @@ -0,0 +1,60 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..25f500873d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A +semver: major"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..aa346a999a --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A +semver: minor"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..ccdf753b23 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A +semver: patch"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..17c7fddc99 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs @@ -0,0 +1,91 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) (tag 0.0.0-4) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-5+0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.0-5+0")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithPreventIncrementWhenCurrentCommitTaggedFalse(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..0ef713c59c --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,91 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) (tag 0.0.0-bar) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-bar"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar+0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar+0")] + public string GetVersionWithPreventIncrementWhenCurrentCommitTaggedFalse(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..1765d86cad --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,91 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) (tag 0.0.0-foo.4) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-foo.4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithPreventIncrementWhenCurrentCommitTaggedFalse(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsStable.cs new file mode 100644 index 0000000000..b9f5b03937 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsStable.cs @@ -0,0 +1,91 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithOneCommitWhenCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> feature/foo) (tag 0.0.0) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + public string GetVersionWithPreventIncrementWhenCurrentCommitTaggedFalse(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs new file mode 100644 index 0000000000..7883bb8bd2 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen.cs @@ -0,0 +1,321 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithThreeCommitsBranchedFromMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // D 45 minutes ago (HEAD -> feature/foo) + // C 46 minutes ago + // B 47 minutes ago + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs new file mode 100644 index 0000000000..2b190b7282 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsMergedToMainWhen.cs @@ -0,0 +1,962 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithThreeCommitsMergedToMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 54 minutes ago (HEAD -> main) + // |\ + // | D 55 minutes ago (feature/foo) + // | C 56 minutes ago + // | B 57 minutes ago + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MakeACommit("D"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + public string GetVersionWithLabelNullOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+4")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+4")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.2+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+4")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+4")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsWhen.cs new file mode 100644 index 0000000000..540bde6834 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithThreeCommitsWhen.cs @@ -0,0 +1,66 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithThreeCommitsWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // C 57 minutes ago (HEAD -> feature/foo) + // B 58 minutes ago + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs new file mode 100644 index 0000000000..d7887d9be8 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen.cs @@ -0,0 +1,319 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithTwoCommitsBranchedFromMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // C 46 minutes ago (HEAD -> feature/foo) + // B 47 minutes ago + // A 51 minutes ago (main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+2")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+2")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs new file mode 100644 index 0000000000..18458da0f6 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsMergedToMainWhen.cs @@ -0,0 +1,960 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithTwoCommitsMergedToMainWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitFlowConfigurationBuilder MainlineBuilder => GitFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // * 54 minutes ago (HEAD -> main) + // |\ + // | C 55 minutes ago (feature/foo) + // | B 56 minutes ago + // |/ + // A 58 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + fixture.MergeTo("main"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithLabelNullOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithLabelNullAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-1+3")] + public string GetVersionWithEmptyLabelAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty).WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-foo.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+3")] + public string GetVersionWithLabelFooAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-bar.2+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+3")] + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-bar.2+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-bar.1+3")] + public string GetVersionWithLabelBarAndPreventIncrementOfMergedBranchVersionFalseOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar").WithPreventIncrementOfMergedBranch(false)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..e1b1807167 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs @@ -0,0 +1,65 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> feature/foo) + // A 59 minutes ago (tag 0.0.3-4) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-4"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.3-5+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.3-5+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+2")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+2")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..d83467f733 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,65 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> feature/foo) + // A 59 minutes ago (tag 0.0.3-bar) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-bar"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.3-bar+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+2")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+2")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+2")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+2")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+2")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.3-bar+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..29ddbb46a8 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,65 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAFeatureBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> feature/foo) + // A 59 minutes ago (tag 0.0.3-foo.4) + + fixture = new EmptyRepositoryFixture("feature/foo"); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-foo.4"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.3-foo.5+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+2")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+2")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+2")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+2")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.3-foo.5+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+2")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+2")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+2")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+2")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs new file mode 100644 index 0000000000..812e314d6d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhen.cs @@ -0,0 +1,489 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..fbc2b8d54d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor.cs @@ -0,0 +1,1409 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: major"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..f8fa228bd1 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor.cs @@ -0,0 +1,1409 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: minor"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..a174d7294b --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch.cs @@ -0,0 +1,1408 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: patch"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMergeMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..0007496360 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease.cs @@ -0,0 +1,945 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-4"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..2abdb7b357 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,945 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-bar) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-bar"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..7ceb1328e3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,945 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0-foo.4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-foo.4"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.4")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.5+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs new file mode 100644 index 0000000000..470c506735 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable.cs @@ -0,0 +1,945 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitBranchedToFeatureWhenCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 58 minutes ago (HEAD -> feature/foo, main) (tag 0.0.0) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMainAndPreventIncrementWhenCurrentCommitTaggedFalseOnFeature( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label).WithPreventIncrementWhenCurrentCommitTagged(false)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs new file mode 100644 index 0000000000..d9e4e761f9 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhen.cs @@ -0,0 +1,60 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..fe2a983797 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: major"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..c138a0a3e2 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: minor"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..ff12dbe0ef --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch.cs @@ -0,0 +1,118 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: patch"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..31fbbf6d25 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease.cs @@ -0,0 +1,61 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) (tag 0.0.0-4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.0-4")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.0-4")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..293eee070a --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,61 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) (tag 0.0.0-bar) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-bar"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-bar")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0-bar")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..34ac29009d --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,61 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) (tag 0.0.0-foo.4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0-foo.4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0-foo.4")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0-foo.4")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs new file mode 100644 index 0000000000..15e889503c --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable.cs @@ -0,0 +1,61 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithOneCommitWhenCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // A 59 minutes ago (HEAD -> main) (tag 0.0.0) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.0"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.0.0")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.0.0")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.0.0")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs new file mode 100644 index 0000000000..a5d6560d08 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithThreeCommitsWhen.cs @@ -0,0 +1,64 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithThreeCommitsWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // C 57 minutes agov (HEAD -> main) + // B 58 minutes ago + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.MakeACommit("C"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs new file mode 100644 index 0000000000..fdfc174ffe --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen.cs @@ -0,0 +1,490 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..c193e8470f --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor.cs @@ -0,0 +1,1411 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: major"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "1.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "1.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "1.0.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.0.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "1.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "1.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "1.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "1.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "1.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "1.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "1.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "1.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..a657a8dfc3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor.cs @@ -0,0 +1,1411 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: minor"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.1-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.1.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.1.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.1.1-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.1.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.1.2-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..a5afd1e6aa --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch.cs @@ -0,0 +1,1411 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: patch"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndDisabledMessageIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelAndMergeMessageOnlyIncrementingOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndDisabledMessageIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + + public string GetVersionWithEmptyLabelAndMergeMessageOnlyIncrementingOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.1-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.1-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.1-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndDisabledMessageIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.1-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.1-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.0-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.1-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.0-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.2-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.2-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.2-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarAndMergeMessageOnlyIncrementModeOnMain( + IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar") + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..c72d4ad348 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago (0.0.3-4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-4"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..81acd1b342 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago (0.0.3-bar) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-bar"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.3+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.2.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.3.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "2.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "2.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "3.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..40dafb7ea0 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago (0.0.3-foo.4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-foo.4"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.6+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.6+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.6+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.3+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.2.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.3.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.3.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "2.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "2.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "3.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "2.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "2.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "2.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "3.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs new file mode 100644 index 0000000000..54cb6d6552 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable.cs @@ -0,0 +1,491 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsBranchedToFeatureWhenFirstCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)) + .WithBranch("feature", b => b + .WithDeploymentMode(DeploymentMode.ManualDeployment).WithPreventIncrementWhenCurrentCommitTagged(true) + ); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 54 minutes ago (main) (HEAD -> feature/foo) + // A 56 minutes ago (0.0.3) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("B"); + fixture.BranchTo("feature/foo"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithNoLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(null)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithEmptyLabelOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel(string.Empty)) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.2+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelFooOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("foo")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.3-1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.3-bar.2+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.None, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.3-foo.1+0")] + + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, null, ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, null, ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "", ExpectedResult = "0.0.4-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "", ExpectedResult = "0.0.5-1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "foo", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "bar", ExpectedResult = "0.0.4-bar.2+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.0.5-bar.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.0.4-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Patch, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.0.5-foo.1+0")] + + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, null, ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, null, ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "", ExpectedResult = "0.2.0-1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "foo", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "bar", ExpectedResult = "0.2.0-bar.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.None, "{BranchName}", ExpectedResult = "0.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "0.1.1-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Minor, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "0.2.0-foo.1+0")] + + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, null, ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, null, ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "", ExpectedResult = "2.0.0-1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "foo", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "bar", ExpectedResult = "2.0.0-bar.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.None, "{BranchName}", ExpectedResult = "1.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Patch, "{BranchName}", ExpectedResult = "1.0.1-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Minor, "{BranchName}", ExpectedResult = "1.1.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Major, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + [TestCase(IncrementStrategy.Major, IncrementStrategy.Inherit, "{BranchName}", ExpectedResult = "2.0.0-foo.1+0")] + public string GetVersionWithLabelBarOnMain(IncrementStrategy incrementOnMain, IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(incrementOnMain).WithLabel("bar")) + .WithBranch("feature", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs new file mode 100644 index 0000000000..f4966a63cb --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhen.cs @@ -0,0 +1,62 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhen + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..11e2e54c8e --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: major"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "1.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "1.0.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "1.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "1.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "1.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..9227937fae --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: minor"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.1.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.1.1-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.1-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.1-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..fcc8754ec1 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A +semver: patch"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.1-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..d0e8154163 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.0.3-4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-4"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-5+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..54e2b24c67 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.0.3-bar) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-bar"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-bar+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-bar+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..55cb336422 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.0.3-foo.4) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3-foo.4"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-foo.1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.5+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs new file mode 100644 index 0000000000..086d5638ec --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenFirstCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.0.3) + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.ApplyTag("0.0.3"); + fixture.MakeACommit("B"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.3-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.3-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.4-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "1.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.3-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.4-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "1.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.3-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.4-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "1.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs new file mode 100644 index 0000000000..6e0626b22c --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMajor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B +semver: major"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "1.0.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "1.0.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "1.0.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs new file mode 100644 index 0000000000..b3f51bfa51 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessageMinor + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B +semver: minor"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.1.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.1.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.1.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs new file mode 100644 index 0000000000..1406795ae2 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch.cs @@ -0,0 +1,120 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitHasBumpMessagePatch + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B +semver: patch"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.1-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.1-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.1-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithDisabledMessageIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.Disabled) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.0.0-2+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.0.2-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.0.0-foo.2+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.0.2-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.0.0-bar.2+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.0.2-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersionWithMergeMessageOnlyIncrementing(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label) + .WithCommitMessageIncrementing(CommitMessageIncrementMode.MergeMessageOnly) + ).Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs new file mode 100644 index 0000000000..e1cea97f72 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreRelease + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) (tag 0.2.0-4) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.2.0-4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.2.0-4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-4")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.2.0-4")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs new file mode 100644 index 0000000000..c07bcc22e4 --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseBar + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) (tag 0.2.0-bar) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.2.0-bar"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.2.0-bar")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.1+1")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "2.0.0-foo.1+1")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.2.0-bar")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs new file mode 100644 index 0000000000..c64ad215be --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsPreReleaseFoo + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) (tag 0.2.0-foo.4) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.2.0-foo.4"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.2.0-foo.4")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0-1+1")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "2.0.0-1+1")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0-foo.4")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.2.0-foo.4")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0-bar.1+1")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "2.0.0-bar.1+1")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs new file mode 100644 index 0000000000..3be1bc7ecc --- /dev/null +++ b/src/GitVersion.Core.Tests/Mainline/MainlineScenariosWithAGitHubFlow+GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable.cs @@ -0,0 +1,63 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests; +using GitVersion.Core.Tests.IntegrationTests; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Mainline; + +internal partial class MainlineScenariosWithAGitHubFlow +{ + [Parallelizable(ParallelScope.All)] + public class GivenAMainBranchWithTwoCommitsWhenSecondCommitTaggedAsStable + { + private EmptyRepositoryFixture? fixture; + + private static GitHubFlowConfigurationBuilder MainlineBuilder => GitHubFlowConfigurationBuilder.New + .WithVersionStrategy(VersionStrategies.Mainline).WithLabel(null) + .WithBranch("main", b => b.WithDeploymentMode(DeploymentMode.ManualDeployment)); + + [OneTimeSetUp] + public void OneTimeSetUp() + { + // B 58 minutes ago (HEAD -> main) (tag 0.2.0) + // A 59 minutes ago + + fixture = new EmptyRepositoryFixture(); + + fixture.MakeACommit("A"); + fixture.MakeACommit("B"); + fixture.ApplyTag("0.2.0"); + } + + [OneTimeTearDown] + public void OneTimeTearDown() => fixture?.Dispose(); + + [TestCase(IncrementStrategy.None, null, ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Patch, null, ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Minor, null, ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Major, null, ExpectedResult = "0.2.0")] + + [TestCase(IncrementStrategy.None, "", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Patch, "", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Minor, "", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Major, "", ExpectedResult = "0.2.0")] + + [TestCase(IncrementStrategy.None, "foo", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Patch, "foo", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Minor, "foo", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Major, "foo", ExpectedResult = "0.2.0")] + + [TestCase(IncrementStrategy.None, "bar", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Patch, "bar", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Minor, "bar", ExpectedResult = "0.2.0")] + [TestCase(IncrementStrategy.Major, "bar", ExpectedResult = "0.2.0")] + public string GetVersion(IncrementStrategy increment, string? label) + { + var mainline = MainlineBuilder + .WithBranch("main", b => b.WithIncrement(increment).WithLabel(label)) + .Build(); + + return fixture!.GetVersion(mainline).FullSemVer; + } + } +} diff --git a/src/GitVersion.Core.Tests/Model/MergeMessageTests.cs b/src/GitVersion.Core.Tests/MergeMessageTests.cs similarity index 61% rename from src/GitVersion.Core.Tests/Model/MergeMessageTests.cs rename to src/GitVersion.Core.Tests/MergeMessageTests.cs index 9d441619db..7cf016e0be 100644 --- a/src/GitVersion.Core.Tests/Model/MergeMessageTests.cs +++ b/src/GitVersion.Core.Tests/MergeMessageTests.cs @@ -1,30 +1,28 @@ +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; [TestFixture] public class MergeMessageTests : TestBase { - private readonly Config config = new() { TagPrefix = Config.DefaultTagPrefix }; + private readonly GitFlowConfigurationBuilder configurationBuilder = GitFlowConfigurationBuilder.New; [Test] public void NullMessageStringThrows() => // Act / Assert - Should.Throw(() => new MergeMessage(null, this.config)); + Should.Throw(() => new MergeMessage(null!, this.configurationBuilder.Build())); [TestCase("")] [TestCase("\t\t ")] public void EmptyMessageString(string message) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.TargetBranch.ShouldBeNull(); - sut.MergedBranch.ShouldBeEmpty(); + sut.MergedBranch.ShouldBeNull(); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBeNull(); @@ -33,33 +31,33 @@ public void EmptyMessageString(string message) [TestCase("")] [TestCase("\t\t ")] [TestCase(null)] - public void EmptyTagPrefix(string prefix) + public void EmptyTagPrefix(string? prefix) { // Arrange const string message = "Updated some code."; - var conf = new Config { TagPrefix = prefix }; + var configuration = GitHubFlowConfigurationBuilder.New.WithTagPrefixPattern(prefix).Build(); // Act - var sut = new MergeMessage(message, conf); + var sut = new MergeMessage(message, configuration); // Assert sut.TargetBranch.ShouldBeNull(); - sut.MergedBranch.ShouldBeEmpty(); + sut.MergedBranch.ShouldBeNull(); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBeNull(); } private static readonly object?[] MergeMessages = - { + [ new object?[] { "Merge branch 'feature/one'", "feature/one", null, null }, new object?[] { "Merge branch 'origin/feature/one'", "origin/feature/one", null, null }, new object?[] { $"Merge tag 'v4.0.0' into {MainBranch}", "v4.0.0", MainBranch, new SemanticVersion(4) }, new object?[] { $"Merge tag 'V4.0.0' into {MainBranch}", "V4.0.0", MainBranch, new SemanticVersion(4) }, - new object?[] { "Merge branch 'feature/4.1/one'", "feature/4.1/one", null, new SemanticVersion(4, 1) }, - new object?[] { "Merge branch 'origin/4.1/feature/one'", "origin/4.1/feature/one", null, new SemanticVersion(4, 1) }, + new object?[] { "Merge branch 'feature/4.1.0/one'", "feature/4.1.0/one", null, new SemanticVersion(4, 1) }, + new object?[] { "Merge branch 'origin/4.1.0/feature/one'", "origin/4.1.0/feature/one", null, new SemanticVersion(4, 1) }, new object?[] { $"Merge tag 'v://10.10.10.10' into {MainBranch}", "v://10.10.10.10", MainBranch, null } - }; + ]; [TestCaseSource(nameof(MergeMessages))] public void ParsesMergeMessage( @@ -69,27 +67,26 @@ public void ParsesMergeMessage( SemanticVersion expectedVersion) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("Default"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBe(expectedVersion); } private static readonly object?[] GitHubPullPullMergeMessages = - { - new object?[] { "Merge pull request #1234 from feature/one", "feature/one", null, null, 1234 }, - new object?[] { "Merge pull request #1234 in feature/one", "feature/one", null, null, 1234 }, - new object?[] { "Merge pull request #1234 in v4.0.0", "v4.0.0", null, new SemanticVersion(4), 1234 }, - new object?[] { "Merge pull request #1234 from origin/feature/one", "origin/feature/one", null, null, 1234 }, - new object?[] { "Merge pull request #1234 in feature/4.1/one", "feature/4.1/one", null, new SemanticVersion(4,1), 1234 }, - new object?[] { "Merge pull request #1234 in V://10.10.10.10", "V://10.10.10.10", null, null, 1234 }, - new object?[] { "Merge pull request #1234 from feature/one into dev", "feature/one", "dev", null, 1234 } - }; + [ + new object?[] { "Merge pull request #1234 from organization/feature/one", "feature/one", null, null, 1234 }, + new object?[] { "Merge pull request #1234 in organization/feature/one", "feature/one", null, null, 1234 }, + new object?[] { "Merge pull request #1234 in v4.0.0", "v4.0.0", null, new SemanticVersion(4), 1234 }, + new object?[] { "Merge pull request #1234 in organization/feature/4.1.0/one", "feature/4.1.0/one", null, new SemanticVersion(4, 1), 1234 }, + new object?[] { "Merge pull request #1234 from organization/feature/one into dev", "feature/one", "dev", null, 1234 } + ]; [TestCaseSource(nameof(GitHubPullPullMergeMessages))] public void ParsesGitHubPullMergeMessage( @@ -100,30 +97,31 @@ public void ParsesGitHubPullMergeMessage( int? expectedPullRequestNumber) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("GitHubPull"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeTrue(); sut.PullRequestNumber.ShouldBe(expectedPullRequestNumber); sut.Version.ShouldBe(expectedVersion); } private static readonly object?[] BitBucketPullMergeMessages = - { - new object?[] { "Merge pull request #1234 from feature/one from feature/two to dev", "feature/two", "dev", null, 1234 }, + [ + new object?[] { "Merge pull request #1234 from feature/one from feature/two to dev", "feature/two", "dev", null, 1234 }, new object?[] { "Merge pull request #1234 in feature/one from feature/two to dev", "feature/two", "dev", null, 1234 }, - new object?[] { "Merge pull request #1234 in v4.0.0 from v4.1.0 to dev", "v4.1.0", "dev", new SemanticVersion(4,1), 1234 }, - new object?[] { "Merge pull request #1234 from origin/feature/one from origin/feature/4.2/two to dev", "origin/feature/4.2/two", "dev", new SemanticVersion(4,2), 1234 }, - new object?[] { "Merge pull request #1234 in feature/4.1/one from feature/4.2/two to dev", "feature/4.2/two", "dev", new SemanticVersion(4,2), 1234 }, - new object?[] { $"Merge pull request #1234 from feature/one from feature/two to {MainBranch}" , "feature/two", MainBranch, null, 1234 }, + new object?[] { "Merge pull request #1234 in v4.0.0 from v4.1.0 to dev", "v4.1.0", "dev", new SemanticVersion(4, 1), 1234 }, + new object?[] { "Merge pull request #1234 from origin/feature/one from origin/feature/4.2.0/two to dev", "origin/feature/4.2.0/two", "dev", new SemanticVersion(4, 2), 1234 }, + new object?[] { "Merge pull request #1234 in feature/4.1.0/one from feature/4.2.0/two to dev", "feature/4.2.0/two", "dev", new SemanticVersion(4, 2), 1234 }, + new object?[] { $"Merge pull request #1234 from feature/one from feature/two to {MainBranch}", "feature/two", MainBranch, null, 1234 }, new object?[] { "Merge pull request #1234 in V4.1.0 from V://10.10.10.10 to dev", "V://10.10.10.10", "dev", null, 1234 }, //TODO: Investigate successful bitbucket merge messages that may be invalid // Regex has double 'from/in from' section. Is that correct? - new object?[] { $"Merge pull request #1234 from feature/one from v4.0.0 to {MainBranch}", "v4.0.0", MainBranch, new SemanticVersion(4), 1234 } - }; + new object?[] { $"Merge pull request #1234 from feature/one from v4.0.0 to {MainBranch}", "v4.0.0", MainBranch, new SemanticVersion(4), 1234 } + ]; [TestCaseSource(nameof(BitBucketPullMergeMessages))] public void ParsesBitBucketPullMergeMessage( @@ -134,25 +132,28 @@ public void ParsesBitBucketPullMergeMessage( int? expectedPullRequestNumber) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("BitBucketPull"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeTrue(); sut.PullRequestNumber.ShouldBe(expectedPullRequestNumber); sut.Version.ShouldBe(expectedVersion); } private static readonly object[] BitBucketPullMergeMessages_v7 = - { - new object[] { $@"Pull request #68: Release/2.2 + [ + new object[] { $""" + Pull request #68: Release/2.2.0 -Merge in aaa/777 from release/2.2 to {MainBranch} + Merge in aaa/777 from release/2.2.0 to {MainBranch} -* commit '750aa37753dec1a85b22cc16db851187649d9e97':", "release/2.2", MainBranch, new SemanticVersion(2,2), 68 } - }; + * commit '750aa37753dec1a85b22cc16db851187649d9e97': + """, "release/2.2.0", MainBranch, new SemanticVersion(2, 2), 68 } + ]; [TestCaseSource(nameof(BitBucketPullMergeMessages_v7))] public void ParsesBitBucketPullMergeMessage_v7( @@ -163,27 +164,60 @@ public void ParsesBitBucketPullMergeMessage_v7( int? expectedPullRequestNumber) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("BitBucketPullv7"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeTrue(); sut.PullRequestNumber.ShouldBe(expectedPullRequestNumber); sut.Version.ShouldBe(expectedVersion); } - private static readonly object?[] SmartGitMergeMessages = + private static readonly object?[] BitBucketCloudPullMergeMessages = + [ + new object?[] { """ + Merged in release/2.301.0 (pull request #1789) + + Release/2.301.0 + + Approved-by: John Doe + """, "release/2.301.0", null, new SemanticVersion(2, 301), 1789 } + ]; + + [TestCaseSource(nameof(BitBucketCloudPullMergeMessages))] + public void ParsesBitBucketCloudPullMergeMessage( + string message, + string expectedMergedBranch, + string expectedTargetBranch, + SemanticVersion expectedVersion, + int? expectedPullRequestNumber) { + // Act + var sut = new MergeMessage(message, this.configurationBuilder.Build()); + + // Assert + sut.FormatName.ShouldBe("BitBucketCloudPull"); + sut.TargetBranch.ShouldBe(expectedTargetBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); + sut.IsMergedPullRequest.ShouldBeTrue(); + sut.PullRequestNumber.ShouldBe(expectedPullRequestNumber); + sut.Version.ShouldBe(expectedVersion); + } + + private static readonly object?[] SmartGitMergeMessages = + [ new object?[] { "Finish feature/one", "feature/one", null, null }, new object?[] { "Finish origin/feature/one", "origin/feature/one", null, null }, new object?[] { "Finish v4.0.0", "v4.0.0", null, new SemanticVersion(4) }, - new object?[] { "Finish feature/4.1/one", "feature/4.1/one", null, new SemanticVersion(4, 1) }, - new object?[] { "Finish origin/4.1/feature/one", "origin/4.1/feature/one", null, new SemanticVersion(4, 1) }, + new object?[] { "Finish feature/4.1.0/one", "feature/4.1.0/one", null, new SemanticVersion(4, 1) }, + new object?[] { "Finish origin/4.1.0/feature/one", "origin/4.1.0/feature/one", null, new SemanticVersion(4, 1) }, new object?[] { "Finish V://10.10.10.10", "V://10.10.10.10", null, null }, new object?[] { $"Finish V4.0.0 into {MainBranch}", "V4.0.0", MainBranch, new SemanticVersion(4) } - }; + ]; [TestCaseSource(nameof(SmartGitMergeMessages))] public void ParsesSmartGitMergeMessage( @@ -193,27 +227,28 @@ public void ParsesSmartGitMergeMessage( SemanticVersion expectedVersion) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("SmartGit"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBe(expectedVersion); } private static readonly object?[] RemoteTrackingMergeMessages = - { + [ new object?[] { $"Merge remote-tracking branch 'feature/one' into {MainBranch}", "feature/one", MainBranch, null }, new object?[] { "Merge remote-tracking branch 'origin/feature/one' into dev", "origin/feature/one", "dev", null }, new object?[] { $"Merge remote-tracking branch 'v4.0.0' into {MainBranch}", "v4.0.0", MainBranch, new SemanticVersion(4) }, new object?[] { $"Merge remote-tracking branch 'V4.0.0' into {MainBranch}", "V4.0.0", MainBranch, new SemanticVersion(4) }, - new object?[] { "Merge remote-tracking branch 'feature/4.1/one' into dev", "feature/4.1/one", "dev", new SemanticVersion(4, 1) }, - new object?[] { $"Merge remote-tracking branch 'origin/4.1/feature/one' into {MainBranch}", "origin/4.1/feature/one", MainBranch, new SemanticVersion(4, 1) }, + new object?[] { "Merge remote-tracking branch 'feature/4.1.0/one' into dev", "feature/4.1.0/one", "dev", new SemanticVersion(4, 1) }, + new object?[] { $"Merge remote-tracking branch 'origin/4.1.0/feature/one' into {MainBranch}", "origin/4.1.0/feature/one", MainBranch, new SemanticVersion(4, 1) }, new object?[] { $"Merge remote-tracking branch 'v://10.10.10.10' into {MainBranch}", "v://10.10.10.10", MainBranch, null } - }; + ]; [TestCaseSource(nameof(RemoteTrackingMergeMessages))] public void ParsesRemoteTrackingMergeMessage( @@ -223,42 +258,38 @@ public void ParsesRemoteTrackingMergeMessage( SemanticVersion expectedVersion) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe("RemoteTracking"); sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(expectedMergedBranch); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBe(expectedVersion); } private static readonly object?[] InvalidMergeMessages = - { - new object?[] { "Merge pull request # from feature/one", "", null, null, null }, - new object?[] { $"Merge pull request # in feature/one from feature/two to {MainBranch}" , "", null, null, null }, - new object?[] { $"Zusammengeführter PR : feature/one mit {MainBranch} mergen", "", null, null, null } - }; + [ + new object?[] { "Merge pull request # from feature/one" }, + new object?[] { $"Merge pull request # in feature/one from feature/two to {MainBranch}" }, + new object?[] { $"Zusammengeführter PR : feature/one mit {MainBranch} mergen" } + ]; [TestCaseSource(nameof(InvalidMergeMessages))] - public void ParsesInvalidMergeMessage( - string message, - string expectedMergedBranch, - string expectedTargetBranch, - SemanticVersion expectedVersion, - int? expectedPullRequestNumber) + public void ParsesInvalidMergeMessage(string message) { // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBeNull(); - sut.TargetBranch.ShouldBe(expectedTargetBranch); - sut.MergedBranch.ShouldBe(expectedMergedBranch); + sut.TargetBranch.ShouldBeNull(); + sut.MergedBranch.ShouldBeNull(); sut.IsMergedPullRequest.ShouldBeFalse(); - sut.PullRequestNumber.ShouldBe(expectedPullRequestNumber); - sut.Version.ShouldBe(expectedVersion); + sut.PullRequestNumber.ShouldBeNull(); + sut.Version.ShouldBeNull(); } [Test] @@ -267,18 +298,19 @@ public void MatchesSingleCustomMessage() // Arrange const string message = "My custom message"; const string definition = "MyCustom"; - this.config.MergeMessageFormats = new Dictionary + this.configurationBuilder.WithMergeMessageFormats(new Dictionary { [definition] = message - }; + }); // Act - var sut = new MergeMessage(message, this.config); + var sut = new MergeMessage(message, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe(definition); sut.TargetBranch.ShouldBeNull(); - sut.MergedBranch.ShouldBeEmpty(); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBeEmpty(); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBeNull(); @@ -290,20 +322,21 @@ public void MatchesMultipleCustomMessages() // Arrange const string format = "My custom message"; const string definition = "MyCustom"; - this.config.MergeMessageFormats = new Dictionary + this.configurationBuilder.WithMergeMessageFormats(new Dictionary { ["Default2"] = "some example", ["Default3"] = "another example", [definition] = format - }; + }); // Act - var sut = new MergeMessage(format, this.config); + var sut = new MergeMessage(format, this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe(definition); sut.TargetBranch.ShouldBeNull(); - sut.MergedBranch.ShouldBeEmpty(); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBeEmpty(); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBeNull(); @@ -315,24 +348,24 @@ public void MatchesCaptureGroupsFromCustomMessages() // Arrange const string format = @"^Merged PR #(?\d+) into (?[^\s]*) from (?:(?[^\s]*))"; const string definition = "MyCustom"; - this.config.MergeMessageFormats = new Dictionary + this.configurationBuilder.WithMergeMessageFormats(new Dictionary { [definition] = format - }; + }); const int pr = 1234; - const string target = MainBranch; - const string source = "feature/2.0/example"; + const string source = "feature/2.0.0/example"; // Act - var sut = new MergeMessage($"Merged PR #{pr} into {target} from {source}", this.config); + var sut = new MergeMessage($"Merged PR #{pr} into {MainBranch} from {source}", this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe(definition); - sut.TargetBranch.ShouldBe(target); - sut.MergedBranch.ShouldBe(source); + sut.TargetBranch.ShouldBe(MainBranch); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe(source); sut.IsMergedPullRequest.ShouldBeTrue(); sut.PullRequestNumber.ShouldBe(pr); - sut.Version.ShouldBe(new SemanticVersion(2)); + sut.Version.ShouldBe(new(2)); } [Test] @@ -341,20 +374,21 @@ public void ReturnsAfterFirstMatchingPattern() // Arrange const string format = @"^Merge (branch|tag) '(?[^']*)'(?: into (?[^\s]*))*"; const string definition = "MyCustom"; - this.config.MergeMessageFormats = new Dictionary + this.configurationBuilder.WithMergeMessageFormats(new Dictionary { [definition] = format, ["Default2"] = format, ["Default3"] = format - }; + }); // Act - var sut = new MergeMessage("Merge branch 'this'", this.config); + var sut = new MergeMessage("Merge branch 'this'", this.configurationBuilder.Build()); // Assert sut.FormatName.ShouldBe(definition); sut.TargetBranch.ShouldBeNull(); - sut.MergedBranch.ShouldBe("this"); + sut.MergedBranch.ShouldNotBeNull(); + sut.MergedBranch.Friendly.ShouldBe("this"); sut.IsMergedPullRequest.ShouldBeFalse(); sut.PullRequestNumber.ShouldBe(null); sut.Version.ShouldBeNull(); diff --git a/src/GitVersion.Core.Tests/Model/GitVersionContextTests.cs b/src/GitVersion.Core.Tests/Model/GitVersionContextTests.cs deleted file mode 100644 index e16a66d8ec..0000000000 --- a/src/GitVersion.Core.Tests/Model/GitVersionContextTests.cs +++ /dev/null @@ -1,204 +0,0 @@ -using GitTools.Testing; -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using LibGit2Sharp; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NSubstitute; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests; - -public class GitVersionContextTests : TestBase -{ - [Test] - [Theory] - public void CanInheritVersioningMode(VersioningMode mode) - { - using var fixture = new EmptyRepositoryFixture(); - - var config = new ConfigurationBuilder() - .Add(new Config { VersioningMode = mode }) - .Build(); - - const string branchName = MainBranch; - - var mockCommit = GitToolsTestingExtensions.CreateMockCommit(); - var mockBranch = GitToolsTestingExtensions.CreateMockBranch(branchName, mockCommit); - - var branches = Substitute.For(); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] { mockBranch }).GetEnumerator()); - - var mockRepository = Substitute.For(); - mockRepository.Head.Returns(mockBranch); - mockRepository.Branches.Returns(branches); - mockRepository.Commits.Returns(mockBranch.Commits); - - var effectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, mockRepository, branchName, config); - - effectiveConfiguration.VersioningMode.ShouldBe(mode); - } - - [TestCase(IncrementStrategy.Inherit, IncrementStrategy.Patch)] // Since it inherits, the increment strategy of main is used => Patch - [TestCase(IncrementStrategy.Patch, null)] - [TestCase(IncrementStrategy.Major, null)] - [TestCase(IncrementStrategy.Minor, null)] - [TestCase(IncrementStrategy.None, null)] - public void CanInheritIncrement(IncrementStrategy increment, IncrementStrategy? alternateExpected) - { - // Dummy branch name to make sure that no default config exists. - const string dummyBranchName = "dummy"; - - var config = new ConfigurationBuilder() - .Add(new Config { Increment = increment }) - .Build(); - - using var fixture = new EmptyRepositoryFixture(); - fixture.MakeACommit(); - fixture.BranchTo(dummyBranchName); - fixture.MakeACommit(); - - var effectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, fixture.Repository.ToGitRepository(), dummyBranchName, config); - - effectiveConfiguration.Increment.ShouldBe(alternateExpected ?? increment); - } - - [Test] - public void UsesBranchSpecificConfigOverTopLevelDefaults() - { - using var fixture = new EmptyRepositoryFixture(); - - const string branchName = "develop"; - var config = new ConfigurationBuilder() - .Add(new Config - { - VersioningMode = VersioningMode.ContinuousDelivery, - Branches = - { - { - branchName, new BranchConfig - { - VersioningMode = VersioningMode.ContinuousDeployment, - Tag = "alpha" - } - } - } - }) - .Build(); - - var main = GitToolsTestingExtensions.CreateMockBranch(MainBranch, GitToolsTestingExtensions.CreateMockCommit()); - var develop = GitToolsTestingExtensions.CreateMockBranch(branchName, GitToolsTestingExtensions.CreateMockCommit()); - - var branches = Substitute.For(); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] { main, develop }).GetEnumerator()); - - var mockRepository = Substitute.For(); - mockRepository.Head.Returns(develop); - mockRepository.Branches.Returns(branches); - mockRepository.Commits.Returns(develop.Commits); - - var effectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, mockRepository, branchName, config); - - effectiveConfiguration.Tag.ShouldBe("alpha"); - } - - [Test] - public void UsesFirstBranchConfigWhenMultipleMatch() - { - using var fixture = new EmptyRepositoryFixture(); - - var branchConfig = new BranchConfig - { - VersioningMode = VersioningMode.Mainline, - Increment = IncrementStrategy.None, - PreventIncrementOfMergedBranchVersion = false, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsReleaseBranch = false, - SourceBranches = new HashSet() - }; - var config = new ConfigurationBuilder() - .Add(new Config - { - VersioningMode = VersioningMode.ContinuousDelivery, - Branches = - { - { "release/latest", new BranchConfig(branchConfig) { Increment = IncrementStrategy.None, Regex = "release/latest" } }, - { "release", new BranchConfig(branchConfig) { Increment = IncrementStrategy.Patch, Regex = "releases?[/-]" } } - } - }) - .Build(); - - var releaseLatestBranch = GitToolsTestingExtensions.CreateMockBranch("release/latest", GitToolsTestingExtensions.CreateMockCommit()); - var releaseVersionBranch = GitToolsTestingExtensions.CreateMockBranch("release/1.0.0", GitToolsTestingExtensions.CreateMockCommit()); - - var branches = Substitute.For(); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] { releaseLatestBranch, releaseVersionBranch }).GetEnumerator()); - - var mockRepository = Substitute.For(); - mockRepository.Branches.Returns(branches); - mockRepository.Head.Returns(releaseLatestBranch); - mockRepository.Commits.Returns(releaseLatestBranch.Commits); - - var latestEffectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, mockRepository, releaseLatestBranch.Name.Canonical, config); - latestEffectiveConfiguration.Increment.ShouldBe(IncrementStrategy.None); - - mockRepository.Head.Returns(releaseVersionBranch); - var effectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, mockRepository, releaseVersionBranch.Name.Canonical, config); - effectiveConfiguration.Increment.ShouldBe(IncrementStrategy.Patch); - } - - [Test] - public void CanFindParentBranchForInheritingIncrementStrategy() - { - var config = new ConfigurationBuilder() - .Add(new Config - { - Branches = - { - { "develop", new BranchConfig { Increment = IncrementStrategy.Major } }, - { "feature", new BranchConfig { Increment = IncrementStrategy.Inherit } } - } - }) - .Build(); - - using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - fixture.Repository.MakeACommit(); - var featureBranch = fixture.Repository.CreateBranch("feature/foo"); - Commands.Checkout(fixture.Repository, featureBranch); - fixture.Repository.MakeACommit(); - - var effectiveConfiguration = GetEffectiveConfiguration(fixture.RepositoryPath, fixture.Repository.ToGitRepository(), "develop", config); - - effectiveConfiguration.Increment.ShouldBe(IncrementStrategy.Major); - } - - private static EffectiveConfiguration GetEffectiveConfiguration(string workingDirectory, IGitRepository repository, string branch, Config? config = null) - { - var options = Options.Create(new GitVersionOptions - { - WorkingDirectory = workingDirectory, - RepositoryInfo = { TargetBranch = branch }, - ConfigInfo = { OverrideConfig = config } - }); - - var sp = ConfigureServices(services => - { - services.AddSingleton(options); - services.AddSingleton(repository); - }); - - var context = sp.GetRequiredService>().Value; - var branchConfigurationCalculator = sp.GetRequiredService(); - var configuration = context.FullConfiguration; - var currentBranchConfig = branchConfigurationCalculator.GetBranchConfiguration( - context.CurrentBranch, context.CurrentCommit, configuration - ); - return new(configuration, currentBranchConfig); - } -} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt index 25f1cbdc3a..24061d9bfe 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.0.0", + "AssemblySemVer": "1.2.0.0", + "BranchName": "feature1", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature1", + "FullBuildMetaData": "5.Branch.feature1.Sha.commitSha", + "FullSemVer": "1.2.0-unstable.4+5", + "InformationalVersion": "1.2.0-unstable.4+5.Branch.feature1.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.0", "Minor": 2, "Patch": 0, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Branch.feature1.Sha.commitSha", - "MajorMinorPatch": "1.2.0", + "PreReleaseTag": "unstable.4", + "PreReleaseTagWithDash": "-unstable.4", "SemVer": "1.2.0-unstable.4", - "LegacySemVer": "1.2.0-unstable4", - "LegacySemVerPadded": "1.2.0-unstable0004", - "AssemblySemVer": "1.2.0.0", - "AssemblySemFileVer": "1.2.0.0", - "FullSemVer": "1.2.0-unstable.4+5", - "InformationalVersion": "1.2.0-unstable.4+5.Branch.feature1.Sha.commitSha", - "BranchName": "feature1", - "EscapedBranchName": "feature1", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.0-unstable0004", - "NuGetVersion": "1.2.0-unstable0004", - "NuGetPreReleaseTagV2": "unstable0004", - "NuGetPreReleaseTag": "unstable0004", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 4 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt index 0490ce34e1..2656e2afe4 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "feature/123", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature-123", + "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "LegacySemVer": "1.2.3", - "LegacySemVerPadded": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitSha", - "BranchName": "feature/123", - "EscapedBranchName": "feature-123", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3", - "NuGetVersion": "1.2.3", - "NuGetPreReleaseTagV2": "", - "NuGetPreReleaseTag": "", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt index f5f7edf738..55166aebe6 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "feature/123", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature-123", + "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitShortSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "LegacySemVer": "1.2.3", - "LegacySemVerPadded": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitShortSha", - "BranchName": "feature/123", - "EscapedBranchName": "feature-123", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3", - "NuGetVersion": "1.2.3", - "NuGetPreReleaseTagV2": "", - "NuGetPreReleaseTag": "", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt index 5ad80cff71..4cc8738920 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-unstable.4+5", + "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "unstable.4", + "PreReleaseTagWithDash": "-unstable.4", "SemVer": "1.2.3-unstable.4", - "LegacySemVer": "1.2.3-unstable4", - "LegacySemVerPadded": "1.2.3-unstable0004", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.4+5", - "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3-unstable0004", - "NuGetVersion": "1.2.3-unstable0004", - "NuGetPreReleaseTagV2": "unstable0004", - "NuGetPreReleaseTag": "unstable0004", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 4 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt deleted file mode 100644 index 039e780d29..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt +++ /dev/null @@ -1,35 +0,0 @@ -{ - "Major": 1, - "Minor": 2, - "Patch": 3, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", - "PreReleaseLabel": "unstable", - "PreReleaseLabelWithDash": "-unstable", - "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "BuildMetaDataPadded": "05", - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", - "SemVer": "1.2.3-unstable.4", - "LegacySemVer": "1.2.3-unstable4", - "LegacySemVerPadded": "1.2.3-unstable00004", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.4+5", - "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", - "Sha": "commitSha", - "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3-unstable00004", - "NuGetVersion": "1.2.3-unstable00004", - "NuGetPreReleaseTagV2": "unstable0004", - "NuGetPreReleaseTag": "unstable0004", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", - "UncommittedChanges": 0, - "CommitDate": "2014-03-06" -} \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt index 51a0616f66..0b9c98e18a 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "LegacySemVer": "1.2.3", - "LegacySemVerPadded": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3", - "NuGetVersion": "1.2.3", - "NuGetPreReleaseTagV2": "", - "NuGetPreReleaseTag": "", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForMainBranchWithEmptyLabel.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForMainBranchWithEmptyLabel.approved.txt new file mode 100644 index 0000000000..f6bd57ef8f --- /dev/null +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForMainBranchWithEmptyLabel.approved.txt @@ -0,0 +1,27 @@ +{ + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "main", + "BuildMetaData": null, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "main", + "FullBuildMetaData": "Branch.main.Sha.commitSha", + "FullSemVer": "1.2.3-9", + "InformationalVersion": "1.2.3-9+Branch.main.Sha.commitSha", + "Major": 1, + "MajorMinorPatch": "1.2.3", + "Minor": 2, + "Patch": 3, + "PreReleaseLabel": "", + "PreReleaseLabelWithDash": "", + "PreReleaseNumber": 9, + "PreReleaseTag": "9", + "PreReleaseTagWithDash": "-9", + "SemVer": "1.2.3-9", + "Sha": "commitSha", + "ShortSha": "commitShortSha", + "UncommittedChanges": 0, + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 55009 +} \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt index 831febba8e..34ec2c613b 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": null, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-unstable.8", + "InformationalVersion": "1.2.3-unstable.8+Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "unstable.8", - "PreReleaseTagWithDash": "-unstable.8", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 8, - "WeightedPreReleaseNumber": 8, - "BuildMetaData": null, - "BuildMetaDataPadded": "", - "FullBuildMetaData": "Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "unstable.8", + "PreReleaseTagWithDash": "-unstable.8", "SemVer": "1.2.3-unstable.8", - "LegacySemVer": "1.2.3-unstable8", - "LegacySemVerPadded": "1.2.3-unstable0008", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.8", - "InformationalVersion": "1.2.3-unstable.8+Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3-unstable0008", - "NuGetVersion": "1.2.3-unstable0008", - "NuGetPreReleaseTagV2": "unstable0008", - "NuGetPreReleaseTag": "unstable0008", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 8 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt index 7cc02e1bf3..de207b299c 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": null, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-ci.5", + "InformationalVersion": "1.2.3-ci.5+Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "ci.5", - "PreReleaseTagWithDash": "-ci.5", "PreReleaseLabel": "ci", "PreReleaseLabelWithDash": "-ci", "PreReleaseNumber": 5, - "WeightedPreReleaseNumber": 5, - "BuildMetaData": null, - "BuildMetaDataPadded": "", - "FullBuildMetaData": "Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "ci.5", + "PreReleaseTagWithDash": "-ci.5", "SemVer": "1.2.3-ci.5", - "LegacySemVer": "1.2.3-ci5", - "LegacySemVerPadded": "1.2.3-ci0005", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-ci.5", - "InformationalVersion": "1.2.3-ci.5+Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3-ci0005", - "NuGetVersion": "1.2.3-ci0005", - "NuGetPreReleaseTagV2": "ci0005", - "NuGetPreReleaseTag": "ci0005", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 5 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt index 11b2530fef..330accf021 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt @@ -1,35 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "", + "FullBuildMetaData": "5.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "BuildMetaDataPadded": "0005", - "FullBuildMetaData": "5.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "LegacySemVer": "1.2.3", - "LegacySemVerPadded": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Sha.commitSha", - "BranchName": "", - "EscapedBranchName": "", "Sha": "commitSha", "ShortSha": "commitShortSha", - "NuGetVersionV2": "1.2.3", - "NuGetVersion": "1.2.3", - "NuGetPreReleaseTagV2": "", - "NuGetPreReleaseTag": "", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitsSinceVersionSourcePadded": "0005", "UncommittedChanges": 0, - "CommitDate": "2014-03-06" + "VersionSourceSha": "versionSourceSha", + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/BaseVersionCalculatorTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/BaseVersionCalculatorTests.cs deleted file mode 100644 index ec2229e460..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/BaseVersionCalculatorTests.cs +++ /dev/null @@ -1,249 +0,0 @@ -using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using NSubstitute; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.VersionCalculation; - -[TestFixture] -public class BaseVersionCalculatorTests : TestBase -{ - [Test] - public void ChoosesHighestVersionReturnedFromStrategies() - { - var dateTimeOffset = DateTimeOffset.Now; - var versionCalculator = GetBaseVersionCalculator(contextBuilder => - contextBuilder.OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new V1Strategy(DateTimeOffset.Now)); - services.AddSingleton(new V2Strategy(dateTimeOffset)); - })); - - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.SemanticVersion.ToString().ShouldBe("2.0.0"); - baseVersion.ShouldIncrement.ShouldBe(true); - baseVersion.BaseVersionSource.ShouldNotBeNull(); - baseVersion.BaseVersionSource.When.ShouldBe(dateTimeOffset); - } - - [Test] - public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhen() - { - var when = DateTimeOffset.Now; - - var versionCalculator = GetBaseVersionCalculator(contextBuilder => - contextBuilder.OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new V1Strategy(when)); - services.AddSingleton(new V2Strategy(null)); - })); - - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.SemanticVersion.ToString().ShouldBe("2.0.0"); - baseVersion.ShouldIncrement.ShouldBe(true); - baseVersion.BaseVersionSource.ShouldNotBeNull(); - baseVersion.BaseVersionSource.When.ShouldBe(when); - } - - [Test] - public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhenReversedOrder() - { - var when = DateTimeOffset.Now; - - var versionCalculator = GetBaseVersionCalculator(contextBuilder => - contextBuilder.OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new V1Strategy(null)); - services.AddSingleton(new V2Strategy(when)); - })); - - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.SemanticVersion.ToString().ShouldBe("2.0.0"); - baseVersion.ShouldIncrement.ShouldBe(true); - baseVersion.BaseVersionSource.ShouldNotBeNull(); - baseVersion.BaseVersionSource.When.ShouldBe(when); - } - - [Test] - public void ShouldNotFilterVersion() - { - var fakeIgnoreConfig = new TestIgnoreConfig(new ExcludeSourcesContainingExclude()); - var version = new BaseVersion("dummy", false, new SemanticVersion(2), GitToolsTestingExtensions.CreateMockCommit(), null); - - var versionCalculator = GetBaseVersionCalculator(contextBuilder => contextBuilder - .WithConfig(new Config { Ignore = fakeIgnoreConfig }) - .OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new TestVersionStrategy(version)); - })); - - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.Source.ShouldBe(version.Source); - baseVersion.ShouldIncrement.ShouldBe(version.ShouldIncrement); - baseVersion.SemanticVersion.ShouldBe(version.SemanticVersion); - } - - [Test] - public void ShouldFilterVersion() - { - var fakeIgnoreConfig = new TestIgnoreConfig(new ExcludeSourcesContainingExclude()); - - var higherVersion = new BaseVersion("exclude", false, new SemanticVersion(2), GitToolsTestingExtensions.CreateMockCommit(), null); - var lowerVersion = new BaseVersion("dummy", false, new SemanticVersion(1), GitToolsTestingExtensions.CreateMockCommit(), null); - - var versionCalculator = GetBaseVersionCalculator(contextBuilder => contextBuilder - .WithConfig(new Config { Ignore = fakeIgnoreConfig }) - .OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new TestVersionStrategy(higherVersion, lowerVersion)); - })); - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.Source.ShouldNotBe(higherVersion.Source); - baseVersion.SemanticVersion.ShouldNotBe(higherVersion.SemanticVersion); - baseVersion.Source.ShouldBe(lowerVersion.Source); - baseVersion.SemanticVersion.ShouldBe(lowerVersion.SemanticVersion); - } - - [Test] - public void ShouldIgnorePreReleaseVersionInMainlineMode() - { - var fakeIgnoreConfig = new TestIgnoreConfig(new ExcludeSourcesContainingExclude()); - - var lowerVersion = new BaseVersion("dummy", false, new SemanticVersion(1), GitToolsTestingExtensions.CreateMockCommit(), null); - var preReleaseVersion = new BaseVersion( - "prerelease", - false, - new SemanticVersion(1, 0, 1) - { - PreReleaseTag = new SemanticVersionPreReleaseTag - { - Name = "alpha", - Number = 1 - } - }, - GitToolsTestingExtensions.CreateMockCommit(), - null - ); - - var versionCalculator = GetBaseVersionCalculator(contextBuilder => contextBuilder - .WithConfig(new Config { VersioningMode = VersioningMode.Mainline, Ignore = fakeIgnoreConfig }) - .OverrideServices(services => - { - services.RemoveAll(); - services.AddSingleton(new TestVersionStrategy(preReleaseVersion, lowerVersion)); - })); - var (baseVersion, _) = versionCalculator.GetBaseVersion(); - - baseVersion.Source.ShouldNotBe(preReleaseVersion.Source); - baseVersion.SemanticVersion.ShouldNotBe(preReleaseVersion.SemanticVersion); - baseVersion.Source.ShouldBe(lowerVersion.Source); - baseVersion.SemanticVersion.ShouldBe(lowerVersion.SemanticVersion); - } - - private static IBaseVersionCalculator GetBaseVersionCalculator(Action contextBuilderAction) - { - var contextBuilder = new GitVersionContextBuilder(); - contextBuilderAction.Invoke(contextBuilder); - - contextBuilder.Build(); - contextBuilder.ServicesProvider.ShouldNotBeNull(); - return contextBuilder.ServicesProvider.GetRequiredService(); - } - - private class TestIgnoreConfig : IgnoreConfig - { - private readonly IVersionFilter filter; - - public override bool IsEmpty => false; - - public TestIgnoreConfig(IVersionFilter filter) => this.filter = filter; - - public override IEnumerable ToFilters() - { - yield return this.filter; - } - } - - private class ExcludeSourcesContainingExclude : IVersionFilter - { - public bool Exclude(BaseVersion version, out string? reason) - { - reason = null; - - if (!version.Source.Contains("exclude")) - return false; - - reason = "was excluded"; - return true; - } - } - - private sealed class V1Strategy : IVersionStrategy - { - private readonly ICommit? when; - - public V1Strategy(DateTimeOffset? when) - { - if (when != null) - { - this.when = GitToolsTestingExtensions.CreateMockCommit(); - this.when.When.Returns(when.Value); - } - else - { - this.when = null; - } - } - - public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - yield return new BaseVersion("Source 1", false, new SemanticVersion(1), this.when, null); - } - } - - private sealed class V2Strategy : IVersionStrategy - { - private readonly ICommit? when; - - public V2Strategy(DateTimeOffset? when) - { - if (when != null) - { - this.when = GitToolsTestingExtensions.CreateMockCommit(); - this.when.When.Returns(when.Value); - } - else - { - this.when = null; - } - } - - public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - yield return new BaseVersion("Source 2", true, new SemanticVersion(2), this.when, null); - } - } - - private sealed class TestVersionStrategy : IVersionStrategy - { - private readonly IEnumerable baseVersions; - - public TestVersionStrategy(params BaseVersion[] baseVersions) => this.baseVersions = baseVersions; - - public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) => this.baseVersions; - } -} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs new file mode 100644 index 0000000000..ba682c3543 --- /dev/null +++ b/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs @@ -0,0 +1,375 @@ +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Git; +using GitVersion.Logging; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests.VersionCalculation; + +[TestFixture] +public class EffectiveBranchConfigurationFinderTests +{ + [Theory] + public void When_getting_configurations_of_a_branch_without_versioning_mode_Given_fallback_configuration_with_versioning_mode_Then_result_should_have_versioning_mode( + DeploymentMode versioningMode) + { + // Arrange + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(versioningMode) + .WithBranch("main", builder => builder.WithDeploymentMode(null)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(branchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(branchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(branchMock); + actual[0].Value.DeploymentMode.ShouldBe(versioningMode); + } + + [Theory] + public void When_getting_configurations_of_a_branch_with_versioning_mode_Given_fallback_configuration_without_versioning_mode_Then_result_should_have_versioning_mode( + DeploymentMode versioningMode) + { + // Arrange + var mainBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(null) + .WithBranch("main", builder => builder.WithDeploymentMode(versioningMode)) + .WithBranch("develop", builder => builder.WithDeploymentMode(null).WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(developBranchMock, configuration, Arg.Any>()).Returns([mainBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(developBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(mainBranchMock); + actual[0].Value.DeploymentMode.ShouldBe(versioningMode); + } + + [Theory] + public void When_getting_configurations_of_a_branch_with_versioning_mode_Given_parent_configuration_with_versioning_mode_Then_result_should_not_have_versioning_mode_of_parent( + DeploymentMode versioningMode) + { + // Arrange + var mainBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithDeploymentMode(null) + .WithBranch("main", builder => builder.WithDeploymentMode(versioningMode)) + .WithBranch("develop", builder => builder + .WithDeploymentMode(DeploymentMode.ContinuousDelivery).WithIncrement(IncrementStrategy.Inherit) + ) + .Build(); + + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(developBranchMock, configuration, Arg.Any>()).Returns([mainBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(developBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(mainBranchMock); + if (versioningMode == DeploymentMode.ContinuousDelivery) + { + actual[0].Value.DeploymentMode.ShouldBe(versioningMode); + } + else + { + actual[0].Value.DeploymentMode.ShouldNotBe(versioningMode); + } + } + + [Test] + public void When_getting_configurations_of_a_branch_with_tag_alpha_Given_branch_which_inherits_from_parent_branch_Then_result_should_have_tag_alpha() + { + // Arrange + var mainBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithLabel(string.Empty)) + .WithBranch("develop", builder => builder + .WithIncrement(IncrementStrategy.Inherit).WithLabel("alpha") + ) + .Build(); + + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(developBranchMock, configuration, Arg.Any>()).Returns([mainBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(developBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(mainBranchMock); + actual[0].Value.Label.ShouldBe("alpha"); + } + + [Test] + public void When_getting_configurations_of_a_branch_without_tag_Given_branch_which_inherits_from_parent_branch_Then_result_should_have_tag_from_parent() + { + // Arrange + var mainBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder.WithLabel(string.Empty)) + .WithBranch("develop", builder => builder + .WithIncrement(IncrementStrategy.Inherit).WithLabel(null) + ) + .Build(); + + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(developBranchMock, configuration, Arg.Any>()).Returns([mainBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(developBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(mainBranchMock); + actual[0].Value.Label.ShouldBe(string.Empty); + } + + [TestCase("release/latest", IncrementStrategy.None, "latest")] + [TestCase("release/1.0.0", IncrementStrategy.Patch, "not-latest")] + public void UsesFirstBranchConfigWhenMultipleMatch(string branchName, IncrementStrategy incrementStrategy, string label) + { + // Arrange + var releaseBranchMock = GitRepositoryTestingExtensions.CreateMockBranch(branchName, GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithoutBranches() + .WithBranch("release/latest", builder => builder + .WithIncrement(IncrementStrategy.None) + .WithLabel("latest") + .WithRegularExpression("release/latest") + ) + .WithBranch("release", builder => builder + .WithIncrement(IncrementStrategy.Patch) + .WithLabel("not-latest") + .WithRegularExpression(@"releases?[\/-]") + ) + .Build(); + + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(releaseBranchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(releaseBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(releaseBranchMock); + actual[0].Value.Increment.ShouldBe(incrementStrategy); + actual[0].Value.Label.ShouldBe(label); + } + + [Test] + public void When_getting_configurations_of_an_orphaned_branch_Given_fallback_configuration_with_increment_inherit_Then_result_should_be_empty() + { + // Arrange + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(IncrementStrategy.Inherit) + .WithBranch("develop", builder => builder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(branchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(branchMock, configuration).ToArray(); + + // Assert + actual.ShouldBeEmpty(); + } + + [TestCase(IncrementStrategy.None)] + [TestCase(IncrementStrategy.Patch)] + [TestCase(IncrementStrategy.Minor)] + [TestCase(IncrementStrategy.Major)] + public void When_getting_configurations_of_an_orphaned_branch_Given_fallback_configuration_with_increment_Then_result_should_have_fallback_increment( + IncrementStrategy fallbackIncrement) + { + // Arrange + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(fallbackIncrement) + .WithBranch("develop", builder => builder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(branchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(branchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(branchMock); + actual[0].Value.Increment.ShouldBe(fallbackIncrement); + } + + [Test] + public void When_getting_configurations_of_an_unknown_branch_Given_fallback_and_unknown_configuration_with_increment_inherit_Then_result_should_be_empty() + { + // Arrange + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("unknown", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(IncrementStrategy.Inherit) + .WithBranch("unknown", builder => builder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(branchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(branchMock, configuration).ToArray(); + + // Assert + actual.ShouldBeEmpty(); + } + + [TestCase(IncrementStrategy.None)] + [TestCase(IncrementStrategy.Patch)] + [TestCase(IncrementStrategy.Minor)] + [TestCase(IncrementStrategy.Major)] + public void When_getting_configurations_of_an_unknown_branch_Given_fallback_configuration_with_increment_and_unknown_configuration_with_increment_inherit_Then_result_should_have_fallback_increment( + IncrementStrategy fallbackIncrement) + { + // Arrange + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("unknown", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(fallbackIncrement) + .WithBranch("unknown", builder => builder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + repositoryStoreMock.GetSourceBranches(branchMock, configuration, Arg.Any>()).Returns([]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(branchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(branchMock); + actual[0].Value.Increment.ShouldBe(fallbackIncrement); + } + + [Theory] + public void When_getting_configurations_of_an_unknown_branch_Given_fallback_configuration_with_increment_and_develop_branch_with_increment_Then_result_should_have_develop_increment( + IncrementStrategy fallbackIncrement, IncrementStrategy developIncrement) + { + // Arrange + var unknownBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("unknown", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(fallbackIncrement) + .WithBranch("develop", builder => builder.WithIncrement(developIncrement)) + .Build(); + var repositoryStoreMock = Substitute.For(); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + repositoryStoreMock.GetSourceBranches(unknownBranchMock, configuration, Arg.Any>()).Returns([developBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(unknownBranchMock, configuration).ToArray(); + + // Assert + if (fallbackIncrement == IncrementStrategy.Inherit && developIncrement == IncrementStrategy.Inherit) + { + actual.ShouldBeEmpty(); + } + else + { + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(developBranchMock); + + actual[0].Value.Increment.ShouldBe(developIncrement == IncrementStrategy.Inherit ? fallbackIncrement : developIncrement); + } + } + + [Theory] + public void When_getting_configurations_of_an_unknown_branch_Given_fallback_configuration_with_increment_and_develop_branch_with_increment_inherit_Then_result_should_have_fallback_increment( + IncrementStrategy fallbackIncrement) + { + // Arrange + var unknownBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("unknown", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(fallbackIncrement) + .WithBranch("develop", builder => builder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + var repositoryStoreMock = Substitute.For(); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + repositoryStoreMock.GetSourceBranches(unknownBranchMock, configuration, Arg.Any>()).Returns([developBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(unknownBranchMock, configuration).ToArray(); + + // Assert + if (fallbackIncrement == IncrementStrategy.Inherit) + { + actual.ShouldBeEmpty(); + } + else + { + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(developBranchMock); + actual[0].Value.Increment.ShouldBe(fallbackIncrement); + } + } + + [TestCase(IncrementStrategy.None)] + [TestCase(IncrementStrategy.Patch)] + [TestCase(IncrementStrategy.Minor)] + [TestCase(IncrementStrategy.Major)] + public void When_getting_configurations_of_an_unknown_branch_Given_fallback_and_unknown_configuration_with_increment_inherit_and_develop_branch_with_increment_Then_result_should_have_develop_branch_increment( + IncrementStrategy developBranchIncrement) + { + // Arrange + var unknownBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("unknown", GitRepositoryTestingExtensions.CreateMockCommit()); + var configuration = GitFlowConfigurationBuilder.New + .WithIncrement(IncrementStrategy.Inherit) + .WithBranch("develop", builder => builder.WithIncrement(developBranchIncrement)) + .Build(); + var repositoryStoreMock = Substitute.For(); + var developBranchMock = GitRepositoryTestingExtensions.CreateMockBranch("develop", GitRepositoryTestingExtensions.CreateMockCommit()); + repositoryStoreMock.GetSourceBranches(Arg.Any(), Arg.Any(), Arg.Any>()).Returns([developBranchMock]); + + var unitUnderTest = new EffectiveBranchConfigurationFinder(Substitute.For(), repositoryStoreMock); + + // Act + var actual = unitUnderTest.GetConfigurations(unknownBranchMock, configuration).ToArray(); + + // Assert + actual.ShouldHaveSingleItem(); + actual[0].Branch.ShouldBe(developBranchMock); + actual[0].Value.Increment.ShouldBe(developBranchIncrement); + } +} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs index 9ffaa56d5e..3db950eb62 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs @@ -1,8 +1,7 @@ +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -13,8 +12,6 @@ public class JsonVersionBuilderTests : TestBase public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void Json() { var semanticVersion = new SemanticVersion @@ -23,16 +20,13 @@ public void Json() Minor = 2, Patch = 0, PreReleaseTag = "unstable4", - BuildMetaData = new SemanticVersionBuildMetaData("versionSourceSha", 5, "feature1", "commitSha", "commitShortSha", DateTimeOffset.Parse("2014-03-06 23:59:59Z"), 0) + BuildMetaData = new("versionSourceSha", 5, "feature1", "commitSha", "commitShortSha", DateTimeOffset.Parse("2014-03-06 23:59:59Z"), 0) }; - var config = new TestEffectiveConfiguration(); + var serviceProvider = ConfigureServices(); - var sp = ConfigureServices(); - - var variableProvider = sp.GetRequiredService(); - var variables = variableProvider.GetVariablesFor(semanticVersion, config, false); - var json = variables.ToString(); - json.ShouldMatchApproved(c => c.SubFolder("Approved")); + var variableProvider = serviceProvider.GetRequiredService(); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/MinDateVersionFilterTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/MinDateVersionFilterTests.cs index dcc568f49b..909c77e094 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/MinDateVersionFilterTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/MinDateVersionFilterTests.cs @@ -1,7 +1,5 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.VersionCalculation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -14,14 +12,14 @@ public void VerifyNullGuard() var dummy = DateTimeOffset.UtcNow.AddSeconds(1.0); var sut = new MinDateVersionFilter(dummy); - Should.Throw(() => sut.Exclude(null!, out _)); + Should.Throw(() => sut.Exclude((IBaseVersion)null!, out _)); } [Test] public void WhenCommitShouldExcludeWithReason() { - var commit = GitToolsTestingExtensions.CreateMockCommit(); - var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); var futureDate = DateTimeOffset.UtcNow.AddYears(1); var sut = new MinDateVersionFilter(futureDate); @@ -32,8 +30,8 @@ public void WhenCommitShouldExcludeWithReason() [Test] public void WhenShaMismatchShouldNotExclude() { - var commit = GitToolsTestingExtensions.CreateMockCommit(); - var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); var pastDate = DateTimeOffset.UtcNow.AddYears(-1); var sut = new MinDateVersionFilter(pastDate); @@ -44,7 +42,7 @@ public void WhenShaMismatchShouldNotExclude() [Test] public void ExcludeShouldAcceptVersionWithNullCommit() { - var version = new BaseVersion("dummy", false, new SemanticVersion(1), null, string.Empty); + BaseVersion version = new("dummy", new SemanticVersion(1)); var futureDate = DateTimeOffset.UtcNow.AddYears(1); var sut = new MinDateVersionFilter(futureDate); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs index 0f6117dfbb..eb6340389b 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs @@ -1,13 +1,9 @@ -using GitTools.Testing; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Core.Tests.IntegrationTests; -using GitVersion.Model.Configuration; using GitVersion.VersionCalculation; using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.VersionCalculation; @@ -16,24 +12,9 @@ public class NextVersionCalculatorTests : TestBase [Test] public void ShouldIncrementVersionBasedOnConfig() { - var semanticVersionBuildMetaData = new SemanticVersionBuildMetaData("ef7d0d7e1e700f1c7c9fa01ea6791bb778a5c37c", 1, MainBranch, "b1a34edbd80e141f7cc046c074f109be7d022074", "b1a34e", DateTimeOffset.Now, 0); - - var contextBuilder = new GitVersionContextBuilder(); - contextBuilder - .OverrideServices(services => - { - var configuration = TestConfigurationBuilder.New.Build(); - var branchMock = GitToolsTestingExtensions.CreateMockBranch("main", GitToolsTestingExtensions.CreateMockCommit()); - var effectiveConfiguration = new EffectiveConfiguration(configuration, configuration.GetBranchConfiguration("main")); - var effectiveBranchConfiguration = new EffectiveBranchConfiguration(branchMock, effectiveConfiguration); - var testBaseVersionCalculator = new TestBaseVersionCalculator( - true, new SemanticVersion(1), GitToolsTestingExtensions.CreateMockCommit(), effectiveBranchConfiguration - ); - services.AddSingleton(testBaseVersionCalculator); - services.AddSingleton(new TestMainlineVersionCalculator(semanticVersionBuildMetaData)); - }) - .WithConfig(new Config()) - .Build(); + using var contextBuilder = new GitVersionContextBuilder(); + + contextBuilder.Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var nextVersionCalculator = contextBuilder.ServicesProvider.GetRequiredService(); @@ -41,31 +22,19 @@ public void ShouldIncrementVersionBasedOnConfig() var nextVersion = nextVersionCalculator.FindVersion(); - nextVersion.IncrementedVersion.ToString().ShouldBe("1.0.1"); + nextVersion.ToString().ShouldBe("0.0.1-0"); } [Test] public void DoesNotIncrementWhenBaseVersionSaysNotTo() { - var semanticVersionBuildMetaData = new SemanticVersionBuildMetaData("ef7d0d7e1e700f1c7c9fa01ea6791bb778a5c37c", 1, MainBranch, "b1a34edbd80e141f7cc046c074f109be7d022074", "b1a34e", DateTimeOffset.Now, 0); - - var contextBuilder = new GitVersionContextBuilder(); - - contextBuilder - .OverrideServices(services => - { - var configuration = TestConfigurationBuilder.New.Build(); - var branchMock = GitToolsTestingExtensions.CreateMockBranch("main", GitToolsTestingExtensions.CreateMockCommit()); - var effectiveConfiguration = new EffectiveConfiguration(configuration, configuration.GetBranchConfiguration("main")); - var effectiveBranchConfiguration = new EffectiveBranchConfiguration(branchMock, effectiveConfiguration); - var testBaseVersionCalculator = new TestBaseVersionCalculator( - false, new SemanticVersion(1), GitToolsTestingExtensions.CreateMockCommit(), effectiveBranchConfiguration - ); - services.AddSingleton(testBaseVersionCalculator); - services.AddSingleton(new TestMainlineVersionCalculator(semanticVersionBuildMetaData)); - }) - .WithConfig(new Config()) - .Build(); + using var contextBuilder = new GitVersionContextBuilder(); + + var overrideConfiguration = new Dictionary + { + { "next-version", "1.0.0" } + }; + contextBuilder.WithOverrideConfiguration(overrideConfiguration).Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var nextVersionCalculator = contextBuilder.ServicesProvider.GetRequiredService(); @@ -74,30 +43,15 @@ public void DoesNotIncrementWhenBaseVersionSaysNotTo() var nextVersion = nextVersionCalculator.FindVersion(); - nextVersion.IncrementedVersion.ToString().ShouldBe("1.0.0"); + nextVersion.ToString().ShouldBe("1.0.0-0"); } [Test] public void AppliesBranchPreReleaseTag() { - var semanticVersionBuildMetaData = new SemanticVersionBuildMetaData("ef7d0d7e1e700f1c7c9fa01ea6791bb778a5c37c", 2, "develop", "b1a34edbd80e141f7cc046c074f109be7d022074", "b1a34e", DateTimeOffset.Now, 0); - var contextBuilder = new GitVersionContextBuilder(); - - contextBuilder - .OverrideServices(services => - { - var configuration = TestConfigurationBuilder.New.Build(); - var branchMock = GitToolsTestingExtensions.CreateMockBranch("develop", GitToolsTestingExtensions.CreateMockCommit()); - var effectiveConfiguration = new EffectiveConfiguration(configuration, configuration.GetBranchConfiguration("develop")); - var effectiveBranchConfiguration = new EffectiveBranchConfiguration(branchMock, effectiveConfiguration); - var testBaseVersionCalculator = new TestBaseVersionCalculator( - false, new SemanticVersion(1), GitToolsTestingExtensions.CreateMockCommit(), effectiveBranchConfiguration - ); - services.AddSingleton(testBaseVersionCalculator); - services.AddSingleton(new TestMainlineVersionCalculator(semanticVersionBuildMetaData)); - }) - .WithDevelopBranch() - .Build(); + using var contextBuilder = new GitVersionContextBuilder(); + + contextBuilder.WithDevelopBranch().Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var nextVersionCalculator = contextBuilder.ServicesProvider.GetRequiredService(); @@ -105,27 +59,20 @@ public void AppliesBranchPreReleaseTag() var nextVersion = nextVersionCalculator.FindVersion(); - nextVersion.IncrementedVersion.ToString("f").ShouldBe("1.0.0-alpha.1+2"); + nextVersion.ToString("f").ShouldBe("0.1.0-alpha.0"); } [Test] - public void PreReleaseTagCanUseBranchName() + public void PreReleaseLabelCanUseBranchName() { - var config = new Config - { - NextVersion = "1.0.0", - Branches = new Dictionary - { - { - "custom", new BranchConfig - { - Regex = "custom/", - Tag = "useBranchName", - SourceBranches = new HashSet() - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.0.0") + .WithBranch("custom", builder => builder + .WithRegularExpression(@"^custom?[\/-](?.+)") + .WithLabel(ConfigurationConstants.BranchNamePlaceholder) + .WithSourceBranches() + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -134,34 +81,34 @@ public void PreReleaseTagCanUseBranchName() fixture.BranchTo("custom/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.0-foo.1+2", config); + fixture.AssertFullSemver("1.0.0-foo.3", configuration); } [Test] public void PreReleaseVersionMainline() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline, - NextVersion = "1.0.0" - }; + var configuration = TrunkBasedConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); - fixture.BranchTo("foo"); + fixture.MakeACommit(); + fixture.BranchTo("feature/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.0-foo.1", config); + fixture.AssertFullSemver("0.1.0-foo.1", configuration); + + fixture.BranchTo("bar"); + fixture.MakeACommit(); + + fixture.AssertFullSemver("0.0.3-bar.2", configuration); } [Test] public void MergeIntoMainline() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline, - NextVersion = "1.0.0" - }; + var configuration = TrunkBasedConfigurationBuilder.New + .WithNextVersion("1.0.0") + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -170,118 +117,111 @@ public void MergeIntoMainline() fixture.Checkout(MainBranch); fixture.MergeNoFF("foo"); - fixture.AssertFullSemver("1.0.0", config); + fixture.AssertFullSemver("1.0.0", configuration); } [Test] public void MergeFeatureIntoMainline() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline - }; + var configuration = TrunkBasedConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); - fixture.AssertFullSemver("1.0.0", config); + fixture.AssertFullSemver("1.0.0", configuration); fixture.BranchTo("feature/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.1-foo.1", config); - fixture.ApplyTag("1.0.1-foo.1"); + fixture.AssertFullSemver("1.1.0-foo.1", configuration); + fixture.ApplyTag("1.1.0-foo.1"); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.0.1", config); + fixture.AssertFullSemver("1.1.0", configuration); + } + + [Test] + public void MergeHotfixIntoMainline() + { + var configuration = TrunkBasedConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit(); + fixture.ApplyTag("1.0.0"); + fixture.AssertFullSemver("1.0.0", configuration); + + fixture.BranchTo("hotfix/foo"); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.0.1-foo.1", configuration); + fixture.ApplyTag("1.0.1-foo.1"); + + fixture.Checkout(MainBranch); + fixture.MergeNoFF("hotfix/foo"); + fixture.AssertFullSemver("1.0.1", configuration); } [Test] public void MergeFeatureIntoMainlineWithMinorIncrement() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline, - Branches = new Dictionary - { - { "feature", new BranchConfig { Increment = IncrementStrategy.Minor } } - }, - Ignore = new IgnoreConfig { ShAs = new List() }, - MergeMessageFormats = new Dictionary() - }; + var configuration = TrunkBasedConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); - fixture.AssertFullSemver("1.0.0", config); + fixture.AssertFullSemver("1.0.0", configuration); fixture.BranchTo("feature/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.0-foo.1", config); + fixture.AssertFullSemver("1.1.0-foo.1", configuration); fixture.ApplyTag("1.1.0-foo.1"); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.1.0", config); + fixture.AssertFullSemver("1.1.0", configuration); } [Test] public void MergeFeatureIntoMainlineWithMinorIncrementAndThenMergeHotfix() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline, - Branches = new Dictionary - { - { "feature", new BranchConfig { Increment = IncrementStrategy.Minor } } - }, - Ignore = new IgnoreConfig { ShAs = new List() }, - MergeMessageFormats = new Dictionary() - }; + var configuration = TrunkBasedConfigurationBuilder.New.Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); fixture.ApplyTag("1.0.0"); - fixture.AssertFullSemver("1.0.0", config); + fixture.AssertFullSemver("1.0.0", configuration); fixture.BranchTo("feature/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.0-foo.1", config); + fixture.AssertFullSemver("1.1.0-foo.1", configuration); fixture.ApplyTag("1.1.0-foo.1"); fixture.Checkout(MainBranch); fixture.MergeNoFF("feature/foo"); - fixture.AssertFullSemver("1.1.0", config); + fixture.AssertFullSemver("1.1.0", configuration); fixture.ApplyTag("1.1.0"); fixture.BranchTo("hotfix/bar"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.1.1-beta.1", config); - fixture.ApplyTag("1.1.1-beta.1"); + fixture.AssertFullSemver("1.1.1-bar.1", configuration); + fixture.ApplyTag("1.1.1-bar.1"); fixture.Checkout(MainBranch); fixture.MergeNoFF("hotfix/bar"); - fixture.AssertFullSemver("1.1.1", config); + fixture.AssertFullSemver("1.1.1", configuration); } [Test] - public void PreReleaseTagCanUseBranchNameVariable() + public void PreReleaseLabelCanUseBranchNameVariable() { - var config = new Config - { - NextVersion = "1.0.0", - Branches = new Dictionary - { - { - "custom", new BranchConfig - { - Regex = "custom/", - Tag = "alpha.{BranchName}", - SourceBranches = new HashSet() - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.0.0") + .WithBranch("custom", builder => builder + .WithRegularExpression(@"^custom?[\/-](?.+)") + .WithLabel($"alpha.{ConfigurationConstants.BranchNamePlaceholder}") + .WithDeploymentMode(DeploymentMode.ManualDeployment) + .WithSourceBranches() + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit(); @@ -290,54 +230,45 @@ public void PreReleaseTagCanUseBranchNameVariable() fixture.BranchTo("custom/foo"); fixture.MakeACommit(); - fixture.AssertFullSemver("1.0.0-alpha.foo.1+2", config); + fixture.AssertFullSemver("1.0.0-alpha.foo.1+3", configuration); } [Test] - public void PreReleaseNumberShouldBeScopeToPreReleaseLabelInContinuousDelivery() + public void PreReleaseNumberShouldBeScopeToPreReleaseLabelInManualDeployment() { - var config = new Config - { - VersioningMode = VersioningMode.ContinuousDelivery, - Branches = new Dictionary - { - { - MainBranch, new BranchConfig - { - Tag = "beta" - } - } - } - }; + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("main", builder => builder + .WithLabel("beta").WithDeploymentMode(DeploymentMode.ManualDeployment) + ).WithBranch("feature", builder => builder + .WithDeploymentMode(DeploymentMode.ManualDeployment) + ) + .Build(); using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); + fixture.MakeACommit(); - fixture.Repository.CreateBranch("feature/test"); - Commands.Checkout(fixture.Repository, "feature/test"); - fixture.Repository.MakeATaggedCommit("0.1.0-test.1"); - fixture.Repository.MakeACommit(); + fixture.BranchTo("feature/test"); + fixture.MakeATaggedCommit("0.1.0-test.1"); + fixture.MakeACommit(); - fixture.AssertFullSemver("0.1.0-test.2+2", config); + fixture.AssertFullSemver("0.1.0-test.2+1", configuration); - Commands.Checkout(fixture.Repository, MainBranch); + fixture.Checkout("main"); fixture.Repository.Merge("feature/test", Generate.SignatureNow()); - fixture.AssertFullSemver("0.1.0-beta.1+2", config); + fixture.AssertFullSemver("0.1.0-beta.1+3", configuration); } [Test] public void GetNextVersionOnNonMainlineBranchWithoutCommitsShouldWorkNormally() { - var config = new Config - { - VersioningMode = VersioningMode.Mainline, - NextVersion = "1.0.0" - }; + var configuration = TrunkBasedConfigurationBuilder.New + .WithNextVersion("1.0.0") + .Build(); using var fixture = new EmptyRepositoryFixture(); fixture.MakeACommit("initial commit"); fixture.BranchTo("feature/f1"); - fixture.AssertFullSemver("1.0.0-f1.0", config); + fixture.AssertFullSemver("1.0.0-f1.0", configuration); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/PathFilterTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/PathFilterTests.cs new file mode 100644 index 0000000000..efffb84e18 --- /dev/null +++ b/src/GitVersion.Core.Tests/VersionCalculation/PathFilterTests.cs @@ -0,0 +1,48 @@ +using GitVersion.Core.Tests.Helpers; +using GitVersion.VersionCalculation; + +namespace GitVersion.Core.Tests; + +[TestFixture] +public class PathFilterTests : TestBase +{ + [Test] + public void VerifyNullGuard() + { + var sut = new PathFilter([]); + + Should.Throw(() => sut.Exclude((IBaseVersion)null!, out _)); + } + + [Test] + public void WhenPathMatchShouldExcludeWithReason() + { + var commit = GitRepositoryTestingExtensions.CreateMockCommit(["/path"]); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); + var sut = new PathFilter(commit.DiffPaths); + + sut.Exclude(version, out var reason).ShouldBeTrue(); + reason.ShouldNotBeNullOrWhiteSpace(); + } + + [Test] + public void WhenPathMismatchShouldNotExclude() + { + var commit = GitRepositoryTestingExtensions.CreateMockCommit(["/path"]); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); + var sut = new PathFilter(["/another_path"]); + + sut.Exclude(version, out var reason).ShouldBeFalse(); + reason.ShouldBeNull(); + } + + [Test] + public void ExcludeShouldAcceptVersionWithNullCommit() + { + BaseVersion version = new("dummy", new SemanticVersion(1)); + var sut = new PathFilter(["/path"]); + + sut.Exclude(version, out var reason).ShouldBeFalse(); + reason.ShouldBeNull(); + } +} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs index 6b0dee6ebb..2d0279a15c 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs @@ -1,82 +1,70 @@ using GitVersion.Core.Tests.Helpers; -using GitVersion.Model.Configuration; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; [TestFixture] public class SemanticVersionTests : TestBase { - [TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, null)] - [TestCase("1.2", 1, 2, 0, null, null, null, null, null, null, "1.2.0", null)] - [TestCase("1.2.3-beta", 1, 2, 3, "beta", null, null, null, null, null, null, null)] - [TestCase("1.2.3-beta3", 1, 2, 3, "beta", 3, null, null, null, null, "1.2.3-beta.3", null)] - [TestCase("1.2.3-beta.3", 1, 2, 3, "beta", 3, null, null, null, null, "1.2.3-beta.3", null)] - [TestCase("1.2.3-beta-3", 1, 2, 3, "beta-3", null, null, null, null, null, "1.2.3-beta-3", null)] - [TestCase("1.2.3-alpha", 1, 2, 3, "alpha", null, null, null, null, null, null, null)] - [TestCase("1.2-alpha4", 1, 2, 0, "alpha", 4, null, null, null, null, "1.2.0-alpha.4", null)] - [TestCase("1.2.3-rc", 1, 2, 3, "rc", null, null, null, null, null, null, null)] - [TestCase("1.2.3-rc3", 1, 2, 3, "rc", 3, null, null, null, null, "1.2.3-rc.3", null)] - [TestCase("1.2.3-3", 1, 2, 3, "", 3, null, null, null, null, "1.2.3-3", null)] - [TestCase("1.2.3-RC3", 1, 2, 3, "RC", 3, null, null, null, null, "1.2.3-RC.3", null)] - [TestCase("1.2.3-rc3.1", 1, 2, 3, "rc3", 1, null, null, null, null, "1.2.3-rc3.1", null)] - [TestCase("01.02.03-rc03", 1, 2, 3, "rc", 3, null, null, null, null, "1.2.3-rc.3", null)] - [TestCase("1.2.3-beta3f", 1, 2, 3, "beta3f", null, null, null, null, null, null, null)] - [TestCase("1.2.3-notAStability1", 1, 2, 3, "notAStability", 1, null, null, null, null, "1.2.3-notAStability.1", null)] - [TestCase("1.2.3.4", 1, 2, 3, null, null, 4, null, null, null, "1.2.3+4", null)] - [TestCase("1.2.3+4", 1, 2, 3, null, null, 4, null, null, null, null, null)] - [TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, null, null, 4, "Foo", null, null, null, null)] - [TestCase("1.2.3+randomMetaData", 1, 2, 3, null, null, null, null, null, "randomMetaData", null, null)] - [TestCase("1.2.3-beta.1+4.Sha.12234.Othershiz", 1, 2, 3, "beta", 1, 4, null, "12234", "Othershiz", null, null)] - [TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, Config.DefaultTagPrefix)] - [TestCase("v1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)] - [TestCase("V1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", Config.DefaultTagPrefix)] - [TestCase("version-1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", "version-")] - [TestCase("1", 1, 0, 0, null, null, null, null, null, null, "1.0.0", null)] - [TestCase("1.1", 1, 1, 0, null, null, null, null, null, null, "1.1.0", null)] - [TestCase("1.0.0-develop-20201007113711", 1, 0, 0, "develop-20201007113711", null, null, null, null, null, "1.0.0-develop-20201007113711", null)] - [TestCase("20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", 20201007113711, 658165168461351, 64136516984163213, "develop-20201007113711", 98848747823, 65416321321, null, null, null, "20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", null)] + [TestCase("1.2.3", 1, 2, 3, "", null, null, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta", 1, 2, 3, "beta", null, null, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta3", 1, 2, 3, "beta", 3, null, null, null, null, "1.2.3-beta.3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta.3", 1, 2, 3, "beta", 3, null, null, null, null, "1.2.3-beta.3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta-3", 1, 2, 3, "beta-3", null, null, null, null, null, "1.2.3-beta-3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-alpha", 1, 2, 3, "alpha", null, null, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-rc", 1, 2, 3, "rc", null, null, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-rc3", 1, 2, 3, "rc", 3, null, null, null, null, "1.2.3-rc.3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-3", 1, 2, 3, "", 3, null, null, null, null, "1.2.3-3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-RC3", 1, 2, 3, "RC", 3, null, null, null, null, "1.2.3-RC.3", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-rc3.1", 1, 2, 3, "rc3", 1, null, null, null, null, "1.2.3-rc3.1", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta3f", 1, 2, 3, "beta3f", null, null, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-notAStability1", 1, 2, 3, "notAStability", 1, null, null, null, null, "1.2.3-notAStability.1", null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3+4", 1, 2, 3, "", null, 4, null, null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, "", null, 4, "Foo", null, null, null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3+randomMetaData", 1, 2, 3, "", null, null, null, null, "randomMetaData", null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3-beta.1+4.Sha.12234.Othershiz", 1, 2, 3, "beta", 1, 4, null, "12234", "Othershiz", null, null, SemanticVersionFormat.Strict)] + [TestCase("1.2.3", 1, 2, 3, "", null, null, null, null, null, null, RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, SemanticVersionFormat.Strict)] + [TestCase("v1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, SemanticVersionFormat.Strict)] + [TestCase("V1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern, SemanticVersionFormat.Strict)] + [TestCase("version-1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", "version-", SemanticVersionFormat.Strict)] + [TestCase("1.0.0-develop-20201007113711", 1, 0, 0, "develop-20201007113711", null, null, null, null, null, "1.0.0-develop-20201007113711", null, SemanticVersionFormat.Strict)] + [TestCase("20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", 20201007113711, 658165168461351, 64136516984163213, "develop-20201007113711", 98848747823, 65416321321, null, null, null, "20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", null, SemanticVersionFormat.Strict)] + [TestCase("1.2", 1, 2, 0, "", null, null, null, null, null, "1.2.0", null, SemanticVersionFormat.Loose)] + [TestCase("1.2-alpha4", 1, 2, 0, "alpha", 4, null, null, null, null, "1.2.0-alpha.4", null, SemanticVersionFormat.Loose)] + [TestCase("01.02.03-rc03", 1, 2, 3, "rc", 3, null, null, null, null, "1.2.3-rc.3", null, SemanticVersionFormat.Loose)] + [TestCase("1.2.3.4", 1, 2, 3, "", null, 4, null, null, null, "1.2.3+4", null, SemanticVersionFormat.Loose)] + [TestCase("1", 1, 0, 0, "", null, null, null, null, null, "1.0.0", null, SemanticVersionFormat.Loose)] + [TestCase("1.1", 1, 1, 0, "", null, null, null, null, null, "1.1.0", null, SemanticVersionFormat.Loose)] public void ValidateVersionParsing( - string? versionString, long major, long minor, long patch, string? tag, long? tagNumber, long? numberOfBuilds, - string? branchName, string? sha, string? otherMetaData, string? fullFormattedVersionString, string? tagPrefixRegex) + string? versionString, long major, long minor, long patch, string label, long? tagNumber, long? numberOfBuilds, + string? branchName, string? sha, string? otherMetaData, string? fullFormattedVersionString, string? tagPrefixRegex, SemanticVersionFormat format = SemanticVersionFormat.Strict) { fullFormattedVersionString ??= versionString; versionString.ShouldNotBeNull(); - SemanticVersion.TryParse(versionString, tagPrefixRegex, out var version).ShouldBe(true, versionString); + SemanticVersion.TryParse(versionString, tagPrefixRegex, out var version, format).ShouldBe(true, versionString); version.ShouldNotBeNull(); - Assert.AreEqual(major, version.Major); - Assert.AreEqual(minor, version.Minor); - Assert.AreEqual(patch, version.Patch); - version.PreReleaseTag.ShouldNotBeNull(); - Assert.AreEqual(tag, version.PreReleaseTag.Name); - Assert.AreEqual(tagNumber, version.PreReleaseTag.Number); + Assert.Multiple(() => + { + Assert.That(version.Major, Is.EqualTo(major)); + Assert.That(version.Minor, Is.EqualTo(minor)); + Assert.That(version.Patch, Is.EqualTo(patch)); + Assert.That(version.PreReleaseTag.Name, Is.EqualTo(label)); + Assert.That(version.PreReleaseTag.Number, Is.EqualTo(tagNumber)); - version.BuildMetaData.ShouldNotBeNull(); - Assert.AreEqual(numberOfBuilds, version.BuildMetaData.CommitsSinceTag); - Assert.AreEqual(branchName, version.BuildMetaData.Branch); - Assert.AreEqual(sha, version.BuildMetaData.Sha); - Assert.AreEqual(otherMetaData, version.BuildMetaData.OtherMetaData); - Assert.AreEqual(fullFormattedVersionString, version.ToString("i")); + Assert.That(version.BuildMetaData.CommitsSinceTag, Is.EqualTo(numberOfBuilds)); + Assert.That(version.BuildMetaData.Branch, Is.EqualTo(branchName)); + Assert.That(version.BuildMetaData.Sha, Is.EqualTo(sha)); + Assert.That(version.BuildMetaData.OtherMetaData, Is.EqualTo(otherMetaData)); + Assert.That(version.ToString("i"), Is.EqualTo(fullFormattedVersionString)); + }); } [TestCase("someText")] [TestCase("some-T-ext")] - [TestCase("v.1.2.3", Config.DefaultTagPrefix)] + [TestCase("v.1.2.3", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern)] public void ValidateInvalidVersionParsing(string versionString, string? tagPrefixRegex = null) => - Assert.IsFalse(SemanticVersion.TryParse(versionString, tagPrefixRegex, out _), "TryParse Result"); - - [Test] - public void LegacySemVerTest() - { - new SemanticVersionPreReleaseTag("TKT-2134_JiraDescription", null).ToString("l").ShouldBe("TKT-2134"); - new SemanticVersionPreReleaseTag("AReallyReallyReallyLongBranchName", null).ToString("l").ShouldBe("AReallyReallyReallyL"); - new SemanticVersionPreReleaseTag("TKT-2134_JiraDescription", 1).ToString("lp").ShouldBe("TKT-2134-0001"); - new SemanticVersionPreReleaseTag("TKT-2134", 1).ToString("lp").ShouldBe("TKT-2134-0001"); - new SemanticVersionPreReleaseTag("AReallyReallyReallyLongBranchName", 1).ToString("lp").ShouldBe("AReallyReallyRea0001"); - } + Assert.That(SemanticVersion.TryParse(versionString, tagPrefixRegex, out _), Is.False, "TryParse Result"); [Test] public void VersionSorting() @@ -97,7 +85,7 @@ public void ToStringWithInvalidFormatTest() [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-4")] - public string ToStringTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) + public string ToStringTests(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, int? buildCount, string? branchName, string? sha, string? otherMetadata) { var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); return semVer.ToString(); @@ -107,7 +95,7 @@ public string ToStringTests(int major, int minor, int patch, string preReleaseNa [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "", 4, 10, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-4")] - public string ToStringWithSFormatTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) + public string ToStringWithSFormatTests(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, int? buildCount, string? branchName, string? sha, string? otherMetadata) { var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); return semVer.ToString("s"); @@ -116,35 +104,17 @@ public string ToStringWithSFormatTests(int major, int minor, int patch, string p [TestCase(1, 2, 3, null, null, null, null, null, null, ExpectedResult = "1.2.3")] [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3")] [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3")] - public string ToStringWithFormatJTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) + public string ToStringWithFormatJTests(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, int? buildCount, string? branchName, string? sha, string? otherMetadata) { var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); return semVer.ToString("j"); } - [TestCase(1, 2, 3, null, null, null, null, null, null, ExpectedResult = "1.2.3")] - [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta4")] - [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-beta4")] - public string ToStringWithFormatLTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) - { - var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); - return semVer.ToString("l"); - } - - [TestCase(1, 2, 3, null, null, null, null, null, null, ExpectedResult = "1.2.3")] - [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta0004")] - [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-beta0004")] - public string ToStringWithFormatLpTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) - { - var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); - return semVer.ToString("lp"); - } - [TestCase(1, 2, 3, null, null, null, null, null, null, ExpectedResult = "1.2.3")] [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "beta", 4, 5, null, null, null, ExpectedResult = "1.2.3-beta.4+5")] [TestCase(1, 2, 3, "", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-4+5")] - public string ToStringWithFormatFTests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) + public string ToStringWithFormatFTests(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, int? buildCount, string? branchName, string? sha, string? otherMetadata) { var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); return semVer.ToString("f"); @@ -154,22 +124,25 @@ public string ToStringWithFormatFTests(int major, int minor, int patch, string p [TestCase(1, 2, 3, "beta", 4, null, null, null, null, ExpectedResult = "1.2.3-beta.4")] [TestCase(1, 2, 3, "beta", 4, 5, null, null, null, ExpectedResult = "1.2.3-beta.4+5")] [TestCase(1, 2, 3, "beta", 4, 5, "theBranch", "theSha", "theOtherMetaData", ExpectedResult = "1.2.3-beta.4+5.Branch.theBranch.Sha.theSha.theOtherMetaData")] - public string ToStringWithFormatITests(int major, int minor, int patch, string preReleaseName, int preReleaseVersion, int? buildCount, string branchName, string sha, string otherMetadata) + public string ToStringWithFormatITests(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, int? buildCount, string? branchName, string? sha, string? otherMetadata) { var semVer = BuildSemVer(major, minor, patch, preReleaseName, preReleaseVersion, buildCount, branchName, sha, otherMetadata); return semVer.ToString("i"); } - private static SemanticVersion BuildSemVer(int major, int minor, int patch, string? preReleaseName, int preReleaseVersion, int? buildCount, string? branchName = null, string? sha = null, string? otherMetadata = null) + private static SemanticVersion BuildSemVer(int major, int minor, int patch, string? preReleaseName, int? preReleaseVersion, + int? buildCount, string? branchName = null, string? sha = null, string? otherMetadata = null) { - var semVer = new SemanticVersion(major, minor, patch); + SemanticVersionPreReleaseTag? preReleaseTag = null; if (preReleaseName != null) { - semVer.PreReleaseTag = new SemanticVersionPreReleaseTag(preReleaseName, preReleaseVersion); + preReleaseTag = new(preReleaseName, preReleaseVersion, true); } + + SemanticVersionBuildMetaData? buildMetaDate = null; if (buildCount.HasValue) { - semVer.BuildMetaData = new SemanticVersionBuildMetaData + buildMetaDate = new() { CommitsSinceTag = buildCount.Value, Sha = sha, @@ -178,6 +151,1390 @@ private static SemanticVersion BuildSemVer(int major, int minor, int patch, stri }; } - return semVer; + return new(major, minor, patch) + { + PreReleaseTag = preReleaseTag ?? SemanticVersionPreReleaseTag.Empty, + BuildMetaData = buildMetaDate ?? SemanticVersionBuildMetaData.Empty + }; + } + + [TestCase("0.0.0", VersionField.None, null, ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1", VersionField.None, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, null, ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1", VersionField.Patch, "foo", ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0", VersionField.None, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1", VersionField.None, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, null, ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1", VersionField.Patch, "foo", ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0", VersionField.None, null, ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.0.1", VersionField.None, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, null, ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1", VersionField.Patch, "foo", ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0", VersionField.None, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1", VersionField.None, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, null, ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1", VersionField.Patch, "foo", ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingVersion(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0", VersionField.None, null, ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1", VersionField.None, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, null, ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1", VersionField.Patch, "foo", ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0", VersionField.None, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1", VersionField.None, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, null, ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1", VersionField.Patch, "foo", ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0", VersionField.None, null, ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.0.1", VersionField.None, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, null, ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1", VersionField.Patch, "foo", ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0", VersionField.None, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1", VersionField.None, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, null, ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1", VersionField.Patch, "foo", ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingVersionInModeEnsureIntegrity(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.EnsureIntegrity); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0", VersionField.None, null, ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1", VersionField.None, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, null, ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1", VersionField.Patch, "foo", ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0", VersionField.None, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1", VersionField.None, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, null, ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1", VersionField.Patch, "foo", ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0", VersionField.None, null, ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.0.1", VersionField.None, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, null, ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1", VersionField.Patch, "foo", ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0", VersionField.None, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1", VersionField.None, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, null, ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1", VersionField.Patch, "foo", ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingVersionInModeForce(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.Force); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-2", VersionField.None, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Minor, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Major, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.None, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Minor, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Major, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Patch, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Minor, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Major, "foo", ExpectedResult = "0.0.0-foo.1")] + + [TestCase("0.0.1-2", VersionField.None, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Minor, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Major, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.None, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Minor, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Major, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Minor, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Major, "foo", ExpectedResult = "0.0.1-foo.1")] + + [TestCase("0.1.0-2", VersionField.None, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Minor, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Major, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.None, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Minor, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Major, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Patch, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Major, "foo", ExpectedResult = "0.1.0-foo.1")] + + [TestCase("0.1.1-2", VersionField.None, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Minor, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Major, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.None, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Minor, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Major, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Minor, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Major, "foo", ExpectedResult = "0.1.1-foo.1")] + + [TestCase("1.0.0-2", VersionField.None, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Minor, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.None, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Minor, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Patch, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Minor, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.1-2", VersionField.None, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Minor, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Major, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.None, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Minor, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Major, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Minor, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Major, "foo", ExpectedResult = "1.0.1-foo.1")] + + [TestCase("1.1.0-2", VersionField.None, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Minor, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Major, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.None, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Minor, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Major, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Patch, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Major, "foo", ExpectedResult = "1.1.0-foo.1")] + + [TestCase("1.1.1-2", VersionField.None, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Minor, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Major, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.None, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Minor, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Major, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Minor, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Major, "foo", ExpectedResult = "1.1.1-foo.1")] + public string WhenIncrementingPreReleaseVersion(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-2", VersionField.None, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-2", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-2", VersionField.None, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1-2", VersionField.None, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-2", VersionField.None, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0-2", VersionField.None, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-2", VersionField.Minor, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-2", VersionField.None, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-2", VersionField.Minor, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1-2", VersionField.None, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-2", VersionField.None, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0-2", VersionField.None, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-2", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.None, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.1-2", VersionField.None, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-2", VersionField.None, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0-2", VersionField.None, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-2", VersionField.Minor, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-2", VersionField.None, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-2", VersionField.Minor, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1-2", VersionField.None, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-2", VersionField.None, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingPreReleaseVersionInModeEnsureIntegrity(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.EnsureIntegrity); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-2", VersionField.None, null, ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, null, ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-2", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-2", VersionField.None, "", ExpectedResult = "0.0.0-3")] + [TestCase("0.0.0-2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1-2", VersionField.None, null, ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, null, ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1-2", VersionField.Minor, null, ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-2", VersionField.None, "", ExpectedResult = "0.0.1-3")] + [TestCase("0.0.1-2", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1-2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.1-2", VersionField.Patch, "foo", ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1-2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0-2", VersionField.None, null, ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, null, ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-2", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-2", VersionField.None, "", ExpectedResult = "0.1.0-3")] + [TestCase("0.1.0-2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1-2", VersionField.None, null, ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, null, ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1-2", VersionField.Minor, null, ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-2", VersionField.Major, null, ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-2", VersionField.None, "", ExpectedResult = "0.1.1-3")] + [TestCase("0.1.1-2", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1-2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.1-2", VersionField.Patch, "foo", ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1-2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0-2", VersionField.None, null, ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, null, ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-2", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0-2", VersionField.None, "", ExpectedResult = "1.0.0-3")] + [TestCase("1.0.0-2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0-2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.0.1-2", VersionField.None, null, ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, null, ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1-2", VersionField.Minor, null, ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-2", VersionField.None, "", ExpectedResult = "1.0.1-3")] + [TestCase("1.0.1-2", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1-2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.1-2", VersionField.Patch, "foo", ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1-2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0-2", VersionField.None, null, ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, null, ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-2", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-2", VersionField.None, "", ExpectedResult = "1.1.0-3")] + [TestCase("1.1.0-2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1-2", VersionField.None, null, ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, null, ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1-2", VersionField.Minor, null, ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-2", VersionField.Major, null, ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-2", VersionField.None, "", ExpectedResult = "1.1.1-3")] + [TestCase("1.1.1-2", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1-2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.1-2", VersionField.Patch, "foo", ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1-2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingPreReleaseVersionInModeForce(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.Force); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-foo.2", VersionField.None, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Major, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Major, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "0.0.0-foo.3")] + + [TestCase("0.0.1-foo.2", VersionField.None, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Major, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Major, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "0.0.1-foo.3")] + + [TestCase("0.1.0-foo.2", VersionField.None, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Major, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Major, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "0.1.0-foo.3")] + + [TestCase("0.1.1-foo.2", VersionField.None, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Major, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Major, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "0.1.1-foo.3")] + + [TestCase("1.0.0-foo.2", VersionField.None, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.3")] + + [TestCase("1.0.1-foo.2", VersionField.None, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Major, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Major, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.1-foo.3")] + + [TestCase("1.1.0-foo.2", VersionField.None, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Major, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Major, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.1.0-foo.3")] + + [TestCase("1.1.1-foo.2", VersionField.None, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Major, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Major, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.1.1-foo.3")] + public string WhenIncrementingPreReleaseVersionFoo(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-foo.2", VersionField.None, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1-foo.2", VersionField.None, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0-foo.2", VersionField.None, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1-foo.2", VersionField.None, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0-foo.2", VersionField.None, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.3")] + + [TestCase("1.0.1-foo.2", VersionField.None, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0-foo.2", VersionField.None, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1-foo.2", VersionField.None, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingPreReleaseVersionFooInModeEnsureIntegrity(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.EnsureIntegrity); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-foo.2", VersionField.None, null, ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.0-foo.3")] + [TestCase("0.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.1-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.0.1-foo.2", VersionField.None, null, ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.0.1-foo.3")] + [TestCase("0.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.0.2-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.1.0-foo.1")] + [TestCase("0.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.0-foo.2", VersionField.None, null, ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.0-foo.3")] + [TestCase("0.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.1-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("0.1.1-foo.2", VersionField.None, null, ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Major, null, ExpectedResult = "1.0.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-foo.2", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "0.1.1-foo.3")] + [TestCase("0.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "0.1.2-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "0.2.0-foo.1")] + [TestCase("0.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "1.0.0-foo.1")] + + [TestCase("1.0.0-foo.2", VersionField.None, null, ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.0-foo.3")] + [TestCase("1.0.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.1-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.0-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.0.1-foo.2", VersionField.None, null, ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.0.1-foo.3")] + [TestCase("1.0.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.0.2-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.1.0-foo.1")] + [TestCase("1.0.1-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.0-foo.2", VersionField.None, null, ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, null, ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.0-foo.3")] + [TestCase("1.1.0-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.1-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.0-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + + [TestCase("1.1.1-foo.2", VersionField.None, null, ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, null, ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Minor, null, ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Major, null, ExpectedResult = "2.0.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-foo.2", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-foo.2", VersionField.None, "foo", ExpectedResult = "1.1.1-foo.3")] + [TestCase("1.1.1-foo.2", VersionField.Patch, "foo", ExpectedResult = "1.1.2-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Minor, "foo", ExpectedResult = "1.2.0-foo.1")] + [TestCase("1.1.1-foo.2", VersionField.Major, "foo", ExpectedResult = "2.0.0-foo.1")] + public string WhenIncrementingPreReleaseVersionFooInModeForce(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.Force); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-bar", VersionField.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.Patch, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.Minor, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.Major, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, "bar", ExpectedResult = "0.0.0-bar")] + + [TestCase("0.0.1-bar", VersionField.None, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Major, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Minor, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Major, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.None, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Major, "bar", ExpectedResult = "0.0.1-bar")] + + [TestCase("0.1.0-bar", VersionField.None, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Patch, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Major, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.None, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, "bar", ExpectedResult = "0.1.0-bar")] + + [TestCase("0.1.1-bar", VersionField.None, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Major, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Minor, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Major, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.None, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Major, "bar", ExpectedResult = "0.1.1-bar")] + + [TestCase("1.0.0-bar", VersionField.None, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.Patch, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.Minor, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.None, "bar", ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("1.0.1-bar", VersionField.None, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Major, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Minor, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Major, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.None, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Major, "bar", ExpectedResult = "1.0.1-bar")] + + [TestCase("1.1.0-bar", VersionField.None, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Patch, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Major, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.None, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, "bar", ExpectedResult = "1.1.0-bar")] + + [TestCase("1.1.1-bar", VersionField.None, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Major, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Minor, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Major, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.None, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Major, "bar", ExpectedResult = "1.1.1-bar")] + public string WhenIncrementingPreReleaseVersionBar(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-bar", VersionField.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-bar", VersionField.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.0.1-bar", VersionField.None, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.1-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.0.1-bar", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-bar", VersionField.None, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.1-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.1.0-bar", VersionField.None, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.1.0-bar", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-bar", VersionField.None, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.1.1-bar", VersionField.None, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, null, ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.1-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.1.1-bar", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-bar", VersionField.None, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.1-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("1.0.0-bar", VersionField.None, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.None, "bar", ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("1.0.1-bar", VersionField.None, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.1-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.0.1-bar", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-bar", VersionField.None, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.1-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + + [TestCase("1.1.0-bar", VersionField.None, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.1.0-bar", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-bar", VersionField.None, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + + [TestCase("1.1.1-bar", VersionField.None, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, null, ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.1-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.1.1-bar", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-bar", VersionField.None, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.1-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + public string WhenIncrementingPreReleaseVersionBarInModeEnsureIntegrity(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.EnsureIntegrity); + + // Assert + return result.ToString("i"); + } + + [TestCase("0.0.0-bar", VersionField.None, null, ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.None, "", ExpectedResult = "0.0.0-1")] + [TestCase("0.0.0-bar", VersionField.Patch, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.0-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.0-bar", VersionField.None, "bar", ExpectedResult = "0.0.0-bar")] + [TestCase("0.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.0.1-bar", VersionField.None, null, ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, null, ExpectedResult = "0.0.2-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.1-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.0.1-bar", VersionField.None, "", ExpectedResult = "0.0.1-1")] + [TestCase("0.0.1-bar", VersionField.Patch, "", ExpectedResult = "0.0.2-1")] + [TestCase("0.0.1-bar", VersionField.Minor, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.0.1-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.0.1-bar", VersionField.None, "bar", ExpectedResult = "0.0.1-bar")] + [TestCase("0.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.0.2-bar")] + [TestCase("0.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.0.1-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.1.0-bar", VersionField.None, null, ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, null, ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.1.0-bar", VersionField.None, "", ExpectedResult = "0.1.0-1")] + [TestCase("0.1.0-bar", VersionField.Patch, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.0-bar", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.0-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.0-bar", VersionField.None, "bar", ExpectedResult = "0.1.0-bar")] + [TestCase("0.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.0-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("0.1.1-bar", VersionField.None, null, ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, null, ExpectedResult = "0.1.2-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, null, ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.1-bar", VersionField.Major, null, ExpectedResult = "1.0.0-bar")] + [TestCase("0.1.1-bar", VersionField.None, "", ExpectedResult = "0.1.1-1")] + [TestCase("0.1.1-bar", VersionField.Patch, "", ExpectedResult = "0.1.2-1")] + [TestCase("0.1.1-bar", VersionField.Minor, "", ExpectedResult = "0.2.0-1")] + [TestCase("0.1.1-bar", VersionField.Major, "", ExpectedResult = "1.0.0-1")] + [TestCase("0.1.1-bar", VersionField.None, "bar", ExpectedResult = "0.1.1-bar")] + [TestCase("0.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "0.1.2-bar")] + [TestCase("0.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "0.2.0-bar")] + [TestCase("0.1.1-bar", VersionField.Major, "bar", ExpectedResult = "1.0.0-bar")] + + [TestCase("1.0.0-bar", VersionField.None, null, ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.None, "", ExpectedResult = "1.0.0-1")] + [TestCase("1.0.0-bar", VersionField.Patch, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.0-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.0-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.0-bar", VersionField.None, "bar", ExpectedResult = "1.0.0-bar")] + [TestCase("1.0.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.0-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + + [TestCase("1.0.1-bar", VersionField.None, null, ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, null, ExpectedResult = "1.0.2-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.1-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.0.1-bar", VersionField.None, "", ExpectedResult = "1.0.1-1")] + [TestCase("1.0.1-bar", VersionField.Patch, "", ExpectedResult = "1.0.2-1")] + [TestCase("1.0.1-bar", VersionField.Minor, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.0.1-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.0.1-bar", VersionField.None, "bar", ExpectedResult = "1.0.1-bar")] + [TestCase("1.0.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.0.2-bar")] + [TestCase("1.0.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.0.1-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + + [TestCase("1.1.0-bar", VersionField.None, null, ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, null, ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.1.0-bar", VersionField.None, "", ExpectedResult = "1.1.0-1")] + [TestCase("1.1.0-bar", VersionField.Patch, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.0-bar", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.0-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.0-bar", VersionField.None, "bar", ExpectedResult = "1.1.0-bar")] + [TestCase("1.1.0-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.0-bar", VersionField.Minor, "bar", ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.0-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + + [TestCase("1.1.1-bar", VersionField.None, null, ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, null, ExpectedResult = "1.1.2-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, null, ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.1-bar", VersionField.Major, null, ExpectedResult = "2.0.0-bar")] + [TestCase("1.1.1-bar", VersionField.None, "", ExpectedResult = "1.1.1-1")] + [TestCase("1.1.1-bar", VersionField.Patch, "", ExpectedResult = "1.1.2-1")] + [TestCase("1.1.1-bar", VersionField.Minor, "", ExpectedResult = "1.2.0-1")] + [TestCase("1.1.1-bar", VersionField.Major, "", ExpectedResult = "2.0.0-1")] + [TestCase("1.1.1-bar", VersionField.None, "bar", ExpectedResult = "1.1.1-bar")] + [TestCase("1.1.1-bar", VersionField.Patch, "bar", ExpectedResult = "1.1.2-bar")] + [TestCase("1.1.1-bar", VersionField.Minor, "bar", ExpectedResult = "1.2.0-bar")] + [TestCase("1.1.1-bar", VersionField.Major, "bar", ExpectedResult = "2.0.0-bar")] + public string WhenIncrementingPreReleaseVersionBarInModeForce(string value, VersionField increment, string? label) + { + // Arrange + var semanticVersion = SemanticVersion.Parse(value, null); + + // Act + var result = semanticVersion.Increment(increment, label, SemanticVersion.IncrementMode.Force); + + // Assert + return result.ToString("i"); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/ShaVersionFilterTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/ShaVersionFilterTests.cs index 9a07c7311e..e4d4b219f1 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/ShaVersionFilterTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/ShaVersionFilterTests.cs @@ -1,7 +1,5 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.VersionCalculation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -9,20 +7,20 @@ namespace GitVersion.Core.Tests; public class ShaVersionFilterTests : TestBase { [Test] - public void VerifyNullGuard2() + public void VerifyNullGuard() { - var commit = GitToolsTestingExtensions.CreateMockCommit(); - var sut = new ShaVersionFilter(new[] { commit.Sha }); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); + var sut = new ShaVersionFilter([commit.Sha]); - Should.Throw(() => sut.Exclude(null!, out _)); + Should.Throw(() => sut.Exclude((IBaseVersion)null!, out _)); } [Test] public void WhenShaMatchShouldExcludeWithReason() { - var commit = GitToolsTestingExtensions.CreateMockCommit(); - var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty); - var sut = new ShaVersionFilter(new[] { commit.Sha }); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); + var sut = new ShaVersionFilter([commit.Sha]); sut.Exclude(version, out var reason).ShouldBeTrue(); reason.ShouldNotBeNullOrWhiteSpace(); @@ -31,9 +29,9 @@ public void WhenShaMatchShouldExcludeWithReason() [Test] public void WhenShaMismatchShouldNotExclude() { - var commit = GitToolsTestingExtensions.CreateMockCommit(); - var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty); - var sut = new ShaVersionFilter(new[] { "mismatched" }); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); + BaseVersion version = new("dummy", new SemanticVersion(1), commit); + var sut = new ShaVersionFilter(["mismatched"]); sut.Exclude(version, out var reason).ShouldBeFalse(); reason.ShouldBeNull(); @@ -42,8 +40,8 @@ public void WhenShaMismatchShouldNotExclude() [Test] public void ExcludeShouldAcceptVersionWithNullCommit() { - var version = new BaseVersion("dummy", false, new SemanticVersion(1), null, string.Empty); - var sut = new ShaVersionFilter(new[] { "mismatched" }); + BaseVersion version = new("dummy", new SemanticVersion(1)); + var sut = new ShaVersionFilter(["mismatched"]); sut.Exclude(version, out var reason).ShouldBeFalse(); reason.ShouldBeNull(); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfigNextVersionBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfigNextVersionBaseVersionStrategyTests.cs deleted file mode 100644 index 24d9abd155..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfigNextVersionBaseVersionStrategyTests.cs +++ /dev/null @@ -1,57 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests.VersionCalculation.Strategies; - -[TestFixture] -public class ConfigNextVersionBaseVersionStrategyTests : TestBase -{ - [Test] - public void ReturnsNullWhenNoNextVersionIsInConfig() - { - var baseVersion = GetBaseVersion(); - - baseVersion.ShouldBe(null); - } - - [TestCase("1.0.0", "1.0.0")] - [TestCase("2", "2.0.0")] - [TestCase("2.118998723", "2.118998723.0")] - [TestCase("2.12.654651698", "2.12.654651698")] - public void ConfigNextVersionTest(string nextVersion, string expectedVersion) - { - var baseVersion = GetBaseVersion(new Config - { - NextVersion = nextVersion - }); - - baseVersion.ShouldNotBeNull(); - baseVersion.ShouldIncrement.ShouldBe(false); - baseVersion.SemanticVersion.ToString().ShouldBe(expectedVersion); - } - - private static BaseVersion? GetBaseVersion(Config? config = null) - { - var contextBuilder = new GitVersionContextBuilder(); - - if (config != null) - { - contextBuilder = contextBuilder.WithConfig(config); - } - - contextBuilder.Build(); - contextBuilder.ServicesProvider.ShouldNotBeNull(); - var strategy = contextBuilder.ServicesProvider.GetServiceForType(); - var context = contextBuilder.ServicesProvider.GetRequiredService>().Value; - var branchMock = GitToolsTestingExtensions.CreateMockBranch("main", GitToolsTestingExtensions.CreateMockCommit()); - var branchConfiguration = context.FullConfiguration.GetBranchConfiguration(branchMock); - var effectiveConfiguration = new EffectiveConfiguration(context.FullConfiguration, branchConfiguration); - return strategy.GetBaseVersions(new(branchMock, effectiveConfiguration)).SingleOrDefault(); - } -} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs new file mode 100644 index 0000000000..bd06aceb05 --- /dev/null +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/ConfiguredNextVersionVersionStrategyTests.cs @@ -0,0 +1,89 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; +using GitVersion.VersionCalculation; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Core.Tests.VersionCalculation.Strategies; + +[TestFixture] +public class ConfiguredNextVersionVersionStrategyTests : TestBase +{ + [Test] + public void ReturnsNullWhenNoNextVersionIsInConfig() + { + var baseVersion = GetBaseVersion(); + + baseVersion.ShouldBe(null); + } + + [TestCase("1.0.0", "1.0.0", SemanticVersionFormat.Strict, "1.0.0-1")] + [TestCase("1.0.0", "1.0.0", SemanticVersionFormat.Loose, "1.0.0-1")] + [TestCase("2.12.654651698", "2.12.654651698", SemanticVersionFormat.Strict, "2.12.654651698-1")] + [TestCase("2.12.654651698", "2.12.654651698", SemanticVersionFormat.Loose, "2.12.654651698-1")] + [TestCase("0.1", "0.1.0", SemanticVersionFormat.Loose, "0.1.0-1")] + [TestCase("1.0.0-alpha.1", null, SemanticVersionFormat.Strict, null)] + [TestCase("1.0.0-2", "1.0.0-2", SemanticVersionFormat.Strict, "1.0.0-2")] + public void ConfiguredNextVersionTest( + string nextVersion, string? semanticVersion, SemanticVersionFormat versionFormat, string? incrementedVersion) + { + var overrideConfiguration = new Dictionary + { + { "next-version", nextVersion }, + { "semantic-version-format", versionFormat } + }; + var baseVersion = GetBaseVersion(overrideConfiguration); + + if (semanticVersion.IsNullOrEmpty()) + { + baseVersion.ShouldBeNull(); + return; + } + + baseVersion.ShouldNotBeNull(); + baseVersion.SemanticVersion.ToString().ShouldBe(semanticVersion); + baseVersion.BaseVersionSource.ShouldBeNull(); + + var shouldBeIncremented = semanticVersion != incrementedVersion; + baseVersion.ShouldIncrement.ShouldBe(shouldBeIncremented); + if (shouldBeIncremented) + { + baseVersion.Operator.ShouldNotBeNull(); + baseVersion.Operator!.Label.ShouldBe(string.Empty); + baseVersion.Operator.ForceIncrement.ShouldBe(false); + baseVersion.Operator.Increment.ShouldBe(VersionField.None); + baseVersion.Operator.BaseVersionSource.ShouldBeNull(); + } + else + { + baseVersion.Operator.ShouldBeNull(); + } + baseVersion.GetIncrementedVersion().ToString().ShouldBe(incrementedVersion); + } + + [TestCase("0.1", SemanticVersionFormat.Strict)] + public void ConfiguredNextVersionTestShouldFail(string nextVersion, SemanticVersionFormat versionFormat) + { + var overrideConfiguration = new Dictionary + { + { "next-version", nextVersion }, + { "semantic-version-format", versionFormat } + }; + + Should.Throw(() => GetBaseVersion(overrideConfiguration)) + .Message.ShouldBe($"Failed to parse {nextVersion} into a Semantic Version"); + } + + private static BaseVersion? GetBaseVersion(IReadOnlyDictionary? overrideConfiguration = null) + { + using var contextBuilder = new GitVersionContextBuilder().WithOverrideConfiguration(overrideConfiguration); + contextBuilder.Build(); + contextBuilder.ServicesProvider.ShouldNotBeNull(); + var strategy = contextBuilder.ServicesProvider.GetServiceForType(); + var context = contextBuilder.ServicesProvider.GetRequiredService>().Value; + var branchMock = GitRepositoryTestingExtensions.CreateMockBranch("main", GitRepositoryTestingExtensions.CreateMockCommit()); + + strategy.ShouldNotBeNull(); + return strategy.GetBaseVersions(context.Configuration.GetEffectiveBranchConfiguration(branchMock)).SingleOrDefault(); + } +} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs index a2ca9409ae..d38ae71969 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs @@ -1,12 +1,9 @@ using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NSubstitute; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.VersionCalculation.Strategies; @@ -18,32 +15,30 @@ public void ShouldNotAllowIncrementOfVersion() { // When a branch is merged in you want to start building stable packages of that version // So we shouldn't bump the version - var mockCommit = GitToolsTestingExtensions.CreateMockCommit(); + var mockCommit = GitRepositoryTestingExtensions.CreateMockCommit(); mockCommit.Message.Returns("Merge branch 'release-0.1.5'"); mockCommit.Parents.Returns(GetParents(true)); - var mockBranch = GitToolsTestingExtensions.CreateMockBranch(MainBranch, mockCommit); + var mockBranch = GitRepositoryTestingExtensions.CreateMockBranch(MainBranch, mockCommit); var branches = Substitute.For(); - branches.GetEnumerator().Returns(_ => ((IEnumerable)new[] - { - mockBranch - }).GetEnumerator()); + branches.MockCollectionReturn(mockBranch); var mockRepository = Substitute.For(); mockRepository.Head.Returns(mockBranch); mockRepository.Branches.Returns(branches); mockRepository.Commits.Returns(mockBranch.Commits); - var contextBuilder = new GitVersionContextBuilder().WithRepository(mockRepository); + using var contextBuilder = new GitVersionContextBuilder().WithRepository(mockRepository); contextBuilder.Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var strategy = contextBuilder.ServicesProvider.GetServiceForType(); var context = contextBuilder.ServicesProvider.GetRequiredService>().Value; - var branchConfiguration = context.FullConfiguration.GetBranchConfiguration(mockBranch); - var effectiveConfiguration = new EffectiveConfiguration(context.FullConfiguration, branchConfiguration); - var baseVersion = strategy.GetBaseVersions(new(mockBranch, effectiveConfiguration)).Single(); - baseVersion.ShouldIncrement.ShouldBe(false); + strategy.ShouldNotBeNull(); + var configuration = context.Configuration.GetEffectiveBranchConfiguration(mockBranch); + var baseVersion = strategy.GetBaseVersions(configuration).Single(); + + baseVersion.GetIncrementedVersion().ToString().ShouldBe("0.1.5-1"); } [TestCase("Merge branch 'release-10.10.50'", true, "10.10.50")] @@ -57,9 +52,9 @@ public void ShouldNotAllowIncrementOfVersion() [TestCase("Merge branch 'release-0.1.5'\n\nRelates to: TicketId", true, "0.1.5")] [TestCase("Finish Release-0.12.0", true, "0.12.0")] //Support Syntevo SmartGit/Hg's Gitflow merge commit messages for finishing a 'Release' branch [TestCase("Merge branch 'Release-v0.2.0'", true, "0.2.0")] - [TestCase("Merge branch 'Release-v2.2'", true, "2.2.0")] [TestCase("Merge remote-tracking branch 'origin/release/0.8.0' into develop/" + MainBranch, true, "0.8.0")] [TestCase("Merge remote-tracking branch 'refs/remotes/origin/release/2.0.0'", true, "2.0.0")] + [TestCase("Merge branch 'Releases/0.2.0'", false, "0.2.0")] // Support Squash Commits public void TakesVersionFromMergeOfReleaseBranch(string message, bool isMergeCommit, string expectedVersion) { var parents = GetParents(isMergeCommit); @@ -78,14 +73,7 @@ public void TakesVersionFromMergeOfReleaseBranch(string message, bool isMergeCom [TestCase("Merge branch '4.0.3'", true)] [TestCase("Merge branch 's'", true)] [TestCase("Merge tag '10.10.50'", true)] - [TestCase("Merge branch 'hotfix-4.6.6' into support-4.6", true)] - [TestCase("Merge branch 'hotfix-10.10.50'", true)] - [TestCase("Merge branch 'Hotfix-10.10.50'", true)] - [TestCase("Merge branch 'Hotfix/10.10.50'", true)] - [TestCase("Merge branch 'hotfix-0.1.5'", true)] - [TestCase("Merge branch 'hotfix-4.2.2' into support-4.2", true)] [TestCase("Merge branch 'somebranch' into release-3.0.0", true)] - [TestCase("Merge branch 'hotfix-0.1.5'\n\nRelates to: TicketId", true)] [TestCase("Merge branch 'alpha-0.1.5'", true)] [TestCase("Merge pull request #95 from Particular/issue-94", false)] [TestCase("Merge pull request #95 in Particular/issue-94", true)] @@ -96,20 +84,25 @@ public void TakesVersionFromMergeOfReleaseBranch(string message, bool isMergeCom [TestCase("Finish 0.14.1", true)] // Don't support Syntevo SmartGit/Hg's Gitflow merge commit messages for finishing a 'Hotfix' branch public void ShouldNotTakeVersionFromMergeOfNonReleaseBranch(string message, bool isMergeCommit) { + var configurationBuilder = GitFlowConfigurationBuilder.New; + configurationBuilder.WithBranch("hotfix", builder => builder.WithIsReleaseBranch(false)); + ConfigurationHelper configurationHelper = new(configurationBuilder.Build()); + var configurationDictionary = configurationHelper.Dictionary; + var parents = GetParents(isMergeCommit); - AssertMergeMessage(message, null, parents); - AssertMergeMessage(message + " ", null, parents); - AssertMergeMessage(message + "\r ", null, parents); - AssertMergeMessage(message + "\r", null, parents); - AssertMergeMessage(message + "\r\n", null, parents); - AssertMergeMessage(message + "\r\n ", null, parents); - AssertMergeMessage(message + "\n", null, parents); - AssertMergeMessage(message + "\n ", null, parents); + AssertMergeMessage(message, null, parents, configurationDictionary); + AssertMergeMessage(message + " ", null, parents, configurationDictionary); + AssertMergeMessage(message + "\r ", null, parents, configurationDictionary); + AssertMergeMessage(message + "\r", null, parents, configurationDictionary); + AssertMergeMessage(message + "\r\n", null, parents, configurationDictionary); + AssertMergeMessage(message + "\r\n ", null, parents, configurationDictionary); + AssertMergeMessage(message + "\n", null, parents, configurationDictionary); + AssertMergeMessage(message + "\n ", null, parents, configurationDictionary); } - [TestCase("Merge pull request #165 from Particular/release-1.0.0", true)] - [TestCase("Merge pull request #165 in Particular/release-1.0.0", true)] - [TestCase("Merge pull request #500 in FOO/bar from Particular/release-1.0.0 to develop)", true)] + [TestCase("Merge pull request #165 from organization/Particular/release-1.0.0", true)] + [TestCase("Merge pull request #165 in organization/Particular/release-1.0.0", true)] + [TestCase("Merge pull request #500 in FOO/bar from organization/Particular/release-1.0.0 to develop)", true)] public void ShouldNotTakeVersionFromMergeOfReleaseBranchWithRemoteOtherThanOrigin(string message, bool isMergeCommit) { var parents = GetParents(isMergeCommit); @@ -123,16 +116,18 @@ public void ShouldNotTakeVersionFromMergeOfReleaseBranchWithRemoteOtherThanOrigi AssertMergeMessage(message + "\n ", null, parents); } - [TestCase(@"Merge pull request #1 in FOO/bar from feature/ISSUE-1 to develop - -* commit '38560a7eed06e8d3f3f1aaf091befcdf8bf50fea': - Updated jQuery to v2.1.3")] - [TestCase(@"Merge pull request #45 in BRIKKS/brikks from feature/NOX-68 to develop - -* commit '38560a7eed06e8d3f3f1aaf091befcdf8bf50fea': - Another commit message - Commit message including a IP-number https://10.50.1.1 - A commit message")] + [TestCase(""" + Merge pull request #1 in FOO/bar from feature/ISSUE-1 to develop + * commit '38560a7eed06e8d3f3f1aaf091befcdf8bf50fea': + Updated jQuery to v2.1.3 + """)] + [TestCase(""" + Merge pull request #45 in BRIKKS/brikks from feature/NOX-68 to develop + * commit '38560a7eed06e8d3f3f1aaf091befcdf8bf50fea': + Another commit message + Commit message including a IP-number https://10.50.1.1 + A commit message + """)] [TestCase("Merge branch 'release/Sprint_2.0_Holdings_Computed_Balances'")] [TestCase("Merge branch 'develop' of http://10.0.6.3/gitblit/r/... into develop")] [TestCase("Merge branch " + MainBranch + " of http://172.16.3.10:8082/r/asu_tk/p_sd")] @@ -148,37 +143,41 @@ public void ShouldNotTakeVersionFromUnrelatedMerge(string commitMessage) [TestCase("Merge branch 'support/0.2.0'", "support", "0.2.0")] [TestCase("Merge branch 'support/0.2.0'", null, null)] [TestCase("Merge branch 'release/2.0.0'", null, "2.0.0")] - public void TakesVersionFromMergeOfConfiguredReleaseBranch(string message, string? releaseBranch, string expectedVersion) + public void TakesVersionFromMergeOfConfiguredReleaseBranch(string message, string? releaseBranch, string? expectedVersion) { - var config = new Config(); - if (releaseBranch != null) config.Branches[releaseBranch] = new BranchConfig { IsReleaseBranch = true }; + var configurationBuilder = GitFlowConfigurationBuilder.New; + if (releaseBranch != null) + { + configurationBuilder.WithBranch(releaseBranch, builder => builder.WithIsReleaseBranch(true)); + } + ConfigurationHelper configurationHelper = new(configurationBuilder.Build()); var parents = GetParents(true); - AssertMergeMessage(message, expectedVersion, parents, config); + AssertMergeMessage(message, expectedVersion, parents, configurationHelper.Dictionary); } - private static void AssertMergeMessage(string message, string? expectedVersion, IEnumerable parents, Config? config = null) + private static void AssertMergeMessage(string message, string? expectedVersion, IEnumerable parents, IReadOnlyDictionary? configuration = null) { - var commit = GitToolsTestingExtensions.CreateMockCommit(); + var commit = GitRepositoryTestingExtensions.CreateMockCommit(); commit.Message.Returns(message); commit.Parents.Returns(parents); - var mockBranch = GitToolsTestingExtensions.CreateMockBranch(MainBranch, commit, GitToolsTestingExtensions.CreateMockCommit()); + var mockBranch = GitRepositoryTestingExtensions.CreateMockBranch(MainBranch, commit, GitRepositoryTestingExtensions.CreateMockCommit()); var mockRepository = Substitute.For(); mockRepository.Head.Returns(mockBranch); mockRepository.Commits.Returns(mockBranch.Commits); - var contextBuilder = new GitVersionContextBuilder() - .WithConfig(config ?? new Config()) + using var contextBuilder = new GitVersionContextBuilder() + .WithOverrideConfiguration(configuration) .WithRepository(mockRepository); contextBuilder.Build(); contextBuilder.ServicesProvider.ShouldNotBeNull(); var strategy = contextBuilder.ServicesProvider.GetServiceForType(); var context = contextBuilder.ServicesProvider.GetRequiredService>().Value; - var branchConfiguration = context.FullConfiguration.GetBranchConfiguration(mockBranch); - var effectiveConfiguration = new EffectiveConfiguration(context.FullConfiguration, branchConfiguration); - var baseVersion = strategy.GetBaseVersions(new(mockBranch, effectiveConfiguration)).SingleOrDefault(); + + strategy.ShouldNotBeNull(); + var baseVersion = strategy.GetBaseVersions(context.Configuration.GetEffectiveBranchConfiguration(mockBranch)).SingleOrDefault(); if (expectedVersion == null) { @@ -193,18 +192,17 @@ private static void AssertMergeMessage(string message, string? expectedVersion, private static List GetParents(bool isMergeCommit) => isMergeCommit - ? new List { new MockCommit(), new MockCommit(), } - : new List { new MockCommit(), }; + ? [new MockCommit(), new MockCommit()] + : [new MockCommit()]; private class MockCommit : ICommit { public bool Equals(ICommit? other) => throw new NotImplementedException(); public int CompareTo(ICommit? other) => throw new NotImplementedException(); - public bool Equals(IGitObject? other) => throw new NotImplementedException(); - public int CompareTo(IGitObject? other) => throw new NotImplementedException(); public IObjectId Id => throw new NotImplementedException(); public string Sha => throw new NotImplementedException(); - public IEnumerable Parents => throw new NotImplementedException(); + public IReadOnlyList Parents => throw new NotImplementedException(); + public IReadOnlyList DiffPaths => throw new NotImplementedException(); public DateTimeOffset When => throw new NotImplementedException(); public string Message => throw new NotImplementedException(); } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs index 3d46d8d190..868baca593 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs @@ -1,12 +1,8 @@ -using GitTools.Testing; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; using GitVersion.VersionCalculation; -using LibGit2Sharp; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests.VersionCalculation.Strategies; @@ -18,88 +14,114 @@ public class VersionInBranchNameBaseVersionStrategyTests : TestBase public void CanTakeVersionFromNameOfReleaseBranch(string branchName, string expectedBaseVersion) { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.CreateBranch(branchName); - var gitRepository = fixture.Repository.ToGitRepository(); - var strategy = GetVersionStrategy(fixture.RepositoryPath, gitRepository, branchName); - var configuration = TestConfigurationBuilder.New.Build(); - var branchConfiguration = configuration.GetBranchConfiguration(branchName); - var effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); - var baseVersion = strategy.GetBaseVersions(new(gitRepository.FindBranch(branchName)!, effectiveConfiguration)).Single(); + fixture.MakeACommit(); + fixture.CreateBranch(branchName); + + var repository = fixture.Repository.ToGitRepository(); + + var strategy = GetVersionStrategy(repository); + var branch = repository.FindBranch(branchName); + + var configuration = GitFlowConfigurationBuilder.New.Build(); + var effectiveBranchConfiguration = configuration.GetEffectiveBranchConfiguration(branch); + + strategy.ShouldNotBeNull(); + var baseVersion = strategy.GetBaseVersions(effectiveBranchConfiguration).Single(); baseVersion.SemanticVersion.ToString().ShouldBe(expectedBaseVersion); } - [TestCase("hotfix-2.0.0")] - [TestCase("hotfix/2.0.0")] + [TestCase("origin/hotfix-2.0.0")] + [TestCase("remotes/origin/hotfix-2.0.0")] + [TestCase("origin/hotfix/2.0.0")] + [TestCase("remotes/origin/hotfix/2.0.0")] [TestCase("custom/JIRA-123")] + [TestCase("remotes/custom/JIRA-123")] [TestCase("hotfix/downgrade-to-gitversion-3.6.5-to-fix-miscalculated-version")] + [TestCase("remotes/hotfix/downgrade-to-gitversion-3.6.5-to-fix-miscalculated-version")] public void ShouldNotTakeVersionFromNameOfNonReleaseBranch(string branchName) { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.CreateBranch(branchName); - var gitRepository = fixture.Repository.ToGitRepository(); - var strategy = GetVersionStrategy(fixture.RepositoryPath, gitRepository, branchName); - var configuration = TestConfigurationBuilder.New.Build(); - var branchConfiguration = configuration.GetBranchConfiguration(branchName); - var effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); - var baseVersions = strategy.GetBaseVersions(new(gitRepository.FindBranch(branchName)!, effectiveConfiguration)); + fixture.MakeACommit(); + fixture.CreateBranch(branchName); + + var repository = fixture.Repository.ToGitRepository(); + + var strategy = GetVersionStrategy(repository); + var branch = repository.FindBranch(branchName); + + var configuration = GitFlowConfigurationBuilder.New.Build(); + var effectiveBranchConfiguration = configuration.GetEffectiveBranchConfiguration(branch); + + strategy.ShouldNotBeNull(); + var baseVersions = strategy.GetBaseVersions(effectiveBranchConfiguration); baseVersions.ShouldBeEmpty(); } - [TestCase("support/lts-2.0.0", "2.0.0")] + [TestCase("release-2.0.0", "2.0.0")] + [TestCase("release/3.0.0", "3.0.0")] + [TestCase("support/2.0.0-lts", "2.0.0")] [TestCase("support-3.0.0-lts", "3.0.0")] + [TestCase("hotfix/2.0.0", "2.0.0")] + [TestCase("hotfix-3.0.0", "3.0.0")] + [TestCase("hotfix/2.0.0-lts", "2.0.0")] + [TestCase("hotfix-3.0.0-lts", "3.0.0")] public void CanTakeVersionFromNameOfConfiguredReleaseBranch(string branchName, string expectedBaseVersion) { using var fixture = new EmptyRepositoryFixture(); - fixture.Repository.MakeACommit(); - fixture.Repository.CreateBranch(branchName); - var config = new ConfigurationBuilder() - .Add(new Config { Branches = { { "support", new BranchConfig { IsReleaseBranch = true } } } }) + fixture.MakeACommit(); + fixture.CreateBranch(branchName); + + var repository = fixture.Repository.ToGitRepository(); + + var configuration = GitFlowConfigurationBuilder.New + .WithBranch("support", builder => builder.WithIsReleaseBranch(true)) .Build(); + ConfigurationHelper configurationHelper = new(configuration); + + var strategy = GetVersionStrategy(repository, null, configurationHelper.Dictionary); + var branch = repository.FindBranch(branchName); - var gitRepository = fixture.Repository.ToGitRepository(); - var strategy = GetVersionStrategy(fixture.RepositoryPath, gitRepository, branchName, config); + var effectiveBranchConfiguration = configuration.GetEffectiveBranchConfiguration(branch); - var configuration = TestConfigurationBuilder.New.Build(); - var branchConfiguration = configuration.GetBranchConfiguration(branchName); - var effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); - var baseVersion = strategy.GetBaseVersions(new(gitRepository.FindBranch(branchName)!, effectiveConfiguration)).Single(); + strategy.ShouldNotBeNull(); + var baseVersion = strategy.GetBaseVersions(effectiveBranchConfiguration).Single(); baseVersion.SemanticVersion.ToString().ShouldBe(expectedBaseVersion); } - [TestCase("release-2.0.0", "2.0.0")] - [TestCase("release/3.0.0", "3.0.0")] - public void CanTakeVersionFromNameOfRemoteReleaseBranch(string branchName, string expectedBaseVersion) + [TestCase("origin", "release-2.0.0", "2.0.0")] + [TestCase("origin", "release/3.0.0", "3.0.0")] + public void CanTakeVersionFromNameOfRemoteReleaseBranch(string origin, string branchName, string expectedBaseVersion) { using var fixture = new RemoteRepositoryFixture(); - var branch = fixture.Repository.CreateBranch(branchName); - Commands.Checkout(fixture.Repository, branch); - fixture.MakeACommit(); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); - fixture.LocalRepositoryFixture.Checkout($"origin/{branchName}"); + fixture.CreateBranch(branchName); + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); + fixture.LocalRepositoryFixture.Fetch(origin); + + var localRepository = fixture.LocalRepositoryFixture.Repository.ToGitRepository(); + + var strategy = GetVersionStrategy(localRepository); + var branch = localRepository.FindBranch(branchName); - var gitRepository = fixture.Repository.ToGitRepository(); - var strategy = GetVersionStrategy(fixture.RepositoryPath, gitRepository, branchName); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var effectiveBranchConfiguration = configuration.GetEffectiveBranchConfiguration(branch); - var configuration = TestConfigurationBuilder.New.Build(); - var branchConfiguration = configuration.GetBranchConfiguration(branchName); - var effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); - var baseVersion = strategy.GetBaseVersions(new(gitRepository.FindBranch(branchName)!, effectiveConfiguration)).Single(); + strategy.ShouldNotBeNull(); + var baseVersion = strategy.GetBaseVersions(effectiveBranchConfiguration).Single(); baseVersion.SemanticVersion.ToString().ShouldBe(expectedBaseVersion); } - private static IVersionStrategy GetVersionStrategy(string workingDirectory, IGitRepository repository, string branch, Config? config = null) + private static IVersionStrategy GetVersionStrategy(IGitRepository repository, + string? targetBranch = null, IReadOnlyDictionary? overrideConfiguration = null) { - var sp = BuildServiceProvider(workingDirectory, repository, branch, config); - return sp.GetServiceForType(); + var serviceProvider = BuildServiceProvider(repository, targetBranch, overrideConfiguration); + return serviceProvider.GetServiceForType(); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/TestBaseVersionCalculator.cs b/src/GitVersion.Core.Tests/VersionCalculation/TestBaseVersionCalculator.cs deleted file mode 100644 index 467f899b8d..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/TestBaseVersionCalculator.cs +++ /dev/null @@ -1,22 +0,0 @@ -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Core.Tests.VersionCalculation; - -public class TestBaseVersionCalculator : IBaseVersionCalculator -{ - private readonly SemanticVersion semanticVersion; - private readonly bool shouldIncrement; - private readonly ICommit source; - private readonly EffectiveBranchConfiguration configuration; - - public TestBaseVersionCalculator(bool shouldIncrement, SemanticVersion semanticVersion, ICommit source, EffectiveBranchConfiguration configuration) - { - this.semanticVersion = semanticVersion; - this.source = source; - this.shouldIncrement = shouldIncrement; - this.configuration = configuration; - } - - public (BaseVersion, EffectiveBranchConfiguration) GetBaseVersion() => new(new("Test source", this.shouldIncrement, this.semanticVersion, this.source, null), this.configuration); -} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/TestMainlineVersionCalculator.cs b/src/GitVersion.Core.Tests/VersionCalculation/TestMainlineVersionCalculator.cs deleted file mode 100644 index aa69a47ab4..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/TestMainlineVersionCalculator.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GitVersion.VersionCalculation; - -namespace GitVersion.Core.Tests.VersionCalculation; - -public class TestMainlineVersionCalculator : IMainlineVersionCalculator -{ - private readonly SemanticVersionBuildMetaData metaData; - - public TestMainlineVersionCalculator(SemanticVersionBuildMetaData metaData) => this.metaData = metaData; - - public SemanticVersion FindMainlineModeVersion(BaseVersion baseVersion) => throw new NotImplementedException(); - - public SemanticVersionBuildMetaData CreateVersionBuildMetaData(ICommit? baseVersionSource) => this.metaData; -} diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs index 60b393e942..cc27fb1b24 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs @@ -1,9 +1,10 @@ +using System.Globalization; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; +using GitVersion.Git; using GitVersion.Logging; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -18,7 +19,7 @@ public void Setup() { ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - this.logMessages = new List(); + this.logMessages = []; var sp = ConfigureServices(services => { @@ -30,277 +31,288 @@ public void Setup() } [Test] - public void ShouldLogWarningWhenUsingDefaultInformationalVersionInCustomFormat() + public void ProvidesVariablesInContinuousDeliveryModeForPreRelease() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, - Patch = 3 + Patch = 3, + PreReleaseTag = "unstable.4", + BuildMetaData = new("5.Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; -#pragma warning disable CS0618 // Type or member is obsolete - const string propertyName = nameof(SemanticVersionFormatValues.DefaultInformationalVersion); -#pragma warning restore CS0618 // Type or member is obsolete - var config = new TestEffectiveConfiguration(assemblyInformationalFormat: $"{{{propertyName}}}"); - this.variableProvider.GetVariablesFor(semVer, config, false); - this.logMessages.ShouldContain(message => message.Trim().StartsWith("WARN") && message.Contains(propertyName), 1, $"Expected a warning to be logged when using the variable {propertyName} in a configuration format template"); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("unstable")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); + + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeliveryModeForPreRelease() + public void ProvidesVariablesInContinuousDeploymentModeForPreRelease() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - PreReleaseTag = "unstable.4", - BuildMetaData = "5.Branch.develop" + PreReleaseTag = new("unstable", 8, true), + BuildMetaData = new("Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitsSinceVersionSource = 5, + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("unstable")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - var config = new TestEffectiveConfiguration(); - - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); - - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding() + public void ProvidesVariablesInContinuousDeliveryModeForStable() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - PreReleaseTag = "unstable.4", - BuildMetaData = "5.Branch.develop" + BuildMetaData = new("5.Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - var config = new TestEffectiveConfiguration(buildMetaDataPadding: 2, legacySemVerPadding: 5); - - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); - - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeploymentModeForPreRelease() + public void ProvidesVariablesInContinuousDeploymentModeForStable() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - PreReleaseTag = "unstable.4", - BuildMetaData = "5.Branch.develop" + PreReleaseTag = new("ci", 5, true), + BuildMetaData = new("Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitsSinceVersionSource = 5, + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment); - - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeliveryModeForStable() + public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.develop" + BuildMetaData = new() + { + VersionSourceSha = "versionSourceSha", + CommitsSinceTag = 5, + CommitsSinceVersionSource = 5, + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - var config = new TestEffectiveConfiguration(); + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); - - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeploymentModeForStable() + public void ProvidesVariablesInContinuousDeploymentModeWithTagNamePattern() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.develop" + PreReleaseTag = new("PullRequest2", 5, true), + BuildMetaData = new("Branch.develop") + { + Branch = "pull/2/merge", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("pull-request")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); - - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.FullSemVer.ShouldBe("1.2.3-PullRequest2.5"); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged() + public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToBranchName() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = new SemanticVersionBuildMetaData + PreReleaseTag = new("feature", 5, true), + BuildMetaData = new("Branch.develop") { - VersionSourceSha = "versionSourceSha", - CommitsSinceTag = 5, - CommitsSinceVersionSource = 5, + Branch = "feature", Sha = "commitSha", ShortSha = "commitShortSha", CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") } }; - var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - var vars = this.variableProvider.GetVariablesFor(semVer, config, true); - - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.FullSemVer.ShouldBe("1.2.3-feature.5"); } [Test] - public void ProvidesVariablesInContinuousDeploymentModeWithTagNamePattern() + public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - PreReleaseTag = "PullRequest", - BuildMetaData = "5.Branch.develop" + BuildMetaData = new("5.Branch.feature/123") + { + Branch = "feature/123", + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.Branch = "pull/2/merge"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, tagNumberPattern: @"[/-](?\d+)[-/]"); - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - vars.FullSemVer.ShouldBe("1.2.3-PullRequest0002.5"); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToUseBranchName() + public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.develop" + BuildMetaData = new("5.Branch.feature/123") + { + Branch = "feature/123", + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.Branch = "feature"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - var config = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, tag: "useBranchName"); - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0) + .WithAssemblyInformationalFormat("{Major}.{Minor}.{Patch}+{CommitsSinceVersionSource}.Branch.{BranchName}.Sha.{ShortSha}") + .Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - vars.FullSemVer.ShouldBe("1.2.3-feature.5"); + variables.ToJson().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() + public void ProvidesVariablesInContinuousDeploymentModeForMainBranchWithEmptyLabel() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.feature/123" + PreReleaseTag = new(string.Empty, 9, true), + BuildMetaData = new("Branch.main") + { + Branch = "main", + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitsSinceVersionSource = 5, + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") + } }; - semVer.BuildMetaData.Branch = "feature/123"; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - - var config = new TestEffectiveConfiguration(); - - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); + var configuration = GitFlowConfigurationBuilder.New.Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("main")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJson().ShouldMatchApproved(x => x.SubFolder("Approved")); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat() + public void Format_Allows_CSharp_FormatStrings() { - var semVer = new SemanticVersion + var semanticVersion = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.feature/123" + PreReleaseTag = new(string.Empty, 9, true), + BuildMetaData = new("Branch.main") + { + Branch = "main", + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitsSinceVersionSource = 42, + CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z", CultureInfo.InvariantCulture) + } }; - semVer.BuildMetaData.Branch = "feature/123"; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - - - var config = new TestEffectiveConfiguration(assemblyInformationalFormat: "{Major}.{Minor}.{Patch}+{CommitsSinceVersionSource}.Branch.{BranchName}.Sha.{ShortSha}"); - - var vars = this.variableProvider.GetVariablesFor(semVer, config, false); + var configuration = GitFlowConfigurationBuilder.New + .WithTagPreReleaseWeight(0) + .WithAssemblyInformationalFormat("{Major}.{Minor}.{Patch}-{CommitsSinceVersionSource:0000}") + .Build(); + var preReleaseWeight = configuration.GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")).PreReleaseWeight; + var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, preReleaseWeight); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.InformationalVersion.ShouldBe("1.2.3-0042"); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VersionSourceTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VersionSourceTests.cs index 0434ab6fda..f4618e6d40 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VersionSourceTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VersionSourceTests.cs @@ -1,10 +1,7 @@ -using GitTools.Testing; using GitVersion.Core.Tests.Helpers; +using GitVersion.Git; using GitVersion.VersionCalculation; -using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -15,61 +12,58 @@ public class VersionSourceTests : TestBase public void VersionSourceSha() { using var fixture = new EmptyRepositoryFixture(); - var initialCommit = fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - _ = fixture.Repository.MakeACommit(); - var featureBranch = fixture.Repository.CreateBranch("feature/foo"); - Commands.Checkout(fixture.Repository, featureBranch); - _ = fixture.Repository.MakeACommit(); - var nextVersionCalculator = GetNextVersionCalculator(fixture); + fixture.MakeACommit(); + fixture.BranchTo("develop"); + fixture.MakeACommit(); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit(); - var nextVersion = nextVersionCalculator.FindVersion(); + var nextVersionCalculator = GetNextVersionCalculator(fixture.Repository.ToGitRepository()); - nextVersion.IncrementedVersion.BuildMetaData.ShouldNotBeNull(); - nextVersion.IncrementedVersion.BuildMetaData.VersionSourceSha.ShouldBe(initialCommit.Sha); - nextVersion.IncrementedVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(2); + var semanticVersion = nextVersionCalculator.FindVersion(); + + semanticVersion.BuildMetaData.VersionSourceSha.ShouldBeNull(); + semanticVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(3); } [Test] public void VersionSourceShaOneCommit() { using var fixture = new EmptyRepositoryFixture(); - var initialCommit = fixture.Repository.MakeACommit(); - var nextVersionCalculator = GetNextVersionCalculator(fixture); + fixture.MakeACommit(); + + var nextVersionCalculator = GetNextVersionCalculator(fixture.Repository.ToGitRepository()); - var nextVersion = nextVersionCalculator.FindVersion(); + var semanticVersion = nextVersionCalculator.FindVersion(); - nextVersion.IncrementedVersion.BuildMetaData.ShouldNotBeNull(); - nextVersion.IncrementedVersion.BuildMetaData.VersionSourceSha.ShouldBe(initialCommit.Sha); - nextVersion.IncrementedVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(0); + semanticVersion.BuildMetaData.VersionSourceSha.ShouldBeNull(); + semanticVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(1); } [Test] public void VersionSourceShaUsingTag() { using var fixture = new EmptyRepositoryFixture(); - _ = fixture.Repository.MakeACommit(); - Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); - var secondCommit = fixture.Repository.MakeACommit(); - _ = fixture.Repository.Tags.Add("1.0", secondCommit); - var featureBranch = fixture.Repository.CreateBranch("feature/foo"); - Commands.Checkout(fixture.Repository, featureBranch); - _ = fixture.Repository.MakeACommit(); - var nextVersionCalculator = GetNextVersionCalculator(fixture); + fixture.MakeACommit(); + fixture.BranchTo("develop"); + var secondCommitSha = fixture.MakeATaggedCommit("1.0.0"); + fixture.BranchTo("feature/foo"); + fixture.MakeACommit(); + + var nextVersionCalculator = GetNextVersionCalculator(fixture.Repository.ToGitRepository()); - var nextVersion = nextVersionCalculator.FindVersion(); + var semanticVersion = nextVersionCalculator.FindVersion(); - nextVersion.IncrementedVersion.BuildMetaData.ShouldNotBeNull(); - nextVersion.IncrementedVersion.BuildMetaData.VersionSourceSha.ShouldBe(secondCommit.Sha); - nextVersion.IncrementedVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(1); + semanticVersion.BuildMetaData.VersionSourceSha.ShouldBe(secondCommitSha); + semanticVersion.BuildMetaData.CommitsSinceVersionSource.ShouldBe(1); } - private static INextVersionCalculator GetNextVersionCalculator(RepositoryFixtureBase fixture) + private static INextVersionCalculator GetNextVersionCalculator(IGitRepository repository) { - var sp = BuildServiceProvider(fixture.RepositoryPath, fixture.Repository.ToGitRepository(), fixture.Repository.Head.CanonicalName); - return sp.GetRequiredService(); + var serviceProvider = BuildServiceProvider(repository); + return serviceProvider.GetRequiredService(); } } diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt deleted file mode 100644 index 81e95850b7..0000000000 --- a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ /dev/null @@ -1,64 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// GitVersion -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 -namespace System.Diagnostics.CodeAnalysis -{ - [global::System.AttributeUsage( - global::System.AttributeTargets.Assembly | - global::System.AttributeTargets.Class | - global::System.AttributeTargets.Struct | - global::System.AttributeTargets.Constructor | - global::System.AttributeTargets.Method | - global::System.AttributeTargets.Property | - global::System.AttributeTargets.Event, - Inherited = false, AllowMultiple = false)] - internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute { } -} -#endif - -[global::System.Runtime.CompilerServices.CompilerGenerated] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -static class GitVersionInformation -{ - public static string Major = "1"; - public static string Minor = "2"; - public static string Patch = "3"; - public static string PreReleaseTag = "unstable.4"; - public static string PreReleaseTagWithDash = "-unstable.4"; - public static string PreReleaseLabel = "unstable"; - public static string PreReleaseLabelWithDash = "-unstable"; - public static string PreReleaseNumber = "4"; - public static string WeightedPreReleaseNumber = "4"; - public static string BuildMetaData = "5"; - public static string BuildMetaDataPadded = "0005"; - public static string FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"; - public static string MajorMinorPatch = "1.2.3"; - public static string SemVer = "1.2.3-unstable.4"; - public static string LegacySemVer = "1.2.3-unstable4"; - public static string LegacySemVerPadded = "1.2.3-unstable0004"; - public static string AssemblySemVer = "1.2.3.0"; - public static string AssemblySemFileVer = "1.2.3.0"; - public static string FullSemVer = "1.2.3-unstable.4+5"; - public static string InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"; - public static string BranchName = "feature1"; - public static string EscapedBranchName = "feature1"; - public static string Sha = "commitSha"; - public static string ShortSha = "commitShortSha"; - public static string NuGetVersionV2 = "1.2.3-unstable0004"; - public static string NuGetVersion = "1.2.3-unstable0004"; - public static string NuGetPreReleaseTagV2 = "unstable0004"; - public static string NuGetPreReleaseTag = "unstable0004"; - public static string VersionSourceSha = "versionSourceSha"; - public static string CommitsSinceVersionSource = "5"; - public static string CommitsSinceVersionSourcePadded = "0005"; - public static string UncommittedChanges = "0"; - public static string CommitDate = "2014-03-06"; -} diff --git a/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs b/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs deleted file mode 100644 index 7237646c87..0000000000 --- a/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs +++ /dev/null @@ -1,51 +0,0 @@ -using GitVersion.Core.Tests.Helpers; -using GitVersion.Helpers; -using GitVersion.VersionCalculation; -using GitVersion.VersionConverters.GitVersionInfo; -using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests; - -[TestFixture] -[Parallelizable(ParallelScope.None)] -public class GitVersionInfoGeneratorTests : TestBase -{ - [SetUp] - public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - - [TestCase("cs")] - [TestCase("fs")] - [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void ShouldCreateFile(string fileExtension) - { - var directory = Path.GetTempPath(); - var fileName = "GitVersionInformation.g." + fileExtension; - var fullPath = PathHelper.Combine(directory, fileName); - - var semanticVersion = new SemanticVersion - { - Major = 1, - Minor = 2, - Patch = 3, - PreReleaseTag = "unstable4", - BuildMetaData = new SemanticVersionBuildMetaData("versionSourceSha", 5, - "feature1", "commitSha", "commitShortSha", DateTimeOffset.Parse("2014-03-06 23:59:59Z"), 0) - }; - - var sp = ConfigureServices(); - - var fileSystem = sp.GetRequiredService(); - var variableProvider = sp.GetRequiredService(); - - var variables = variableProvider.GetVariablesFor(semanticVersion, new TestEffectiveConfiguration(), false); - using var generator = sp.GetRequiredService(); - - generator.Execute(variables, new GitVersionInfoContext(directory, fileName, fileExtension)); - - fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); - } -} diff --git a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs deleted file mode 100644 index 39437b5365..0000000000 --- a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs +++ /dev/null @@ -1,331 +0,0 @@ -using System.Xml.Linq; -using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.OutputVariables; -using GitVersion.VersionCalculation; -using GitVersion.VersionConverters.AssemblyInfo; -using Microsoft.Extensions.DependencyInjection; -using NSubstitute; -using NUnit.Framework; -using Shouldly; - -namespace GitVersion.Core.Tests; - -[TestFixture] -[Parallelizable(ParallelScope.None)] -public class ProjectFileUpdaterTests : TestBase -{ - private IVariableProvider variableProvider; - private ILog log; - private IFileSystem fileSystem; - private IProjectFileUpdater projectFileUpdater; - private List logMessages; - - [SetUp] - public void Setup() - { - ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); - var sp = ConfigureServices(); - - this.logMessages = new List(); - this.log = new Log(new TestLogAppender(this.logMessages.Add)); - - this.fileSystem = sp.GetRequiredService(); - this.variableProvider = sp.GetRequiredService(); - this.projectFileUpdater = new ProjectFileUpdater(this.log, this.fileSystem); - } - - [Category(NoMono)] - [Description(NoMonoDescription)] - [TestCase("Microsoft.NET.Sdk")] - [TestCase("Microsoft.NET.Sdk.Worker")] - [TestCase("Microsoft.NET.Sdk.Web")] - [TestCase("Microsoft.NET.Sdk.WindowsDesktop")] - [TestCase("Microsoft.NET.Sdk.Razor")] - [TestCase("Microsoft.NET.Sdk.BlazorWebAssembly")] - public void CanUpdateProjectFileWithSdkProjectFileXml(string sdk) - { - var xml = $@" - - - Exe - netcoreapp3.1 - - -"; - var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); - - canUpdate.ShouldBe(true); - logMessages.ShouldBeEmpty(); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - - -")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CannotUpdateProjectFileWithIncorrectProjectSdk(string xml) - { - var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); - - canUpdate.ShouldBe(false); - - logMessages.ShouldNotBeEmpty(); - logMessages.Count.ShouldBe(1); - logMessages.First().ShouldContain("Specified project file Sdk (SomeOtherProject.Sdk) is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk'"); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - - -")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CannotUpdateProjectFileWithMissingProjectSdk(string xml) - { - var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); - - canUpdate.ShouldBe(false); - - logMessages.ShouldNotBeEmpty(); - logMessages.Count.ShouldBe(1); - logMessages.First().ShouldContain("Specified project file Sdk () is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk'"); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - false - - -")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CannotUpdateProjectFileWithoutAssemblyInfoGeneration(string xml) - { - var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); - - canUpdate.ShouldBe(false); - - logMessages.ShouldNotBeEmpty(); - logMessages.Count.ShouldBe(1); - logMessages.First().ShouldContain("Project file specifies false: versions set in this project file will not affect the output artifacts"); - } - - [TestCase(@" - - -")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) - { - var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); - - canUpdate.ShouldBe(false); - - logMessages.ShouldNotBeEmpty(); - logMessages.Count.ShouldBe(1); - logMessages.First().ShouldContain("Unable to locate any elements in specified project file. Are you sure it is in a correct format?"); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - -" - )] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) - { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); - var xmlRoot = XElement.Parse(xml); - variables.AssemblySemVer.ShouldNotBeNull(); - ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); - - var expectedXml = XElement.Parse(@" - - - Exe - netcoreapp3.1 - 2.0.0.0 - -"); - xmlRoot.ToString().ShouldBe(expectedXml.ToString()); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - 1.0.0.0 - -" - )] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) - { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); - var xmlRoot = XElement.Parse(xml); - variables.AssemblySemVer.ShouldNotBeNull(); - ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); - - var expectedXml = XElement.Parse(@" - - - Exe - netcoreapp3.1 - 2.0.0.0 - -"); - xmlRoot.ToString().ShouldBe(expectedXml.ToString()); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - 1.0.0.0 - - - 1.0.0.0 - -" - )] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) - { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); - var xmlRoot = XElement.Parse(xml); - variables.AssemblySemVer.ShouldNotBeNull(); - ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); - - var expectedXml = XElement.Parse(@" - - - Exe - netcoreapp3.1 - 1.0.0.0 - - - 2.0.0.0 - -"); - xmlRoot.ToString().ShouldBe(expectedXml.ToString()); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - 1.0.0.0 - 1.0.0.0 - -" - )] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) - { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); - var xmlRoot = XElement.Parse(xml); - variables.AssemblySemVer.ShouldNotBeNull(); - ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); - - var expectedXml = XElement.Parse(@" - - - Exe - netcoreapp3.1 - 1.0.0.0 - 2.0.0.0 - -"); - xmlRoot.ToString().ShouldBe(expectedXml.ToString()); - } - - [TestCase(@" - - - Exe - netcoreapp3.1 - -")] - [Category(NoMono)] - [Description(NoMonoDescription)] - public void UpdateProjectFileAddsVersionToFile(string xml) - { - var fileName = PathHelper.Combine(Path.GetTempPath(), "TestProject.csproj"); - - VerifyAssemblyInfoFile(xml, fileName, AssemblyVersioningScheme.MajorMinorPatch, (fs, variables) => - { - using var projFileUpdater = new ProjectFileUpdater(this.log, fs); - projFileUpdater.Execute(variables, new AssemblyInfoContext(Path.GetTempPath(), false, fileName)); - - const string expectedXml = @" - - - Exe - netcoreapp3.1 - 2.3.1.0 - 2.3.1.0 - 2.3.1+3.Branch.foo.Sha.hash - 2.3.1 - -"; - var transformedXml = fs.ReadAllText(fileName); - transformedXml.ShouldBe(XElement.Parse(expectedXml).ToString()); - }); - } - - private void VerifyAssemblyInfoFile( - string projectFileContent, - string fileName, - AssemblyVersioningScheme versioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - Action? verify = null) - { - this.fileSystem = Substitute.For(); - var version = new SemanticVersion - { - BuildMetaData = new SemanticVersionBuildMetaData("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), - Major = 2, - Minor = 3, - Patch = 1 - }; - - this.fileSystem.Exists(fileName).Returns(true); - this.fileSystem.ReadAllText(fileName).Returns(projectFileContent); - this.fileSystem.When(f => f.WriteAllText(fileName, Arg.Any())).Do(c => - { - projectFileContent = c.ArgAt(1); - this.fileSystem.ReadAllText(fileName).Returns(projectFileContent); - }); - - var config = new TestEffectiveConfiguration(versioningScheme); - var variables = this.variableProvider.GetVariablesFor(version, config, false); - - verify?.Invoke(this.fileSystem, variables); - } -} diff --git a/src/GitVersion.Core/Agents/BuildAgentBase.cs b/src/GitVersion.Core/Agents/BuildAgentBase.cs new file mode 100644 index 0000000000..776e1f4efc --- /dev/null +++ b/src/GitVersion.Core/Agents/BuildAgentBase.cs @@ -0,0 +1,53 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal abstract class BuildAgentBase(IEnvironment environment, ILog log, IFileSystem fileSystem) : ICurrentBuildAgent +{ + protected readonly ILog Log = log.NotNull(); + protected readonly IEnvironment Environment = environment.NotNull(); + protected readonly IFileSystem FileSystem = fileSystem.NotNull(); + + protected abstract string EnvironmentVariable { get; } + + public abstract string? SetBuildNumber(GitVersionVariables variables); + public abstract string[] SetOutputVariables(string name, string? value); + + public virtual bool CanApplyToCurrentContext() => !Environment.GetEnvironmentVariable(EnvironmentVariable).IsNullOrEmpty(); + + public virtual string? GetCurrentBranch(bool usingDynamicRepos) => null; + + public virtual bool IsDefault => false; + public virtual bool PreventFetch() => true; + public virtual bool ShouldCleanUpRemotes() => false; + + public virtual void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) + { + if (updateBuildNumber) + { + writer($"Set Build Number for '{GetType().Name}'."); + writer(SetBuildNumber(variables)); + } + + writer($"Set Output Variables for '{GetType().Name}'."); + foreach (var buildParameter in SetOutputVariables(variables)) + { + writer(buildParameter); + } + } + + protected IEnumerable SetOutputVariables(GitVersionVariables variables) + { + var output = new List(); + + foreach (var (key, value) in variables) + { + output.AddRange(SetOutputVariables(key, value)); + } + + return output; + } +} diff --git a/src/GitVersion.Core/BuildAgents/BuildAgentResolver.cs b/src/GitVersion.Core/Agents/BuildAgentResolver.cs similarity index 53% rename from src/GitVersion.Core/BuildAgents/BuildAgentResolver.cs rename to src/GitVersion.Core/Agents/BuildAgentResolver.cs index 9b90e7076c..3858e805c9 100644 --- a/src/GitVersion.Core/BuildAgents/BuildAgentResolver.cs +++ b/src/GitVersion.Core/Agents/BuildAgentResolver.cs @@ -1,27 +1,20 @@ using GitVersion.Extensions; using GitVersion.Logging; -namespace GitVersion.BuildAgents; +namespace GitVersion.Agents; -public class BuildAgentResolver : IBuildAgentResolver +internal class BuildAgentResolver(IEnumerable buildAgents, ILog log) : IBuildAgentResolver { - private readonly IEnumerable buildAgents; - private readonly ILog log; - public BuildAgentResolver(IEnumerable buildAgents, ILog log) - { - this.log = log.NotNull(); - this.buildAgents = buildAgents; - } + private readonly ILog log = log.NotNull(); public ICurrentBuildAgent Resolve() => new Lazy(ResolveInternal).Value; private ICurrentBuildAgent ResolveInternal() { - ICurrentBuildAgent instance = (ICurrentBuildAgent)this.buildAgents.Single(x => x is LocalBuild); + var instance = (ICurrentBuildAgent)buildAgents.Single(x => x.IsDefault); - foreach (var buildAgent in this.buildAgents.Where(x => x is not LocalBuild)) + foreach (var buildAgent in buildAgents.Where(x => !x.IsDefault)) { - var agentName = buildAgent.GetType().Name; try { if (!buildAgent.CanApplyToCurrentContext()) continue; @@ -29,6 +22,7 @@ private ICurrentBuildAgent ResolveInternal() } catch (Exception ex) { + var agentName = buildAgent.GetType().Name; this.log.Warning($"Failed to check build agent '{agentName}': {ex.Message}"); } } diff --git a/src/GitVersion.Core/Agents/IBuildAgent.cs b/src/GitVersion.Core/Agents/IBuildAgent.cs new file mode 100644 index 0000000000..b6f7b36725 --- /dev/null +++ b/src/GitVersion.Core/Agents/IBuildAgent.cs @@ -0,0 +1,17 @@ +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +public interface IBuildAgent +{ + bool IsDefault { get; } + + bool CanApplyToCurrentContext(); + string? GetCurrentBranch(bool usingDynamicRepos); + bool PreventFetch(); + bool ShouldCleanUpRemotes(); + + void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true); +} + +public interface ICurrentBuildAgent : IBuildAgent; diff --git a/src/GitVersion.Core/Agents/IBuildAgentResolver.cs b/src/GitVersion.Core/Agents/IBuildAgentResolver.cs new file mode 100644 index 0000000000..650b72033f --- /dev/null +++ b/src/GitVersion.Core/Agents/IBuildAgentResolver.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Agents; + +internal interface IBuildAgentResolver +{ + ICurrentBuildAgent Resolve(); +} diff --git a/src/GitVersion.Core/Agents/LocalBuild.cs b/src/GitVersion.Core/Agents/LocalBuild.cs new file mode 100644 index 0000000000..be7a1e1c5f --- /dev/null +++ b/src/GitVersion.Core/Agents/LocalBuild.cs @@ -0,0 +1,15 @@ +using System.IO.Abstractions; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Agents; + +internal class LocalBuild(IEnvironment environment, ILog log, IFileSystem fileSystem) : BuildAgentBase(environment, log, fileSystem) +{ + public override bool IsDefault => true; + + protected override string EnvironmentVariable => string.Empty; + public override bool CanApplyToCurrentContext() => true; + public override string? SetBuildNumber(GitVersionVariables variables) => null; + public override string[] SetOutputVariables(string name, string? value) => []; +} diff --git a/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgent.cs b/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgent.cs deleted file mode 100644 index 6a81aaafe2..0000000000 --- a/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgent.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public interface IBuildAgent -{ - bool CanApplyToCurrentContext(); - void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true); - string? GetCurrentBranch(bool usingDynamicRepos); - bool PreventFetch(); - bool ShouldCleanUpRemotes(); -} - -public interface ICurrentBuildAgent : IBuildAgent { } diff --git a/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgentResolver.cs b/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgentResolver.cs deleted file mode 100644 index 8338985d03..0000000000 --- a/src/GitVersion.Core/BuildAgents/Abstractions/IBuildAgentResolver.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitVersion.BuildAgents; - -public interface IBuildAgentResolver -{ - ICurrentBuildAgent Resolve(); -} diff --git a/src/GitVersion.Core/BuildAgents/AzurePipelines.cs b/src/GitVersion.Core/BuildAgents/AzurePipelines.cs deleted file mode 100644 index 30e08ee059..0000000000 --- a/src/GitVersion.Core/BuildAgents/AzurePipelines.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class AzurePipelines : BuildAgentBase -{ - public AzurePipelines(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "TF_BUILD"; - - protected override string EnvironmentVariable => EnvironmentVariableName; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"##vso[task.setvariable variable=GitVersion.{name}]{value}", - $"##vso[task.setvariable variable=GitVersion.{name};isOutput=true]{value}" - }; - - public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"); - - public override bool PreventFetch() => true; - - public override string GenerateSetVersionMessage(VersionVariables variables) - { - // For AzurePipelines, we'll get the Build Number and insert GitVersion variables where - // specified - var buildNumberEnv = Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER"); - if (buildNumberEnv.IsNullOrWhiteSpace()) - return variables.FullSemVer; - - var newBuildNumber = variables.Aggregate(buildNumberEnv, ReplaceVariables); - - // If no variable substitution has happened, use FullSemVer - if (buildNumberEnv == newBuildNumber) - { - var buildNumber = variables.FullSemVer.EndsWith("+0") - ? variables.FullSemVer.Substring(0, variables.FullSemVer.Length - 2) - : variables.FullSemVer; - - return $"##vso[build.updatebuildnumber]{buildNumber}"; - } - - return $"##vso[build.updatebuildnumber]{newBuildNumber}"; - } - - private static string ReplaceVariables(string buildNumberEnv, KeyValuePair variable) - { - var pattern = $@"\$\(GITVERSION[_\.]{variable.Key}\)"; - var replacement = variable.Value ?? string.Empty; - return buildNumberEnv.RegexReplace(pattern, replacement, RegexOptions.IgnoreCase); - } -} diff --git a/src/GitVersion.Core/BuildAgents/BitBucketPipelines.cs b/src/GitVersion.Core/BuildAgents/BitBucketPipelines.cs deleted file mode 100644 index ae58d7f1fc..0000000000 --- a/src/GitVersion.Core/BuildAgents/BitBucketPipelines.cs +++ /dev/null @@ -1,65 +0,0 @@ -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class BitBucketPipelines : BuildAgentBase -{ - public const string EnvironmentVariableName = "BITBUCKET_WORKSPACE"; - public const string BranchEnvironmentVariableName = "BITBUCKET_BRANCH"; - public const string TagEnvironmentVariableName = "BITBUCKET_TAG"; - public const string PullRequestEnvironmentVariableName = "BITBUCKET_PR_ID"; - private string? file; - - public BitBucketPipelines(IEnvironment environment, ILog log) : base(environment, log) => WithPropertyFile("gitversion.properties"); - - protected override string EnvironmentVariable => EnvironmentVariableName; - - public override string? GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; - - public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"GITVERSION_{name.ToUpperInvariant()}={value}" - }; - - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) - { - if (this.file is null) - return; - - base.WriteIntegration(writer, variables, updateBuildNumber); - writer($"Outputting variables to '{this.file}' ... "); - writer("To import the file into your build environment, add the following line to your build step:"); - writer($" - source {this.file}"); - writer(""); - writer("To reuse the file across build steps, add the file as a build artifact:"); - writer(" artifacts:"); - writer($" - {this.file}"); - - var exports = variables - .Select(variable => $"export GITVERSION_{variable.Key.ToUpperInvariant()}={variable.Value}") - .ToList(); - - File.WriteAllLines(this.file, exports); - } - - public override string? GetCurrentBranch(bool usingDynamicRepos) - { - var branchName = EvaluateEnvironmentVariable(BranchEnvironmentVariableName); - if (branchName != null && branchName.StartsWith("refs/heads/")) - { - return branchName; - } - - return null; - } - - private string? EvaluateEnvironmentVariable(string variableName) - { - var branchName = Environment.GetEnvironmentVariable(variableName); - Log.Info("Evaluating environment variable {0} : {1}", variableName, branchName!); - return branchName; - } -} diff --git a/src/GitVersion.Core/BuildAgents/BuildAgentBase.cs b/src/GitVersion.Core/BuildAgents/BuildAgentBase.cs deleted file mode 100644 index f47c63ce36..0000000000 --- a/src/GitVersion.Core/BuildAgents/BuildAgentBase.cs +++ /dev/null @@ -1,55 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public abstract class BuildAgentBase : ICurrentBuildAgent -{ - protected readonly ILog Log; - protected IEnvironment Environment { get; } - - protected BuildAgentBase(IEnvironment environment, ILog log) - { - this.Log = log; - Environment = environment; - } - - protected abstract string EnvironmentVariable { get; } - - public abstract string? GenerateSetVersionMessage(VersionVariables variables); - public abstract string[] GenerateSetParameterMessage(string name, string value); - - public virtual bool CanApplyToCurrentContext() => !Environment.GetEnvironmentVariable(EnvironmentVariable).IsNullOrEmpty(); - - public virtual string? GetCurrentBranch(bool usingDynamicRepos) => null; - - public virtual bool PreventFetch() => true; - public virtual bool ShouldCleanUpRemotes() => false; - - public virtual void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) - { - if (updateBuildNumber) - { - writer($"Executing GenerateSetVersionMessage for '{GetType().Name}'."); - writer(GenerateSetVersionMessage(variables)); - } - writer($"Executing GenerateBuildLogOutput for '{GetType().Name}'."); - foreach (var buildParameter in GenerateBuildLogOutput(variables)) - { - writer(buildParameter); - } - } - - protected IEnumerable GenerateBuildLogOutput(VersionVariables variables) - { - var output = new List(); - - foreach (var (key, value) in variables) - { - output.AddRange(GenerateSetParameterMessage(key, value)); - } - - return output; - } -} diff --git a/src/GitVersion.Core/BuildAgents/BuildServerModule.cs b/src/GitVersion.Core/BuildAgents/BuildServerModule.cs deleted file mode 100644 index 5cd41175d0..0000000000 --- a/src/GitVersion.Core/BuildAgents/BuildServerModule.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.BuildAgents; - -public class BuildServerModule : GitVersionModule -{ - public override void RegisterTypes(IServiceCollection services) - { - var buildAgents = FindAllDerivedTypes(Assembly.GetAssembly(GetType())); - - foreach (var buildAgent in buildAgents) - { - services.AddSingleton(typeof(IBuildAgent), buildAgent); - } - - services.AddSingleton(); - services.AddSingleton(sp => sp.GetRequiredService().Resolve()); - } -} diff --git a/src/GitVersion.Core/BuildAgents/ContinuaCi.cs b/src/GitVersion.Core/BuildAgents/ContinuaCi.cs deleted file mode 100644 index 7b2fb178ba..0000000000 --- a/src/GitVersion.Core/BuildAgents/ContinuaCi.cs +++ /dev/null @@ -1,24 +0,0 @@ -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class ContinuaCi : BuildAgentBase -{ - public ContinuaCi(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "ContinuaCI.Version"; - - protected override string EnvironmentVariable => EnvironmentVariableName; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"@@continua[setVariable name='GitVersion_{name}' value='{value}' skipIfNotDefined='true']" - }; - - public override string GenerateSetVersionMessage(VersionVariables variables) => $"@@continua[setBuildVersion value='{variables.FullSemVer}']"; - - public override bool PreventFetch() => false; -} diff --git a/src/GitVersion.Core/BuildAgents/Drone.cs b/src/GitVersion.Core/BuildAgents/Drone.cs deleted file mode 100644 index df592adaa0..0000000000 --- a/src/GitVersion.Core/BuildAgents/Drone.cs +++ /dev/null @@ -1,55 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class Drone : BuildAgentBase -{ - public Drone(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "DRONE"; - protected override string EnvironmentVariable => EnvironmentVariableName; - public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable), StringComparison.OrdinalIgnoreCase); - - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"GitVersion_{name}={value}" - }; - - public override string? GetCurrentBranch(bool usingDynamicRepos) - { - // In Drone DRONE_BRANCH variable is equal to destination branch in case of pull request - // https://discourse.drone.io/t/getting-the-branch-a-pull-request-is-created-from/670 - // Unfortunately, DRONE_REFSPEC isn't populated, however CI_COMMIT_REFSPEC can be used instead of. - var pullRequestNumber = Environment.GetEnvironmentVariable("DRONE_PULL_REQUEST"); - if (!pullRequestNumber.IsNullOrWhiteSpace()) - { - // DRONE_SOURCE_BRANCH is available in Drone 1.x.x version - var sourceBranch = Environment.GetEnvironmentVariable("DRONE_SOURCE_BRANCH"); - if (!sourceBranch.IsNullOrWhiteSpace()) - return sourceBranch; - - // In drone lower than 1.x.x source branch can be parsed from CI_COMMIT_REFSPEC - // CI_COMMIT_REFSPEC - {sourceBranch}:{destinationBranch} - // https://github.com/drone/drone/issues/2222 - var ciCommitRefSpec = Environment.GetEnvironmentVariable("CI_COMMIT_REFSPEC"); - if (!ciCommitRefSpec.IsNullOrWhiteSpace()) - { - var colonIndex = ciCommitRefSpec.IndexOf(':'); - if (colonIndex > 0) - { - return ciCommitRefSpec.Substring(0, colonIndex); - } - } - } - - return Environment.GetEnvironmentVariable("DRONE_BRANCH"); - } - - public override bool PreventFetch() => false; -} diff --git a/src/GitVersion.Core/BuildAgents/EnvRun.cs b/src/GitVersion.Core/BuildAgents/EnvRun.cs deleted file mode 100644 index 9853ca453f..0000000000 --- a/src/GitVersion.Core/BuildAgents/EnvRun.cs +++ /dev/null @@ -1,39 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class EnvRun : BuildAgentBase -{ - public EnvRun(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "ENVRUN_DATABASE"; - protected override string EnvironmentVariable => EnvironmentVariableName; - public override bool CanApplyToCurrentContext() - { - var envRunDatabasePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); - if (!envRunDatabasePath.IsNullOrEmpty()) - { - if (!File.Exists(envRunDatabasePath)) - { - this.Log.Error($"The database file of EnvRun.exe was not found at {envRunDatabasePath}."); - return false; - } - - return true; - } - - return false; - } - - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"@@envrun[set name='GitVersion_{name}' value='{value}']" - }; - public override bool PreventFetch() => true; -} diff --git a/src/GitVersion.Core/BuildAgents/GitLabCi.cs b/src/GitVersion.Core/BuildAgents/GitLabCi.cs deleted file mode 100644 index e20adcf783..0000000000 --- a/src/GitVersion.Core/BuildAgents/GitLabCi.cs +++ /dev/null @@ -1,40 +0,0 @@ -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class GitLabCi : BuildAgentBase -{ - public const string EnvironmentVariableName = "GITLAB_CI"; - private string? file; - - public GitLabCi(IEnvironment environment, ILog log) : base(environment, log) => WithPropertyFile("gitversion.properties"); - - public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; - - protected override string EnvironmentVariable => EnvironmentVariableName; - - - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"GitVersion_{name}={value}" - }; - - public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("CI_COMMIT_REF_NAME"); - - public override bool PreventFetch() => true; - - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) - { - if (this.file is null) - return; - - base.WriteIntegration(writer, variables, updateBuildNumber); - writer($"Outputting variables to '{this.file}' ... "); - - File.WriteAllLines(this.file, GenerateBuildLogOutput(variables)); - } - -} diff --git a/src/GitVersion.Core/BuildAgents/LocalBuild.cs b/src/GitVersion.Core/BuildAgents/LocalBuild.cs deleted file mode 100644 index 65f19663be..0000000000 --- a/src/GitVersion.Core/BuildAgents/LocalBuild.cs +++ /dev/null @@ -1,15 +0,0 @@ -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class LocalBuild : BuildAgentBase -{ - public LocalBuild(IEnvironment environment, ILog log) : base(environment, log) - { - } - protected override string EnvironmentVariable => string.Empty; - public override bool CanApplyToCurrentContext() => true; - public override string? GenerateSetVersionMessage(VersionVariables variables) => null; - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); -} diff --git a/src/GitVersion.Core/BuildAgents/SpaceAutomation.cs b/src/GitVersion.Core/BuildAgents/SpaceAutomation.cs deleted file mode 100644 index 43be822a07..0000000000 --- a/src/GitVersion.Core/BuildAgents/SpaceAutomation.cs +++ /dev/null @@ -1,21 +0,0 @@ -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class SpaceAutomation : BuildAgentBase -{ - public SpaceAutomation(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "JB_SPACE_PROJECT_KEY"; - - protected override string EnvironmentVariable => EnvironmentVariableName; - - public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("JB_SPACE_GIT_BRANCH"); - - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); - - public override string GenerateSetVersionMessage(VersionVariables variables) => string.Empty; -} diff --git a/src/GitVersion.Core/BuildAgents/TeamCity.cs b/src/GitVersion.Core/BuildAgents/TeamCity.cs deleted file mode 100644 index 59b7d09ba0..0000000000 --- a/src/GitVersion.Core/BuildAgents/TeamCity.cs +++ /dev/null @@ -1,49 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.BuildAgents; - -public class TeamCity : BuildAgentBase -{ - public TeamCity(IEnvironment environment, ILog log) : base(environment, log) - { - } - - public const string EnvironmentVariableName = "TEAMCITY_VERSION"; - - protected override string EnvironmentVariable => EnvironmentVariableName; - - public override string? GetCurrentBranch(bool usingDynamicRepos) - { - var branchName = Environment.GetEnvironmentVariable("Git_Branch"); - - if (branchName.IsNullOrEmpty()) - { - if (!usingDynamicRepos) - { - WriteBranchEnvVariableWarning(); - } - - return base.GetCurrentBranch(usingDynamicRepos); - } - - return branchName; - } - - private void WriteBranchEnvVariableWarning() => this.Log.Warning(@"TeamCity doesn't make the current branch available through environmental variables. -Depending on your authentication and transport setup of your git VCS root things may work. In that case, ignore this warning. -In your TeamCity build configuration, add a parameter called `env.Git_Branch` with value %teamcity.build.vcs.branch.% -See https://gitversion.net/docs/reference/build-servers/teamcity for more info"); - - public override bool PreventFetch() => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("Git_Branch")); - - public override string[] GenerateSetParameterMessage(string name, string value) => new[] - { - $"##teamcity[setParameter name='GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']", - $"##teamcity[setParameter name='system.GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']" - }; - - public override string GenerateSetVersionMessage(VersionVariables variables) => $"##teamcity[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']"; -} diff --git a/src/GitVersion.Core/Configuration/Abstractions/IBranchConfigurationCalculator.cs b/src/GitVersion.Core/Configuration/Abstractions/IBranchConfigurationCalculator.cs deleted file mode 100644 index ed49a4e085..0000000000 --- a/src/GitVersion.Core/Configuration/Abstractions/IBranchConfigurationCalculator.cs +++ /dev/null @@ -1,11 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration; - -public interface IBranchConfigurationCalculator -{ - /// - /// Gets the for the current commit. - /// - BranchConfig GetBranchConfiguration(IBranch targetBranch, ICommit? currentCommit, Config configuration, IList? excludedInheritBranches = null); -} diff --git a/src/GitVersion.Core/Configuration/Abstractions/IConfigFileLocator.cs b/src/GitVersion.Core/Configuration/Abstractions/IConfigFileLocator.cs deleted file mode 100644 index 3d3b90eda3..0000000000 --- a/src/GitVersion.Core/Configuration/Abstractions/IConfigFileLocator.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration; - -public interface IConfigFileLocator -{ - string FilePath { get; } - bool HasConfigFileAt(string workingDirectory); - string? GetConfigFilePath(string workingDirectory); - void Verify(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo); - void Verify(string workingDirectory, string projectRootDirectory); - string? SelectConfigFilePath(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo); - Config ReadConfig(string workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/Abstractions/IConfigProvider.cs b/src/GitVersion.Core/Configuration/Abstractions/IConfigProvider.cs deleted file mode 100644 index d7b26dfae5..0000000000 --- a/src/GitVersion.Core/Configuration/Abstractions/IConfigProvider.cs +++ /dev/null @@ -1,10 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration; - -public interface IConfigProvider -{ - Config Provide(Config? overrideConfig = null); - Config Provide(string workingDirectory, Config? overrideConfig = null); - void Init(string workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/AssemblyFileVersioningScheme.cs b/src/GitVersion.Core/Configuration/AssemblyFileVersioningScheme.cs new file mode 100644 index 0000000000..1593116fba --- /dev/null +++ b/src/GitVersion.Core/Configuration/AssemblyFileVersioningScheme.cs @@ -0,0 +1,10 @@ +namespace GitVersion.Configuration; + +public enum AssemblyFileVersioningScheme +{ + MajorMinorPatchTag, + MajorMinorPatch, + MajorMinor, + Major, + None +} diff --git a/src/GitVersion.Core/Configuration/AssemblyVersioningScheme.cs b/src/GitVersion.Core/Configuration/AssemblyVersioningScheme.cs new file mode 100644 index 0000000000..596decd681 --- /dev/null +++ b/src/GitVersion.Core/Configuration/AssemblyVersioningScheme.cs @@ -0,0 +1,10 @@ +namespace GitVersion.Configuration; + +public enum AssemblyVersioningScheme +{ + MajorMinorPatchTag, + MajorMinorPatch, + MajorMinor, + Major, + None +} diff --git a/src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs b/src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs deleted file mode 100644 index dc33672dd5..0000000000 --- a/src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs +++ /dev/null @@ -1,275 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Common; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.Model.Exceptions; - -namespace GitVersion.Configuration; - -public class BranchConfigurationCalculator : IBranchConfigurationCalculator -{ - private const string FallbackConfigName = "Fallback"; - private const int MaxRecursions = 50; - - private readonly ILog log; - private readonly IRepositoryStore repositoryStore; - - public BranchConfigurationCalculator(ILog log, IRepositoryStore repositoryStore) - { - this.log = log.NotNull(); - this.repositoryStore = repositoryStore.NotNull(); - } - - /// - /// Gets the for the current commit. - /// - public BranchConfig GetBranchConfiguration(IBranch targetBranch, ICommit? currentCommit, Config configuration, IList? excludedInheritBranches = null) => - GetBranchConfigurationInternal(0, targetBranch, currentCommit, configuration, excludedInheritBranches); - - private BranchConfig GetBranchConfigurationInternal(int recursions, IBranch targetBranch, ICommit? currentCommit, Config configuration, IList? excludedInheritBranches = null) - { - if (recursions >= MaxRecursions) - { - throw new InfiniteLoopProtectionException($"Inherited branch configuration caused {recursions} recursions. Aborting!"); - } - - var matchingBranches = configuration.ForBranch(targetBranch); - - if (matchingBranches == null) - { - this.log.Info($"No branch configuration found for branch {targetBranch}, falling back to default configuration"); - - matchingBranches = BranchConfig.CreateDefaultBranchConfig(FallbackConfigName) - .Apply(new BranchConfig - { - Regex = "", - VersioningMode = configuration.VersioningMode, - Increment = configuration.Increment ?? IncrementStrategy.Inherit - }); - } - - if (matchingBranches.Increment == IncrementStrategy.Inherit) - { - matchingBranches = InheritBranchConfiguration(recursions, targetBranch, matchingBranches, currentCommit, configuration, excludedInheritBranches); - if (matchingBranches.Name.IsEquivalentTo(FallbackConfigName) && matchingBranches.Increment == IncrementStrategy.Inherit) - { - // We tried, and failed to inherit, just fall back to patch - matchingBranches.Increment = IncrementStrategy.Patch; - } - } - - return matchingBranches; - - } - - // TODO I think we need to take a fresh approach to this.. it's getting really complex with heaps of edge cases - private BranchConfig InheritBranchConfiguration(int recursions, IBranch targetBranch, BranchConfig branchConfiguration, ICommit? currentCommit, Config configuration, IList? excludedInheritBranches) - { - using (this.log.IndentLog("Attempting to inherit branch configuration from parent branch")) - { - recursions += 1; - - var excludedBranches = new[] { targetBranch }; - // Check if we are a merge commit. If so likely we are a pull request - if (currentCommit != null) - { - var parentCount = currentCommit.Parents.Count(); - if (parentCount == 2) - { - excludedBranches = CalculateWhenMultipleParents(currentCommit, ref targetBranch, excludedBranches); - } - } - - excludedInheritBranches ??= this.repositoryStore.GetExcludedInheritBranches(configuration).ToList(); - - excludedBranches = excludedBranches.Where(b => excludedInheritBranches.All(bte => !b.Equals(bte))).ToArray(); - // Add new excluded branches. - foreach (var excludedBranch in excludedBranches) - { - excludedInheritBranches.Add(excludedBranch); - } - var branchesToEvaluate = this.repositoryStore.ExcludingBranches(excludedInheritBranches) - .Distinct(new LocalRemoteBranchEqualityComparer()) - .ToList(); - - var branchPoint = this.repositoryStore - .FindCommitBranchWasBranchedFrom(targetBranch, configuration, excludedInheritBranches.ToArray()); - List possibleParents; - if (branchPoint == BranchCommit.Empty) - { - possibleParents = this.repositoryStore.GetBranchesContainingCommit(targetBranch.Tip, branchesToEvaluate) - // It fails to inherit Increment branch configuration if more than 1 parent; - // therefore no point to get more than 2 parents - .Take(2) - .ToList(); - } - else - { - var branches = this.repositoryStore.GetBranchesContainingCommit(branchPoint.Commit, branchesToEvaluate).ToList(); - if (branches.Count > 1) - { - var currentTipBranches = this.repositoryStore.GetBranchesContainingCommit(currentCommit, branchesToEvaluate).ToList(); - possibleParents = branches.Except(currentTipBranches).ToList(); - } - else - { - possibleParents = branches; - } - } - - this.log.Info("Found possible parent branches: " + string.Join(", ", possibleParents.Select(p => p.ToString()))); - - if (possibleParents.Count == 1) - { - var branchConfig = GetBranchConfigurationInternal(recursions, possibleParents[0], currentCommit, configuration, excludedInheritBranches); - // If we have resolved a fallback config we should not return that we have got config - if (branchConfig.Name != FallbackConfigName) - { - return new BranchConfig(branchConfiguration) - { - Increment = branchConfig.Increment, - PreventIncrementOfMergedBranchVersion = branchConfig.PreventIncrementOfMergedBranchVersion, - // If we are inheriting from develop then we should behave like develop - TracksReleaseBranches = branchConfig.TracksReleaseBranches - }; - } - } - - // If we fail to inherit it is probably because the branch has been merged and we can't do much. So we will fall back to develop's config - // if develop exists and main if not - var errorMessage = possibleParents.Count == 0 - ? "Failed to inherit Increment branch configuration, no branches found." - : "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.ToString())); - - var chosenBranch = this.repositoryStore.GetChosenBranch(configuration); - if (chosenBranch == null) - { - // TODO We should call the build server to generate this exception, each build server works differently - // for fetch issues and we could give better warnings. - throw new InvalidOperationException("Gitversion could not determine which branch to treat as the development branch (default is 'develop') nor release-able branch (default is 'main' or 'master'), either locally or remotely. Ensure the local clone and checkout match the requirements or considering using 'GitVersion Dynamic Repositories'"); - } - - this.log.Warning($"{errorMessage}{System.Environment.NewLine}Falling back to {chosenBranch} branch config"); - - // To prevent infinite loops, make sure that a new branch was chosen. - if (targetBranch.Equals(chosenBranch)) - { - var developOrMainConfig = - ChooseMainOrDevelopIncrementStrategyIfTheChosenBranchIsOneOfThem( - chosenBranch, branchConfiguration, configuration); - if (developOrMainConfig != null) - { - return developOrMainConfig; - } - - this.log.Warning("Fallback branch wants to inherit Increment branch configuration from itself. Using patch increment instead."); - return new BranchConfig(branchConfiguration) - { - Increment = IncrementStrategy.Patch - }; - } - - var inheritingBranchConfig = GetBranchConfigurationInternal(recursions, chosenBranch, currentCommit, configuration, excludedInheritBranches); - var configIncrement = inheritingBranchConfig.Increment; - if (inheritingBranchConfig.Name.IsEquivalentTo(FallbackConfigName) && configIncrement == IncrementStrategy.Inherit) - { - this.log.Warning("Fallback config inherits by default, dropping to patch increment"); - configIncrement = IncrementStrategy.Patch; - } - - return new BranchConfig(branchConfiguration) - { - Increment = configIncrement, - PreventIncrementOfMergedBranchVersion = inheritingBranchConfig.PreventIncrementOfMergedBranchVersion, - // If we are inheriting from develop then we should behave like develop - TracksReleaseBranches = inheritingBranchConfig.TracksReleaseBranches - }; - } - } - - private IBranch[] CalculateWhenMultipleParents(ICommit currentCommit, ref IBranch currentBranch, IBranch[] excludedBranches) - { - var parents = currentCommit.Parents.ToArray(); - var branches = this.repositoryStore.GetBranchesForCommit(parents[1]).ToList(); - if (branches.Count == 1) - { - var branch = branches[0]; - excludedBranches = new[] - { - currentBranch, - branch - }; - currentBranch = branch; - } - else if (branches.Count > 1) - { - currentBranch = branches.FirstOrDefault(b => b.Name.WithoutRemote == Config.MainBranchKey) ?? branches.First(); - } - else - { - var possibleTargetBranches = this.repositoryStore.GetBranchesForCommit(parents[0]).ToList(); - if (possibleTargetBranches.Count > 1) - { - currentBranch = possibleTargetBranches.FirstOrDefault(b => b.Name.WithoutRemote == Config.MainBranchKey) ?? possibleTargetBranches.First(); - } - else - { - currentBranch = possibleTargetBranches.FirstOrDefault() ?? currentBranch; - } - } - - this.log.Info($"HEAD is merge commit, this is likely a pull request using {currentBranch} as base"); - - return excludedBranches; - } - - - - private static BranchConfig? ChooseMainOrDevelopIncrementStrategyIfTheChosenBranchIsOneOfThem(IBranch chosenBranch, BranchConfig branchConfiguration, Config config) - { - BranchConfig? mainOrDevelopConfig = null; - var developBranchRegex = config.Branches[Config.DevelopBranchKey]?.Regex ?? Config.DevelopBranchRegex; - var mainBranchRegex = config.Branches[Config.MainBranchKey]?.Regex ?? Config.MainBranchRegex; - if (Regex.IsMatch(chosenBranch.Name.Friendly, developBranchRegex, RegexOptions.IgnoreCase)) - { - // Normally we would not expect this to happen but for safety we add a check - if (config.Branches[Config.DevelopBranchKey]?.Increment != - IncrementStrategy.Inherit) - { - mainOrDevelopConfig = new BranchConfig(branchConfiguration) - { - Increment = config.Branches[Config.DevelopBranchKey]?.Increment - }; - } - } - else if (Regex.IsMatch(chosenBranch.Name.Friendly, mainBranchRegex, RegexOptions.IgnoreCase)) - { - // Normally we would not expect this to happen but for safety we add a check - if (config.Branches[Config.MainBranchKey]?.Increment != - IncrementStrategy.Inherit) - { - mainOrDevelopConfig = new BranchConfig(branchConfiguration) - { - Increment = config.Branches[Config.DevelopBranchKey]?.Increment - }; - } - } - return mainOrDevelopConfig; - } - - private class LocalRemoteBranchEqualityComparer : IEqualityComparer - { - public bool Equals(IBranch? b1, IBranch? b2) - { - if (b1 == null && b2 == null) - return true; - if (b1 == null || b2 == null) - return false; - - return b1.Name.WithoutRemote.Equals(b2.Name.WithoutRemote); - } - - public int GetHashCode(IBranch b) => b.Name.WithoutRemote.GetHashCode(); - } -} diff --git a/src/GitVersion.Core/Configuration/ConfigExtensions.cs b/src/GitVersion.Core/Configuration/ConfigExtensions.cs deleted file mode 100644 index 3edf74d0a3..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigExtensions.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration; - -public static class ConfigExtensions -{ - public static BranchConfig GetBranchConfiguration(this Config configuration, IBranch branch) - => GetBranchConfiguration(configuration, branch.NotNull().Name.WithoutRemote); - - public static BranchConfig GetBranchConfiguration(this Config configuration, string branchName) - { - var branchConfiguration = ForBranch(configuration, branchName); - if (branchConfiguration is null) - { - branchConfiguration = GetUnknownBranchConfiguration(configuration); - branchConfiguration.Name = branchName; - } - return branchConfiguration; - } - - // TODO: Please make the unknown settings also configurable in the yaml. - public static BranchConfig GetUnknownBranchConfiguration(this Config configuration) => new() - { - Name = "Unknown", - Regex = "", - Tag = "{BranchName}", - VersioningMode = configuration.VersioningMode, - Increment = IncrementStrategy.Inherit - }; - - // TODO: Please make the fallback settings also configurable in the yaml. - public static BranchConfig GetFallbackBranchConfiguration(this Config configuration) - { - var result = new BranchConfig() - { - Name = "Fallback", - Regex = "", - Tag = "{BranchName}", - VersioningMode = configuration.VersioningMode, - Increment = configuration.Increment, - PreventIncrementOfMergedBranchVersion = false, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsReleaseBranch = false, - IsMainline = false - }; - if (result.Increment == IncrementStrategy.Inherit) - { - result.Increment = IncrementStrategy.None; - } - return result; - } - - internal static BranchConfig? ForBranch(this Config configuration, IBranch branch) - => ForBranch(configuration, branch.NotNull().Name.WithoutRemote); - - internal static BranchConfig? ForBranch(this Config configuration, string branchName) - { - var matches = configuration.Branches - .Where(b => b.Value?.Regex != null && Regex.IsMatch(branchName, b.Value.Regex, RegexOptions.IgnoreCase)) - .ToArray(); - - try - { - return matches - .Select(kvp => kvp.Value) - .SingleOrDefault(); - } - catch (InvalidOperationException) - { - var matchingConfigs = string.Concat(matches.Select(m => $"{System.Environment.NewLine} - {m.Key}")); - var picked = matches - .Select(kvp => kvp.Value) - .First(); - - // TODO check how to log this - Console.WriteLine( - $"Multiple branch configurations match the current branch branchName of '{branchName}'. " + - $"Using the first matching configuration, '{picked?.Name}'. Matching configurations include:'{matchingConfigs}'"); - - return picked; - } - } - - public static bool IsReleaseBranch(this Config config, string branchName) => config.GetBranchConfiguration(branchName).IsReleaseBranch ?? false; - - public static string GetBranchSpecificTag(this EffectiveConfiguration configuration, ILog log, string? branchFriendlyName, string? branchNameOverride) - { - var tagToUse = configuration.Tag ?? "{BranchName}"; - if (tagToUse == "useBranchName") - { - tagToUse = "{BranchName}"; - } - if (tagToUse.Contains("{BranchName}")) - { - log.Info("Using branch name to calculate version tag"); - - var branchName = branchNameOverride ?? branchFriendlyName; - if (!configuration.BranchPrefixToTrim.IsNullOrWhiteSpace()) - { - var branchNameTrimmed = branchName?.RegexReplace(configuration.BranchPrefixToTrim, string.Empty, RegexOptions.IgnoreCase); - branchName = branchNameTrimmed.IsNullOrEmpty() ? branchName : branchNameTrimmed; - } - branchName = branchName?.RegexReplace("[^a-zA-Z0-9-]", "-"); - - tagToUse = tagToUse.Replace("{BranchName}", branchName); - } - return tagToUse; - } - - public static List> GetReleaseBranchConfig(this Config configuration) => - configuration.Branches - .Where(b => b.Value.IsReleaseBranch == true) - .ToList(); -} diff --git a/src/GitVersion.Core/Configuration/ConfigFileLocator.cs b/src/GitVersion.Core/Configuration/ConfigFileLocator.cs deleted file mode 100644 index 77fdc6f33e..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigFileLocator.cs +++ /dev/null @@ -1,106 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; -using Microsoft.Extensions.Options; - -namespace GitVersion.Configuration; - -public class ConfigFileLocator : IConfigFileLocator -{ - public const string DefaultFileName = "GitVersion.yml"; - private readonly IFileSystem fileSystem; - public ConfigFileLocator(IFileSystem fileSystem, IOptions options) - { - this.fileSystem = fileSystem; - var configFile = options.Value.ConfigInfo.ConfigFile; - FilePath = !configFile.IsNullOrWhiteSpace() ? configFile : DefaultFileName; - } - - public string FilePath { get; } - - public bool HasConfigFileAt(string workingDirectory) => this.fileSystem.Exists(PathHelper.Combine(workingDirectory, FilePath)); - - public string? GetConfigFilePath(string? workingDirectory) => workingDirectory != null ? PathHelper.Combine(workingDirectory, FilePath) : null; - - public void Verify(string? workingDirectory, string? projectRootDirectory) - { - if (!Path.IsPathRooted(FilePath) && !this.fileSystem.PathsEqual(workingDirectory, projectRootDirectory)) - { - WarnAboutAmbiguousConfigFileSelection(workingDirectory, projectRootDirectory); - } - } - - public string? SelectConfigFilePath(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo) - { - var workingDirectory = gitVersionOptions.WorkingDirectory; - var projectRootDirectory = repositoryInfo.ProjectRootDirectory; - - return GetConfigFilePath(HasConfigFileAt(workingDirectory) ? workingDirectory : projectRootDirectory); - } - - public Config ReadConfig(string workingDirectory) - { - var configFilePath = GetConfigFilePath(workingDirectory); - - if (configFilePath != null && this.fileSystem.Exists(configFilePath)) - { - var readAllText = this.fileSystem.ReadAllText(configFilePath); - var readConfig = ConfigSerializer.Read(new StringReader(readAllText)); - - VerifyReadConfig(readConfig); - - return readConfig; - } - - return new Config(); - } - - public void Verify(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo) - { - if (!gitVersionOptions.RepositoryInfo.TargetUrl.IsNullOrWhiteSpace()) - { - // Assuming this is a dynamic repository. At this stage it's unsure whether we have - // any .git info so we need to skip verification - return; - } - - var workingDirectory = gitVersionOptions.WorkingDirectory; - var projectRootDirectory = repositoryInfo.ProjectRootDirectory; - - Verify(workingDirectory, projectRootDirectory); - } - - private static void VerifyReadConfig(Config config) - { - // Verify no branches are set to mainline mode - if (config.Branches.Any(b => b.Value?.VersioningMode == VersioningMode.Mainline)) - { - throw new ConfigurationException(@"Mainline mode only works at the repository level, a single branch cannot be put into mainline mode - -This is because mainline mode treats your entire git repository as an event source with each merge into the 'mainline' incrementing the version. - -If the docs do not help you decide on the mode open an issue to discuss what you are trying to do."); - } - } - - private void WarnAboutAmbiguousConfigFileSelection(string? workingDirectory, string? projectRootDirectory) - { - var workingConfigFile = GetConfigFilePath(workingDirectory); - var projectRootConfigFile = GetConfigFilePath(projectRootDirectory); - - var hasConfigInWorkingDirectory = workingConfigFile != null && this.fileSystem.Exists(workingConfigFile); - var hasConfigInProjectRootDirectory = projectRootConfigFile != null && this.fileSystem.Exists(projectRootConfigFile); - - if (hasConfigInProjectRootDirectory && hasConfigInWorkingDirectory) - { - throw new WarningException($"Ambiguous config file selection from '{workingConfigFile}' and '{projectRootConfigFile}'"); - } - - if (!hasConfigInProjectRootDirectory && !hasConfigInWorkingDirectory) - { - if (FilePath != DefaultFileName) - throw new WarningException($"The configuration file was not found at '{workingConfigFile}' or '{projectRootConfigFile}'"); - } - } -} diff --git a/src/GitVersion.Core/Configuration/ConfigProvider.cs b/src/GitVersion.Core/Configuration/ConfigProvider.cs deleted file mode 100644 index fc6fe0a586..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigProvider.cs +++ /dev/null @@ -1,63 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using Microsoft.Extensions.Options; - -namespace GitVersion.Configuration; - -public class ConfigProvider : IConfigProvider -{ - private readonly IFileSystem fileSystem; - private readonly ILog log; - private readonly IConfigFileLocator configFileLocator; - private readonly IOptions options; - private readonly IConfigInitWizard configInitWizard; - private readonly IGitRepositoryInfo repositoryInfo; - - public ConfigProvider(IFileSystem fileSystem, ILog log, IConfigFileLocator configFileLocator, - IOptions options, IConfigInitWizard configInitWizard, IGitRepositoryInfo repositoryInfo) - { - this.fileSystem = fileSystem.NotNull(); - this.log = log.NotNull(); - this.configFileLocator = configFileLocator.NotNull(); - this.options = options.NotNull(); - this.configInitWizard = configInitWizard.NotNull(); - this.repositoryInfo = repositoryInfo.NotNull(); - } - - public Config Provide(Config? overrideConfig = null) - { - var gitVersionOptions = this.options.Value; - var workingDirectory = gitVersionOptions.WorkingDirectory; - var projectRootDirectory = this.repositoryInfo.ProjectRootDirectory; - - var rootDirectory = this.configFileLocator.HasConfigFileAt(workingDirectory) ? workingDirectory : projectRootDirectory; - return Provide(rootDirectory, overrideConfig); - } - - public Config Provide(string? workingDirectory, Config? overrideConfig = null) - { - var configurationBuilder = new ConfigurationBuilder(); - if (workingDirectory != null) - configurationBuilder = configurationBuilder.Add(this.configFileLocator.ReadConfig(workingDirectory)); - return configurationBuilder - .Add(overrideConfig ?? new Config()) - .Build(); - } - - public void Init(string workingDirectory) - { - var configFilePath = this.configFileLocator.GetConfigFilePath(workingDirectory); - var currentConfiguration = this.configFileLocator.ReadConfig(workingDirectory); - - var config = this.configInitWizard.Run(currentConfiguration, workingDirectory); - if (config == null || configFilePath == null) return; - - using var stream = this.fileSystem.OpenWrite(configFilePath); - using var writer = new StreamWriter(stream); - this.log.Info("Saving config file"); - ConfigSerializer.Write(config, writer); - stream.Flush(); - } -} diff --git a/src/GitVersion.Core/Configuration/ConfigSerializer.cs b/src/GitVersion.Core/Configuration/ConfigSerializer.cs deleted file mode 100644 index 47253abb55..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigSerializer.cs +++ /dev/null @@ -1,26 +0,0 @@ -using GitVersion.Model.Configuration; -using YamlDotNet.Serialization; -using YamlDotNet.Serialization.NamingConventions; - -namespace GitVersion.Configuration; - -public class ConfigSerializer -{ - public static Config Read(TextReader reader) - { - var deserializer = new DeserializerBuilder() - .WithNamingConvention(HyphenatedNamingConvention.Instance) - .Build(); - var config = deserializer.Deserialize(reader); - return config ?? new Config(); - } - - public static void Write(Config config, TextWriter writer) - { - var serializer = new SerializerBuilder() - .ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitDefaults) - .WithNamingConvention(HyphenatedNamingConvention.Instance) - .Build(); - serializer.Serialize(writer, config); - } -} diff --git a/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs deleted file mode 100644 index 57aac7e158..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs +++ /dev/null @@ -1,329 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Configuration; - -public class ConfigurationBuilder -{ - private const int DefaultTagPreReleaseWeight = 60000; - - private readonly List overrides = new(); - - public ConfigurationBuilder Add(Config config) - { - if (config == null) throw new ArgumentNullException(nameof(config)); - - this.overrides.Add(config); - return this; - } - - public Config Build() - { - var config = CreateDefaultConfiguration(); - - foreach (var overrideConfig in this.overrides) - { - ApplyOverrides(config, overrideConfig); - } - - FinalizeConfiguration(config); - ValidateConfiguration(config); - - return config; - } - - private static void ApplyOverrides(Config targetConfig, Config overrideConfig) - { - targetConfig.AssemblyVersioningScheme = overrideConfig.AssemblyVersioningScheme ?? targetConfig.AssemblyVersioningScheme; - targetConfig.AssemblyFileVersioningScheme = overrideConfig.AssemblyFileVersioningScheme ?? targetConfig.AssemblyFileVersioningScheme; - targetConfig.AssemblyInformationalFormat = overrideConfig.AssemblyInformationalFormat ?? targetConfig.AssemblyInformationalFormat; - targetConfig.AssemblyVersioningFormat = overrideConfig.AssemblyVersioningFormat ?? targetConfig.AssemblyVersioningFormat; - targetConfig.AssemblyFileVersioningFormat = overrideConfig.AssemblyFileVersioningFormat ?? targetConfig.AssemblyFileVersioningFormat; - targetConfig.VersioningMode = overrideConfig.VersioningMode ?? targetConfig.VersioningMode; - targetConfig.TagPrefix = overrideConfig.TagPrefix ?? targetConfig.TagPrefix; - targetConfig.ContinuousDeploymentFallbackTag = overrideConfig.ContinuousDeploymentFallbackTag ?? targetConfig.ContinuousDeploymentFallbackTag; - targetConfig.NextVersion = overrideConfig.NextVersion ?? targetConfig.NextVersion; - targetConfig.MajorVersionBumpMessage = overrideConfig.MajorVersionBumpMessage ?? targetConfig.MajorVersionBumpMessage; - targetConfig.MinorVersionBumpMessage = overrideConfig.MinorVersionBumpMessage ?? targetConfig.MinorVersionBumpMessage; - targetConfig.PatchVersionBumpMessage = overrideConfig.PatchVersionBumpMessage ?? targetConfig.PatchVersionBumpMessage; - targetConfig.NoBumpMessage = overrideConfig.NoBumpMessage ?? targetConfig.NoBumpMessage; - targetConfig.LegacySemVerPadding = overrideConfig.LegacySemVerPadding ?? targetConfig.LegacySemVerPadding; - targetConfig.BuildMetaDataPadding = overrideConfig.BuildMetaDataPadding ?? targetConfig.BuildMetaDataPadding; - targetConfig.CommitsSinceVersionSourcePadding = overrideConfig.CommitsSinceVersionSourcePadding ?? targetConfig.CommitsSinceVersionSourcePadding; - targetConfig.TagPreReleaseWeight = overrideConfig.TagPreReleaseWeight ?? targetConfig.TagPreReleaseWeight; - targetConfig.CommitMessageIncrementing = overrideConfig.CommitMessageIncrementing ?? targetConfig.CommitMessageIncrementing; - targetConfig.Increment = overrideConfig.Increment ?? targetConfig.Increment; - targetConfig.CommitDateFormat = overrideConfig.CommitDateFormat ?? targetConfig.CommitDateFormat; - targetConfig.MergeMessageFormats = overrideConfig.MergeMessageFormats.Any() ? overrideConfig.MergeMessageFormats : targetConfig.MergeMessageFormats; - targetConfig.UpdateBuildNumber = overrideConfig.UpdateBuildNumber ?? targetConfig.UpdateBuildNumber; - - if (overrideConfig.Ignore is { IsEmpty: false }) - { - targetConfig.Ignore = overrideConfig.Ignore; - } - - ApplyBranchOverrides(targetConfig, overrideConfig); - } - - private static void ApplyBranchOverrides(Config targetConfig, Config overrideConfig) - { - if (overrideConfig.Branches is { Count: > 0 }) - { - // We can't just add new configs to the targetConfig.Branches, and have to create a new dictionary. - // The reason is that GitVersion 5.3.x (and earlier) merges default configs into overrides. The new approach is opposite: we merge overrides into default config. - // The important difference of these approaches is the order of branches in a dictionary (we should not rely on Dictionary's implementation details, but we already did that): - // Old approach: { new-branch-1, new-branch-2, default-branch-1, default-branch-2, ... } - // New approach: { default-branch-1, default-branch-2, ..., new-branch-1, new-branch-2 } - // In case when several branch configurations match the current branch (by regex), we choose the first one. - // So we have to add new branches to the beginning of a dictionary to preserve 5.3.x behavior. - - var newBranches = new Dictionary(); - - var targetConfigBranches = targetConfig.Branches; - - foreach (var (name, branchConfig) in overrideConfig.Branches) - { - // for compatibility reason we check if it's master, we rename it to main - var branchName = name == Config.MasterBranchKey ? Config.MainBranchKey : name; - if (!targetConfigBranches.TryGetValue(branchName, out var target)) - { - target = new BranchConfig() { Name = branchName }; - } - - branchConfig.MergeTo(target); - if (target.SourceBranches != null && target.SourceBranches.Contains(Config.MasterBranchKey)) - { - target.SourceBranches.Remove(Config.MasterBranchKey); - target.SourceBranches.Add(Config.MainBranchKey); - } - newBranches[branchName] = target; - } - - foreach (var (name, branchConfig) in targetConfigBranches) - { - if (!newBranches.ContainsKey(name)) - { - newBranches[name] = branchConfig; - } - } - - targetConfig.Branches = newBranches; - } - } - - private static void FinalizeConfiguration(Config config) - { - foreach (var (name, branchConfig) in config.Branches) - { - FinalizeBranchConfiguration(config, name, branchConfig); - } - } - - private static void FinalizeBranchConfiguration(Config config, string name, BranchConfig branchConfig) - { - branchConfig.Name = name; - branchConfig.Increment ??= config.Increment ?? IncrementStrategy.Inherit; - - if (branchConfig.VersioningMode == null) - { - if (name == Config.DevelopBranchKey) - { - branchConfig.VersioningMode = config.VersioningMode == VersioningMode.Mainline ? VersioningMode.Mainline : VersioningMode.ContinuousDeployment; - } - else - { - branchConfig.VersioningMode = config.VersioningMode; - } - } - - if (branchConfig.IsSourceBranchFor == null) - return; - - foreach (var targetBranchName in branchConfig.IsSourceBranchFor) - { - var targetBranchConfig = config.Branches[targetBranchName]; - targetBranchConfig.SourceBranches ??= new HashSet(); - targetBranchConfig.SourceBranches.Add(name); - } - } - - private static void ValidateConfiguration(Config config) - { - foreach (var (name, branchConfig) in config.Branches) - { - var regex = branchConfig?.Regex; - var helpUrl = $"{System.Environment.NewLine}See https://gitversion.net/docs/reference/configuration for more info"; - - if (regex == null) - { - throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'regex'{helpUrl}"); - } - - var sourceBranches = branchConfig?.SourceBranches; - if (sourceBranches == null) - { - throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'source-branches'{helpUrl}"); - } - - var missingSourceBranches = sourceBranches.Where(sb => !config.Branches.ContainsKey(sb)).ToArray(); - if (missingSourceBranches.Any()) - throw new ConfigurationException($"Branch configuration '{name}' defines these 'source-branches' that are not configured: '[{string.Join(",", missingSourceBranches)}]'{helpUrl}"); - } - } - - private static Config CreateDefaultConfiguration() - { - var config = new Config - { - AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = Config.DefaultTagPrefix, - VersioningMode = VersioningMode.ContinuousDelivery, - ContinuousDeploymentFallbackTag = "ci", - MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, - MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern, - PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, - NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern, - CommitMessageIncrementing = CommitMessageIncrementMode.Enabled, - LegacySemVerPadding = 4, - BuildMetaDataPadding = 4, - CommitsSinceVersionSourcePadding = 4, - CommitDateFormat = "yyyy-MM-dd", - UpdateBuildNumber = true, - TagPreReleaseWeight = DefaultTagPreReleaseWeight, - Increment = IncrementStrategy.Inherit - }; - - AddBranchConfig(Config.DevelopBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Minor, - Regex = Config.DevelopBranchRegex, - SourceBranches = new HashSet(), - Tag = "alpha", - PreventIncrementOfMergedBranchVersion = false, - TrackMergeTarget = true, - TracksReleaseBranches = true, - IsMainline = false, - IsReleaseBranch = false, - PreReleaseWeight = 0 - }); - - AddBranchConfig(Config.MainBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Patch, - Regex = Config.MainBranchRegex, - SourceBranches = new HashSet { - Config.DevelopBranchKey, - Config.ReleaseBranchKey - }, - Tag = string.Empty, - PreventIncrementOfMergedBranchVersion = true, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsMainline = true, - IsReleaseBranch = false, - PreReleaseWeight = 55000 - }); - - AddBranchConfig(Config.ReleaseBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.None, - Regex = Config.ReleaseBranchRegex, - SourceBranches = new HashSet { - Config.DevelopBranchKey, - Config.MainBranchKey, - Config.SupportBranchKey, - Config.ReleaseBranchKey - }, - Tag = "beta", - PreventIncrementOfMergedBranchVersion = true, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsMainline = false, - IsReleaseBranch = true, - PreReleaseWeight = 30000 - }); - - AddBranchConfig(Config.FeatureBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Inherit, - Regex = Config.FeatureBranchRegex, - SourceBranches = new HashSet { - Config.DevelopBranchKey, - Config.MainBranchKey, - Config.ReleaseBranchKey, - Config.FeatureBranchKey, - Config.SupportBranchKey, - Config.HotfixBranchKey - }, - Tag = "{BranchName}", - PreReleaseWeight = 30000 - }); - - AddBranchConfig(Config.PullRequestBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Inherit, - Regex = Config.PullRequestRegex, - SourceBranches = new HashSet { - Config.DevelopBranchKey, - Config.MainBranchKey, - Config.ReleaseBranchKey, - Config.FeatureBranchKey, - Config.SupportBranchKey, - Config.HotfixBranchKey - }, - Tag = "PullRequest", - TagNumberPattern = @"[/-](?\d+)", - PreReleaseWeight = 30000 - }); - - AddBranchConfig(Config.HotfixBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Patch, - Regex = Config.HotfixBranchRegex, - SourceBranches = new HashSet { - Config.ReleaseBranchKey, - Config.MainBranchKey, - Config.SupportBranchKey, - Config.HotfixBranchKey - }, - Tag = "beta", - PreventIncrementOfMergedBranchVersion = false, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsMainline = false, - IsReleaseBranch = false, - PreReleaseWeight = 30000 - }); - - AddBranchConfig(Config.SupportBranchKey, - new BranchConfig - { - Increment = IncrementStrategy.Patch, - Regex = Config.SupportBranchRegex, - SourceBranches = new HashSet { Config.MainBranchKey }, - Tag = string.Empty, - PreventIncrementOfMergedBranchVersion = true, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsMainline = true, - IsReleaseBranch = false, - PreReleaseWeight = 55000 - }); - - return config; - - void AddBranchConfig(string name, BranchConfig overrides) - { - var emptyBranchConfiguration = new BranchConfig() { Name = name }; - config.Branches[name] = emptyBranchConfiguration.Apply(overrides); - } - } -} diff --git a/src/GitVersion.Core/Configuration/ConfigurationConstants.cs b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs new file mode 100644 index 0000000000..017990354d --- /dev/null +++ b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs @@ -0,0 +1,40 @@ +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal static class ConfigurationConstants +{ + internal const string NameOfDefaultAssemblyVersioningScheme = nameof(AssemblyVersioningScheme.MajorMinorPatch); + internal const string NameOfDefaultAssemblyFileVersioningScheme = nameof(AssemblyFileVersioningScheme.MajorMinorPatch); + internal const string StringDefaultSemanticVersionFormat = nameof(SemanticVersionFormat.Strict); + internal const string StringDefaultTagPreReleaseWeight = "60000"; + internal const string StringDefaultUpdateBuildNumber = "true"; + + public const AssemblyVersioningScheme DefaultAssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch; + public const AssemblyFileVersioningScheme DefaultAssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch; + public const SemanticVersionFormat DefaultSemanticVersionFormat = SemanticVersionFormat.Strict; + public static readonly VersionStrategies[] DefaultVersionStrategies = [ + VersionStrategies.Fallback, + VersionStrategies.ConfiguredNextVersion, + VersionStrategies.MergeMessage, + VersionStrategies.TaggedCommit, + VersionStrategies.TrackReleaseBranches, + VersionStrategies.VersionInBranchName + ]; + public const string DefaultAssemblyInformationalFormat = "{InformationalVersion}"; + public const string DefaultCommitDateFormat = "yyyy-MM-dd"; + public const string BranchNamePlaceholder = "{BranchName}"; + public const string PullRequestNumberPlaceholder = "{Number}"; + public const bool DefaultUpdateBuildNumber = true; + public const int DefaultTagPreReleaseWeight = 60000; + + public const string MainBranchKey = "main"; + public const string MasterBranchKey = "master"; + public const string DevelopBranchKey = "develop"; + public const string ReleaseBranchKey = "release"; + public const string FeatureBranchKey = "feature"; + public const string PullRequestBranchKey = "pull-request"; + public const string HotfixBranchKey = "hotfix"; + public const string SupportBranchKey = "support"; + public const string UnknownBranchKey = "unknown"; +} diff --git a/src/GitVersion.Core/Configuration/ConfigurationModule.cs b/src/GitVersion.Core/Configuration/ConfigurationModule.cs deleted file mode 100644 index cadd2afb47..0000000000 --- a/src/GitVersion.Core/Configuration/ConfigurationModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using GitVersion.Configuration.Init; -using GitVersion.Extensions; -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.Configuration; - -public class ConfigurationModule : IGitVersionModule -{ - public void RegisterTypes(IServiceCollection services) - { - services.AddModule(new GitVersionInitModule()); - - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - } -} diff --git a/src/GitVersion.Core/Configuration/EffectiveBranchConfiguration.cs b/src/GitVersion.Core/Configuration/EffectiveBranchConfiguration.cs new file mode 100644 index 0000000000..1ad5c523b1 --- /dev/null +++ b/src/GitVersion.Core/Configuration/EffectiveBranchConfiguration.cs @@ -0,0 +1,11 @@ +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.Configuration; + +public record EffectiveBranchConfiguration(EffectiveConfiguration Value, IBranch Branch) +{ + public IBranch Branch { get; } = Branch.NotNull(); + + public EffectiveConfiguration Value { get; } = Value.NotNull(); +} diff --git a/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs new file mode 100644 index 0000000000..8d09e6ca4a --- /dev/null +++ b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs @@ -0,0 +1,139 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Extensions; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +/// +/// Configuration can be applied to different things, effective configuration is the result after applying the +/// appropriate configuration +/// +public record EffectiveConfiguration +{ + public EffectiveConfiguration( + IGitVersionConfiguration configuration, + IBranchConfiguration branchConfiguration, + EffectiveConfiguration? fallbackConfiguration = null) + { + configuration.NotNull(); + branchConfiguration.NotNull(); + + if (fallbackConfiguration is null) + { + var fallbackBranchConfiguration = configuration.GetFallbackBranchConfiguration(); + branchConfiguration = branchConfiguration.Inherit(fallbackBranchConfiguration); + } + else + { + branchConfiguration = branchConfiguration.Inherit(fallbackConfiguration); + } + + if (!branchConfiguration.DeploymentMode.HasValue) + throw new("Configuration value for 'Deployment mode' has no value. (this should not happen, please report an issue)"); + + if (!configuration.AssemblyVersioningScheme.HasValue) + throw new("Configuration value for 'AssemblyVersioningScheme' has no value. (this should not happen, please report an issue)"); + + if (!configuration.AssemblyFileVersioningScheme.HasValue) + throw new("Configuration value for 'AssemblyFileVersioningScheme' has no value. (this should not happen, please report an issue)"); + + if (!branchConfiguration.CommitMessageIncrementing.HasValue) + throw new("Configuration value for 'CommitMessageIncrementing' has no value. (this should not happen, please report an issue)"); + + if (!configuration.TagPreReleaseWeight.HasValue) + throw new("Configuration value for 'TagPreReleaseWeight' has no value. (this should not happen, please report an issue)"); + + if (configuration.CommitDateFormat.IsNullOrEmpty()) + throw new("Configuration value for 'CommitDateFormat' has no value. (this should not happen, please report an issue)"); + + AssemblyVersioningScheme = configuration.AssemblyVersioningScheme.Value; + AssemblyFileVersioningScheme = configuration.AssemblyFileVersioningScheme.Value; + AssemblyInformationalFormat = configuration.AssemblyInformationalFormat; + AssemblyVersioningFormat = configuration.AssemblyVersioningFormat; + AssemblyFileVersioningFormat = configuration.AssemblyFileVersioningFormat; + DeploymentMode = branchConfiguration.DeploymentMode.Value; + TagPrefix = configuration.TagPrefixPattern; + VersionInBranchPattern = configuration.VersionInBranchPattern; + Label = branchConfiguration.Label; + NextVersion = configuration.NextVersion; + Increment = branchConfiguration.Increment; + RegularExpression = branchConfiguration.RegularExpression; + PreventIncrementOfMergedBranch = branchConfiguration.PreventIncrement.OfMergedBranch ?? false; + PreventIncrementWhenBranchMerged = branchConfiguration.PreventIncrement.WhenBranchMerged ?? false; + PreventIncrementWhenCurrentCommitTagged = branchConfiguration.PreventIncrement.WhenCurrentCommitTagged ?? true; + TrackMergeTarget = branchConfiguration.TrackMergeTarget ?? false; + TrackMergeMessage = branchConfiguration.TrackMergeMessage ?? true; + MajorVersionBumpMessage = configuration.MajorVersionBumpMessage; + MinorVersionBumpMessage = configuration.MinorVersionBumpMessage; + PatchVersionBumpMessage = configuration.PatchVersionBumpMessage; + NoBumpMessage = configuration.NoBumpMessage; + CommitMessageIncrementing = branchConfiguration.CommitMessageIncrementing.Value; + Ignore = configuration.Ignore; + TracksReleaseBranches = branchConfiguration.TracksReleaseBranches ?? false; + IsReleaseBranch = branchConfiguration.IsReleaseBranch ?? false; + IsMainBranch = branchConfiguration.IsMainBranch ?? false; + CommitDateFormat = configuration.CommitDateFormat; + UpdateBuildNumber = configuration.UpdateBuildNumber; + SemanticVersionFormat = configuration.SemanticVersionFormat; + VersionStrategy = configuration.VersionStrategy; + PreReleaseWeight = branchConfiguration.PreReleaseWeight ?? 0; + TagPreReleaseWeight = configuration.TagPreReleaseWeight.Value; + } + + public bool TracksReleaseBranches { get; } + public bool IsReleaseBranch { get; } + public bool IsMainBranch { get; } + public DeploymentMode DeploymentMode { get; } + public AssemblyVersioningScheme AssemblyVersioningScheme { get; } + public AssemblyFileVersioningScheme AssemblyFileVersioningScheme { get; } + public string? AssemblyInformationalFormat { get; } + public string? AssemblyVersioningFormat { get; } + public string? AssemblyFileVersioningFormat { get; } + + public string? TagPrefix { get; } + + public string? VersionInBranchPattern { get; } + + public string? Label { get; } + + public string? NextVersion { get; } + + public IncrementStrategy Increment { get; } + + [StringSyntax(StringSyntaxAttribute.Regex)] + public string? RegularExpression { get; } + + public bool PreventIncrementOfMergedBranch { get; } + + public bool PreventIncrementWhenBranchMerged { get; } + + public bool PreventIncrementWhenCurrentCommitTagged { get; } + + public bool TrackMergeTarget { get; } + + public bool TrackMergeMessage { get; } + + public string? MajorVersionBumpMessage { get; } + + public string? MinorVersionBumpMessage { get; } + + public string? PatchVersionBumpMessage { get; } + + public string? NoBumpMessage { get; } + + public CommitMessageIncrementMode CommitMessageIncrementing { get; } + + public IIgnoreConfiguration Ignore { get; } + + public string? CommitDateFormat { get; } + + public bool UpdateBuildNumber { get; } + + public SemanticVersionFormat SemanticVersionFormat { get; } + + public VersionStrategies VersionStrategy { get; } + + public int PreReleaseWeight { get; } + + public int TagPreReleaseWeight { get; } +} diff --git a/src/GitVersion.Core/Configuration/IBranchConfiguration.cs b/src/GitVersion.Core/Configuration/IBranchConfiguration.cs new file mode 100644 index 0000000000..f3e6730ac2 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IBranchConfiguration.cs @@ -0,0 +1,52 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Core; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +public interface IBranchConfiguration +{ + DeploymentMode? DeploymentMode { get; } + + string? Label { get; } + + IncrementStrategy Increment { get; } + + IPreventIncrementConfiguration PreventIncrement { get; } + + bool? TrackMergeTarget { get; } + + bool? TrackMergeMessage { get; } + + CommitMessageIncrementMode? CommitMessageIncrementing { get; } + + [StringSyntax(StringSyntaxAttribute.Regex)] + string? RegularExpression { get; } + + bool IsMatch(string branchName) + { + if (string.IsNullOrWhiteSpace(RegularExpression)) + { + return false; + } + + var regex = RegexPatterns.Cache.GetOrAdd(RegularExpression); + return regex.IsMatch(branchName); + } + + IReadOnlyCollection SourceBranches { get; } + + IReadOnlyCollection IsSourceBranchFor { get; } + + bool? TracksReleaseBranches { get; } + + bool? IsReleaseBranch { get; } + + bool? IsMainBranch { get; } + + int? PreReleaseWeight { get; } + + IBranchConfiguration Inherit(IBranchConfiguration configuration); + + IBranchConfiguration Inherit(EffectiveConfiguration configuration); +} diff --git a/src/GitVersion.Core/Configuration/IConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/IConfigurationBuilder.cs new file mode 100644 index 0000000000..e6827f7a0a --- /dev/null +++ b/src/GitVersion.Core/Configuration/IConfigurationBuilder.cs @@ -0,0 +1,8 @@ +namespace GitVersion.Configuration; + +public interface IConfigurationBuilder +{ + void AddOverride(IReadOnlyDictionary value); + + IGitVersionConfiguration Build(); +} diff --git a/src/GitVersion.Core/Configuration/IConfigurationFileLocator.cs b/src/GitVersion.Core/Configuration/IConfigurationFileLocator.cs new file mode 100644 index 0000000000..24ff54d935 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IConfigurationFileLocator.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Configuration; + +public interface IConfigurationFileLocator +{ + void Verify(string? workingDirectory, string? projectRootDirectory); + string? GetConfigurationFile(string? directoryPath); +} diff --git a/src/GitVersion.Core/Configuration/IConfigurationProvider.cs b/src/GitVersion.Core/Configuration/IConfigurationProvider.cs new file mode 100644 index 0000000000..14a4731776 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IConfigurationProvider.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Configuration; + +public interface IConfigurationProvider +{ + IGitVersionConfiguration Provide(IReadOnlyDictionary? overrideConfiguration = null); +} diff --git a/src/GitVersion.Core/Configuration/IConfigurationSerializer.cs b/src/GitVersion.Core/Configuration/IConfigurationSerializer.cs new file mode 100644 index 0000000000..b290f254bc --- /dev/null +++ b/src/GitVersion.Core/Configuration/IConfigurationSerializer.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Configuration; + +internal interface IConfigurationSerializer +{ + T Deserialize(string input); + string Serialize(object graph); +} diff --git a/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs new file mode 100644 index 0000000000..1461d38034 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs @@ -0,0 +1,50 @@ +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +public interface IGitVersionConfiguration : IBranchConfiguration +{ + string? Workflow { get; } + + AssemblyVersioningScheme? AssemblyVersioningScheme { get; } + + AssemblyFileVersioningScheme? AssemblyFileVersioningScheme { get; } + + string? AssemblyInformationalFormat { get; } + + string? AssemblyVersioningFormat { get; } + + string? AssemblyFileVersioningFormat { get; } + + string? TagPrefixPattern { get; } + + string? VersionInBranchPattern { get; } + + string? NextVersion { get; } + + string? MajorVersionBumpMessage { get; } + + string? MinorVersionBumpMessage { get; } + + string? PatchVersionBumpMessage { get; } + + string? NoBumpMessage { get; } + + int? TagPreReleaseWeight { get; } + + string? CommitDateFormat { get; } + + IReadOnlyDictionary MergeMessageFormats { get; } + + bool UpdateBuildNumber { get; } + + SemanticVersionFormat SemanticVersionFormat { get; } + + VersionStrategies VersionStrategy { get; } + + IReadOnlyDictionary Branches { get; } + + IIgnoreConfiguration Ignore { get; } + + IBranchConfiguration GetEmptyBranchConfiguration(); +} diff --git a/src/GitVersion.Core/Configuration/IIgnoreConfiguration.cs b/src/GitVersion.Core/Configuration/IIgnoreConfiguration.cs new file mode 100644 index 0000000000..ea19f6d746 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IIgnoreConfiguration.cs @@ -0,0 +1,12 @@ +namespace GitVersion.Configuration; + +public interface IIgnoreConfiguration +{ + DateTimeOffset? Before { get; } + + IReadOnlySet Shas { get; } + + IReadOnlyCollection Paths { get; } + + bool IsEmpty { get; } +} diff --git a/src/GitVersion.Core/Configuration/IPreventIncrementConfiguration.cs b/src/GitVersion.Core/Configuration/IPreventIncrementConfiguration.cs new file mode 100644 index 0000000000..bc8c1b9460 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IPreventIncrementConfiguration.cs @@ -0,0 +1,10 @@ +namespace GitVersion.Configuration; + +public interface IPreventIncrementConfiguration +{ + bool? OfMergedBranch { get; } + + bool? WhenBranchMerged { get; } + + bool? WhenCurrentCommitTagged { get; } +} diff --git a/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs b/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs new file mode 100644 index 0000000000..d58cd9be89 --- /dev/null +++ b/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs @@ -0,0 +1,26 @@ +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.Configuration; + +internal static class IgnoreConfigurationExtensions +{ + public static IEnumerable Filter(this IIgnoreConfiguration ignore, ITag[] source) + { + ignore.NotNull(); + source.NotNull(); + + return !ignore.IsEmpty ? source.Where(element => ShouldBeIgnored(element.Commit, ignore)) : source; + } + + public static IEnumerable Filter(this IIgnoreConfiguration ignore, ICommit[] source) + { + ignore.NotNull(); + source.NotNull(); + + return !ignore.IsEmpty ? source.Where(element => ShouldBeIgnored(element, ignore)) : source; + } + + private static bool ShouldBeIgnored(ICommit commit, IIgnoreConfiguration ignore) + => !ignore.ToFilters().Any(filter => filter.Exclude(commit, out _)); +} diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs deleted file mode 100644 index f2a9e1e1be..0000000000 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs +++ /dev/null @@ -1,133 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.BuildServer; - -internal enum ProjectVisibility -{ - Public = 0, - Private = 1 -} - -internal class AppVeyorSetup : ConfigInitWizardStep -{ - private ProjectVisibility projectVisibility; - - public AppVeyorSetup(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - public AppVeyorSetup WithData(ProjectVisibility visibility) - { - this.projectVisibility = visibility; - return this; - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - var editConfigStep = this.StepFactory.CreateStep(); - switch (result) - { - case "0": - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "1": - GenerateBasicConfig(workingDirectory); - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "2": - GenerateNuGetConfig(workingDirectory); - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - } - return StepResult.InvalidResponseSelected(); - } - - private static string GetGvCommand(ProjectVisibility visibility) => visibility switch - { - ProjectVisibility.Public => " - ps: gitversion /l console /output buildserver /updateAssemblyInfo", - ProjectVisibility.Private => " - ps: gitversion $env:APPVEYOR_BUILD_FOLDER /l console /output buildserver /updateAssemblyInfo /nofetch /b $env:APPVEYOR_REPO_BRANCH", - _ => "" - }; - - private void GenerateBasicConfig(string workingDirectory) => WriteConfig(workingDirectory, this.FileSystem, $@"install: - - choco install gitversion.portable -pre -y - -before_build: - - nuget restore -{GetGvCommand(this.projectVisibility)} - -build: - project: "); - - private void GenerateNuGetConfig(string workingDirectory) => WriteConfig(workingDirectory, this.FileSystem, $@"install: - - choco install gitversion.portable -pre -y - -assembly_info: - patch: false - -before_build: - - nuget restore -{GetGvCommand(this.projectVisibility)} - -build: - project: - -after_build: - - cmd: ECHO nuget pack \.nuspec -version ""%GitVersion_NuGetVersion%"" -prop ""target=%CONFIGURATION%"" - - cmd: nuget pack \.nuspec -version ""%GitVersion_NuGetVersion%"" -prop ""target=%CONFIGURATION%"" - - cmd: appveyor PushArtifact "".%GitVersion_NuGetVersion%.nupkg"""); - - private void WriteConfig(string workingDirectory, IFileSystem fileSystem, string configContents) - { - var outputFilename = GetOutputFilename(workingDirectory, fileSystem); - fileSystem.WriteAllText(outputFilename, configContents); - this.Log.Info($"AppVeyor sample config file written to {outputFilename}"); - } - - protected override string GetPrompt(Config config, string workingDirectory) - { - var prompt = new StringBuilder(); - if (AppVeyorConfigExists(workingDirectory, this.FileSystem)) - { - prompt.AppendLine("GitVersion doesn't support modifying existing appveyor config files. We will generate appveyor.gitversion.yml instead"); - prompt.AppendLine(); - } - - prompt.Append(@"What sort of config template would you like generated? - -0) Go Back -1) Generate basic (gitversion + msbuild) configuration -2) Generate with NuGet package publish"); - - return prompt.ToString(); - } - - private static string GetOutputFilename(string workingDirectory, IFileSystem fileSystem) - { - if (AppVeyorConfigExists(workingDirectory, fileSystem)) - { - var count = 0; - do - { - var path = PathHelper.Combine(workingDirectory, $"appveyor.gitversion{(count == 0 ? string.Empty : "." + count)}.yml"); - - if (!fileSystem.Exists(path)) - { - return path; - } - - count++; - } while (count < 10); - throw new Exception("appveyor.gitversion.yml -> appveyor.gitversion.9.yml all exist. Pretty sure you have enough templates"); - } - - return PathHelper.Combine(workingDirectory, "appveyor.yml"); - } - - private static bool AppVeyorConfigExists(string workingDirectory, IFileSystem fileSystem) => fileSystem.Exists(PathHelper.Combine(workingDirectory, "appveyor.yml")); - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs deleted file mode 100644 index 53e0ae5bba..0000000000 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs +++ /dev/null @@ -1,39 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.BuildServer; - -internal class AppveyorPublicPrivate : ConfigInitWizardStep -{ - public AppveyorPublicPrivate(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result) - { - case "0": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "1": - steps.Enqueue(this.StepFactory.CreateStep().WithData(ProjectVisibility.Public)); - return StepResult.Ok(); - case "2": - steps.Enqueue(this.StepFactory.CreateStep().WithData(ProjectVisibility.Private)); - return StepResult.Ok(); - } - return StepResult.Ok(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"Is your project public or private? - -That is ... does it require authentication to clone/pull? - -0) Go Back -1) Public -2) Private"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs deleted file mode 100644 index 9cb9dc52c6..0000000000 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs +++ /dev/null @@ -1,35 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.BuildServer; - -internal class SetupBuildScripts : ConfigInitWizardStep -{ - public SetupBuildScripts(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result) - { - case "0": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "1": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - return StepResult.Ok(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"What build server are you using? - -Want to see more? Contribute a pull request! - -0) Go Back -1) AppVeyor"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs b/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs deleted file mode 100644 index 4ebc2962ed..0000000000 --- a/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs +++ /dev/null @@ -1,63 +0,0 @@ -using GitVersion.Configuration.Init.BuildServer; -using GitVersion.Configuration.Init.SetConfig; -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init; - -public class EditConfigStep : ConfigInitWizardStep -{ - public EditConfigStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result) - { - case "0": - return StepResult.SaveAndExit(); - case "1": - return StepResult.ExitWithoutSaving(); - - case "2": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - - case "3": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - - case "4": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "5": - var editConfigStep = this.StepFactory.CreateStep(); - steps.Enqueue(this.StepFactory.CreateStep().WithData(editConfigStep, false)); - return StepResult.Ok(); - case "6": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "7": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => $@"Which would you like to change? - -0) Save changes and exit -1) Exit without saving - -2) Run getting started wizard - -3) Set next version number -4) Branch specific configuration -5) Branch Increment mode (per commit/after tag) (Current: {config.VersioningMode}) -6) Assembly versioning scheme (Current: {config.AssemblyVersioningScheme}) -7) Setup build scripts"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs b/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs deleted file mode 100644 index 156fca30c7..0000000000 --- a/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs +++ /dev/null @@ -1,20 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.Configuration.Init; - -public class GitVersionInitModule : GitVersionModule -{ - public override void RegisterTypes(IServiceCollection services) - { - services.AddTransient(); - services.AddTransient(); - - var steps = FindAllDerivedTypes(Assembly.GetAssembly(GetType())); - - foreach (var step in steps) - { - services.AddTransient(step); - } - } -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs deleted file mode 100644 index df1ff061f6..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs +++ /dev/null @@ -1,57 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class AssemblyVersioningSchemeSetting : ConfigInitWizardStep -{ - public AssemblyVersioningSchemeSetting(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - var editConfigStep = this.StepFactory.CreateStep(); - switch (result) - { - case "0": - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "1": - config.AssemblyVersioningScheme = AssemblyVersioningScheme.Major; - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "2": - config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor; - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "3": - config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch; - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "4": - config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag; - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - case "5": - config.AssemblyVersioningScheme = AssemblyVersioningScheme.None; - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"What assembly versioning scheme do you want to use: - -0) Go Back -1) Major.0.0.0 -2) Major.Minor.0.0 -3) Major.Minor.Patch.0 (default) -4) Major.Minor.Patch.TagCount (Allows different pre-release tags to cause assembly version to change) -5) None (skip's updating AssemblyVersion)"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs deleted file mode 100644 index 470257f4ba..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class ConfigureBranch : ConfigInitWizardStep -{ - private string name; - private BranchConfig branchConfig; - - public ConfigureBranch(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - public ConfigureBranch WithData(string configName, BranchConfig config) - { - this.branchConfig = config; - this.name = configName; - return this; - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result) - { - case "0": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "1": - steps.Enqueue(this.StepFactory.CreateStep().WithData(name, branchConfig)); - return StepResult.Ok(); - case "2": - steps.Enqueue(this.StepFactory.CreateStep().WithData(name, branchConfig)); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => $@"What would you like to change for '{this.name}': - -0) Go Back -1) Branch Pre-release tag (Current: {this.branchConfig.Tag}) -2) Branch Increment mode (per commit/after tag) (Current: {this.branchConfig.VersioningMode})"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs deleted file mode 100644 index 4f95a3843f..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs +++ /dev/null @@ -1,59 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class ConfigureBranches : ConfigInitWizardStep -{ - public ConfigureBranches(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - if (int.TryParse(result, out var parsed)) - { - if (parsed == 0) - { - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - - try - { - var foundBranch = OrderedBranches(config).ElementAt(parsed - 1); - var branchConfig = foundBranch.Value; - if (branchConfig == null) - { - branchConfig = new BranchConfig { Name = foundBranch.Key }; - config.Branches.Add(foundBranch.Key, branchConfig); - } - steps.Enqueue(this.StepFactory.CreateStep().WithData(foundBranch.Key, branchConfig)); - return StepResult.Ok(); - } - catch (ArgumentOutOfRangeException) - { } - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"Which branch would you like to configure: - -0) Go Back -" + string.Join(System.Environment.NewLine, OrderedBranches(config).Select((c, i) => $"{i + 1}) {c.Key}")); - - private static IOrderedEnumerable> OrderedBranches(Config config) - { - var defaultConfig = new ConfigurationBuilder().Build(); - - var defaultConfigurationBranches = defaultConfig.Branches - .Where(k => !config.Branches.ContainsKey(k.Key)) - // Return an empty branch config - .Select(v => new KeyValuePair(v.Key, new BranchConfig())); - return config.Branches.Union(defaultConfigurationBranches).OrderBy(b => b.Key); - } - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs deleted file mode 100644 index 97e33b2389..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs +++ /dev/null @@ -1,57 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class GlobalModeSetting : ConfigInitWizardStep -{ - private ConfigInitWizardStep returnToStep; - private bool isPartOfWizard; - - protected GlobalModeSetting(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - public GlobalModeSetting WithData(ConfigInitWizardStep returnStep, bool isPartOfTheWizard) - { - this.returnToStep = returnStep; - this.isPartOfWizard = isPartOfTheWizard; - return this; - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result) - { - case "1": - config.VersioningMode = VersioningMode.ContinuousDelivery; - steps.Enqueue(this.returnToStep); - return StepResult.Ok(); - case "2": - config.VersioningMode = VersioningMode.ContinuousDeployment; - steps.Enqueue(this.returnToStep); - return StepResult.Ok(); - case "3": - config.VersioningMode = VersioningMode.Mainline; - steps.Enqueue(this.returnToStep); - return StepResult.Ok(); - case "0": - case "4": - steps.Enqueue(this.returnToStep); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => $@"What do you want the default increment mode to be (can be overriden per branch): -{(!this.isPartOfWizard ? "0) Go Back" : string.Empty)} -1) Follow SemVer and only increment when a release has been tagged (continuous delivery mode) -2) Increment based on branch config every commit (continuous deployment mode) -3) Each merged branch against main will increment the version (mainline mode) -{(this.isPartOfWizard ? "4) Skip" : string.Empty)}"; - - protected override string DefaultResult => "4"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs deleted file mode 100644 index 21fdfa667d..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs +++ /dev/null @@ -1,52 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Logging; -using GitVersion.Model.Configuration; -using GitVersion.VersionCalculation; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class SetBranchIncrementMode : ConfigInitWizardStep -{ - private string name; - private BranchConfig branchConfig; - - public SetBranchIncrementMode(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - public SetBranchIncrementMode WithData(string configName, BranchConfig config) - { - this.branchConfig = config; - this.name = configName; - return this; - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - var configureBranchStep = this.StepFactory.CreateStep(); - switch (result) - { - case "0": - steps.Enqueue(configureBranchStep.WithData(this.name, this.branchConfig)); - return StepResult.Ok(); - case "1": - this.branchConfig.VersioningMode = VersioningMode.ContinuousDelivery; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfig)); - return StepResult.Ok(); - case "2": - this.branchConfig.VersioningMode = VersioningMode.ContinuousDeployment; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfig)); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => $@"What do you want the increment mode for {this.name} to be? - -0) Go Back -1) Follow SemVer and only increment when a release has been tagged (continuous delivery mode) -2) Increment based on branch config every commit (continuous deployment mode)"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs deleted file mode 100644 index 1025c8a207..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs +++ /dev/null @@ -1,56 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.SetConfig; - -public class SetBranchTag : ConfigInitWizardStep -{ - private string name; - private BranchConfig branchConfig; - - public SetBranchTag(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - public SetBranchTag WithData(string configName, BranchConfig config) - { - this.branchConfig = config; - this.name = configName; - return this; - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - if (result.IsNullOrWhiteSpace()) - { - return StepResult.InvalidResponseSelected(); - } - - var configureBranchStep = this.StepFactory.CreateStep(); - switch (result) - { - case "0": - steps.Enqueue(configureBranchStep.WithData(this.name, this.branchConfig)); - return StepResult.Ok(); - case "1": - this.branchConfig.Tag = string.Empty; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfig)); - return StepResult.Ok(); - default: - this.branchConfig.Tag = result; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfig)); - return StepResult.Ok(); - } - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"This sets the pre-release tag which will be used for versions on this branch (beta, rc etc) - -0) Go Back -1) No tag - -Anything else will be used as the tag"; - - protected override string DefaultResult => "0"; -} diff --git a/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs b/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs deleted file mode 100644 index f9fb5d1012..0000000000 --- a/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs +++ /dev/null @@ -1,34 +0,0 @@ -using GitVersion.Configuration.Init.Wizard; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init; - -public class SetNextVersion : ConfigInitWizardStep -{ - public SetNextVersion(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - var editConfigStep = this.StepFactory.CreateStep(); - if (result.IsNullOrEmpty()) - { - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - } - - if (!SemanticVersion.TryParse(result, string.Empty, out var semVer)) - return StepResult.InvalidResponseSelected(); - - config.NextVersion = semVer.ToString("t"); - steps.Enqueue(editConfigStep); - return StepResult.Ok(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => "What would you like to set the next version to (enter nothing to cancel)?"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/Init/StepResult.cs b/src/GitVersion.Core/Configuration/Init/StepResult.cs deleted file mode 100644 index b3cd1ea9ee..0000000000 --- a/src/GitVersion.Core/Configuration/Init/StepResult.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace GitVersion.Configuration.Init; - -public class StepResult -{ - private StepResult() { } - - public static StepResult Ok() => new(); - - public static StepResult InvalidResponseSelected() => new() - { - InvalidResponse = true - }; - - public static StepResult SaveAndExit() => new() - { - Save = true, - Exit = true - }; - - public static StepResult ExitWithoutSaving() => new() - { - Save = false, - Exit = true - }; - - public bool Exit { get; private set; } - - public bool Save { get; private set; } - - public bool InvalidResponse { get; private set; } -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs deleted file mode 100644 index f6414b5bce..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using GitVersion.Extensions; -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.Configuration.Init.Wizard; - -public class ConfigInitStepFactory : IConfigInitStepFactory -{ - private readonly IServiceProvider sp; - - public ConfigInitStepFactory() - { - } - - public ConfigInitStepFactory(IServiceProvider sp) => this.sp = sp.NotNull(); - - public T CreateStep() where T : notnull => this.sp.GetRequiredService(); -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs deleted file mode 100644 index 08b8efe00a..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs +++ /dev/null @@ -1,35 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class ConfigInitWizard : IConfigInitWizard -{ - private readonly IConsole console; - private readonly IConfigInitStepFactory stepFactory; - - public ConfigInitWizard(IConsole console, IConfigInitStepFactory stepFactory) - { - this.console = console.NotNull(); - this.stepFactory = stepFactory.NotNull(); - } - - public Config? Run(Config config, string workingDirectory) - { - this.console.WriteLine("GitVersion init will guide you through setting GitVersion up to work for you"); - var steps = new Queue(); - steps.Enqueue(this.stepFactory.CreateStep()); - - while (steps.Count > 0) - { - var currentStep = steps.Dequeue(); - if (!currentStep.Apply(steps, config, workingDirectory)) - { - return null; - } - } - - return config; - } -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs deleted file mode 100644 index 80077e2d23..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs +++ /dev/null @@ -1,70 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public abstract class ConfigInitWizardStep -{ - protected readonly IConsole Console; - protected readonly IFileSystem FileSystem; - protected readonly ILog Log; - protected readonly IConfigInitStepFactory StepFactory; - - protected ConfigInitWizardStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) - { - this.Console = console.NotNull(); - this.FileSystem = fileSystem.NotNull(); - this.Log = log.NotNull(); - this.StepFactory = stepFactory.NotNull(); - } - - public bool Apply(Queue steps, Config config, string workingDirectory) - { - this.Console.WriteLine(); - this.Console.WriteLine(GetPrompt(config, workingDirectory)); - this.Console.WriteLine(); - this.Console.Write("> "); - var input = this.Console.ReadLine(); - if (input == null) - { - this.Console.WriteLine("Would you like to save changes? (y/n)"); - input = this.Console.ReadLine(); - if (input == null || input.ToLower() == "n") return false; - if (input.ToLower() == "y") - { - steps.Clear(); - return true; - } - - InvalidResponse(steps); - return true; - } - var resultWithDefaultApplied = input.IsNullOrEmpty() ? DefaultResult : input; - var stepResult = HandleResult(resultWithDefaultApplied, steps, config, workingDirectory); - if (stepResult.InvalidResponse) - { - InvalidResponse(steps); - } - else if (stepResult.Exit) - { - steps.Clear(); - return stepResult.Save; - } - return true; - } - - private void InvalidResponse(Queue steps) - { - this.Console.WriteLine(); - using (this.Console.UseColor(ConsoleColor.Red)) - { - this.Console.WriteLine("Invalid response!"); - } - steps.Enqueue(this); - } - - protected abstract StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory); - protected abstract string GetPrompt(Config config, string workingDirectory); - protected abstract string? DefaultResult { get; } -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs deleted file mode 100644 index 185c903125..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs +++ /dev/null @@ -1,13 +0,0 @@ -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class FinishedSetupStep : EditConfigStep -{ - public FinishedSetupStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override string GetPrompt(Config config, string workingDirectory) => $"Questions are all done, you can now edit GitVersion's configuration further{System.Environment.NewLine}" + base.GetPrompt(config, workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs deleted file mode 100644 index 4df17baa97..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs +++ /dev/null @@ -1,15 +0,0 @@ -using GitVersion.Configuration.Init.SetConfig; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class GitFlowSetupStep : GlobalModeSetting -{ - public GitFlowSetupStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override string GetPrompt(Config config, string workingDirectory) => $"By default GitVersion will only increment the version of the 'develop' branch every commit, all other branches will increment when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + - base.GetPrompt(config, workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs deleted file mode 100644 index e0ea2bc4b5..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GitVersion.Configuration.Init.SetConfig; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class GitHubFlowStep : GlobalModeSetting -{ - public GitHubFlowStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override string GetPrompt(Config config, string workingDirectory) => $"By default GitVersion will only increment the version when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + base.GetPrompt(config, workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs deleted file mode 100644 index e5d249d61e..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitVersion.Configuration.Init.Wizard; - -public interface IConfigInitStepFactory -{ - T CreateStep() where T : notnull; -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs deleted file mode 100644 index 54c67cf81d..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs +++ /dev/null @@ -1,8 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public interface IConfigInitWizard -{ - Config? Run(Config config, string workingDirectory); -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs deleted file mode 100644 index 4cef9bcc14..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs +++ /dev/null @@ -1,35 +0,0 @@ -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class PickBranchingStrategy1Step : ConfigInitWizardStep -{ - public PickBranchingStrategy1Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result?.ToLower()) - { - case "y": - this.Console.Write(@"Because you need to maintain multiple versions of your product in production at the same time, GitFlow is likely a good fit. - -GitFlow allows you to have new development happening on the 'develop' branch, patch issues in old minor versions with 'hotfix/' branches and support old major versions with 'support/' branches"); - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "n": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"GitVersion can try to recommend you a branching strategy based on a few questions. - -Do you need to maintain multiple versions of your application simultaneously in production? (y/n)"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs deleted file mode 100644 index 0ad218e2a6..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs +++ /dev/null @@ -1,36 +0,0 @@ -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class PickBranchingStrategy2Step : ConfigInitWizardStep -{ - public PickBranchingStrategy2Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result?.ToLower()) - { - case "y": - this.Console.WriteLine("GitFlow is likely a good fit, the 'develop' branch can be used " + - "for active development while stabilising the next release."); - this.Console.WriteLine(); - this.Console.WriteLine("GitHubFlow is designed for a lightweight workflow where main is always " + - "good to deploy to production and feature branches are used to stabilise " + - "features, once stable they are merged to main and made available in the next release"); - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - case "n": - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - - return StepResult.InvalidResponseSelected(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => "Do you stabilise releases while continuing work on the next version? (y/n)"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs deleted file mode 100644 index e42c540bc2..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs +++ /dev/null @@ -1,37 +0,0 @@ -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class PickBranchingStrategy3Step : ConfigInitWizardStep -{ - public PickBranchingStrategy3Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - switch (result?.ToLower()) - { - case "y": - this.Console.WriteLine("GitFlow could be a better fit than GitHubFlow for you."); - this.Console.WriteLine(); - this.Console.WriteLine("GitVersion increments the SemVer for each commit on the develop branch by default, " + - "this means all packages built from develop can be published to a single NuGet feed."); - break; - case "n": - this.Console.WriteLine("We recommend the GitHubFlow branching strategy, it sounds like you will " + - "not benefit from the additional complexity that GitFlow introduces"); - break; - default: - return StepResult.InvalidResponseSelected(); - } - - steps.Enqueue(this.StepFactory.CreateStep()); - return StepResult.Ok(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => "Do you need to build nightly or consume packages the CI build creates without releasing those versions? (y/n)"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs deleted file mode 100644 index 458b75d6c9..0000000000 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs +++ /dev/null @@ -1,40 +0,0 @@ -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.Configuration.Init.Wizard; - -public class PickBranchingStrategyStep : ConfigInitWizardStep -{ - public PickBranchingStrategyStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) - { - } - - protected override StepResult HandleResult(string? result, Queue steps, Config config, string workingDirectory) - { - var returnToStep = this.StepFactory.CreateStep(); - switch (result) - { - case "1": - steps.Enqueue(this.StepFactory.CreateStep().WithData(returnToStep, true)); - break; - case "2": - steps.Enqueue(this.StepFactory.CreateStep().WithData(returnToStep, true)); - break; - case "3": - steps.Enqueue(this.StepFactory.CreateStep()); - break; - default: - return StepResult.InvalidResponseSelected(); - } - - return StepResult.Ok(); - } - - protected override string GetPrompt(Config config, string workingDirectory) => @"The way you will use GitVersion will change a lot based on your branching strategy. What branching strategy will you be using: - -1) GitFlow (or similar) -2) GitHubFlow -3) Unsure, tell me more"; - - protected override string? DefaultResult => null; -} diff --git a/src/GitVersion.Core/Configuration/ReferenceNameExtensions.cs b/src/GitVersion.Core/Configuration/ReferenceNameExtensions.cs new file mode 100644 index 0000000000..9dda4c2521 --- /dev/null +++ b/src/GitVersion.Core/Configuration/ReferenceNameExtensions.cs @@ -0,0 +1,54 @@ +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.Configuration; + +public static class ReferenceNameExtensions +{ + public static bool TryGetSemanticVersion(this ReferenceName source, out (SemanticVersion Value, string? Name) result, EffectiveConfiguration configuration) + => source.TryGetSemanticVersion(out result, configuration.VersionInBranchPattern, configuration.TagPrefix, configuration.SemanticVersionFormat); + + public static bool TryGetSemanticVersion(this ReferenceName source, out (SemanticVersion Value, string? Name) result, IGitVersionConfiguration configuration) + => source.TryGetSemanticVersion(out result, configuration.VersionInBranchPattern, configuration.TagPrefixPattern, configuration.SemanticVersionFormat); + + private static bool TryGetSemanticVersion(this ReferenceName referenceName, out (SemanticVersion Value, string? Name) result, + string? versionPatternPattern, + string? tagPrefix, + SemanticVersionFormat format) + { + var versionPatternRegex = RegexPatterns.Cache.GetOrAdd(GetVersionInBranchPattern(versionPatternPattern)); + result = default; + + var length = 0; + foreach (var branchPart in referenceName.WithoutOrigin.Split(GetBranchSeparator())) + { + if (string.IsNullOrEmpty(branchPart)) return false; + + var match = versionPatternRegex.Match(branchPart); + if (match.Success) + { + var versionPart = match.Groups["version"].Value; + if (SemanticVersion.TryParse(versionPart, tagPrefix, out var semanticVersion, format)) + { + length += versionPart.Length; + var name = referenceName.WithoutOrigin[length..].Trim('-'); + result = new(semanticVersion, name.Length == 0 ? null : name); + return true; + } + } + + length += branchPart.Length + 1; + } + + return false; + + char GetBranchSeparator() => referenceName.WithoutOrigin.Contains('/') || !referenceName.WithoutOrigin.Contains('-') ? '/' : '-'; + + static string GetVersionInBranchPattern(string? versionInBranchPattern) + { + if (versionInBranchPattern.IsNullOrEmpty()) versionInBranchPattern = RegexPatterns.Configuration.DefaultVersionInBranchRegexPattern; + return $"^{versionInBranchPattern.TrimStart('^')}"; + } + } +} diff --git a/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs b/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs deleted file mode 100644 index b316a76f7e..0000000000 --- a/src/GitVersion.Core/Core/Abstractions/IFileSystem.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace GitVersion; - -public interface IFileSystem -{ - void Copy(string from, string to, bool overwrite); - void Move(string from, string to); - bool Exists(string file); - void Delete(string path); - string ReadAllText(string path); - void WriteAllText(string? file, string fileContents); - void WriteAllText(string? file, string fileContents, Encoding encoding); - IEnumerable DirectoryEnumerateFiles(string? directory, string searchPattern, SearchOption searchOption); - Stream OpenWrite(string path); - Stream OpenRead(string path); - void CreateDirectory(string path); - bool DirectoryExists(string path); - long GetLastDirectoryWrite(string path); - - bool PathsEqual(string? path, string? otherPath); -} diff --git a/src/GitVersion.Core/Core/Abstractions/IGitPreparer.cs b/src/GitVersion.Core/Core/Abstractions/IGitPreparer.cs index 8fede694f1..8e47f43328 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitPreparer.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitPreparer.cs @@ -1,3 +1,5 @@ +using GitVersion.Git; + namespace GitVersion; public interface IGitPreparer diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs index 94f2e5c1d0..24c86e9428 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs @@ -4,5 +4,5 @@ namespace GitVersion; public interface IGitVersionCalculateTool { - VersionVariables CalculateVersionVariables(); + GitVersionVariables CalculateVersionVariables(); } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionContextFactory.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionContextFactory.cs index fce0d6d991..0704022818 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionContextFactory.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitVersionContextFactory.cs @@ -2,5 +2,5 @@ namespace GitVersion; public interface IGitVersionContextFactory { - GitVersionContext Create(GitVersionOptions gitVersionOptions); + GitVersionContext Create(); } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs index e1461d9fc2..0d8e217a35 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs @@ -1,3 +1,4 @@ +using GitVersion.Extensions; using Microsoft.Extensions.DependencyInjection; namespace GitVersion; @@ -5,4 +6,12 @@ namespace GitVersion; public interface IGitVersionModule { void RegisterTypes(IServiceCollection services); + + static IEnumerable FindAllDerivedTypes(Assembly? assembly) + { + assembly.NotNull(); + + var derivedType = typeof(T); + return assembly.GetTypes().Where(t => t != derivedType && derivedType.IsAssignableFrom(t)); + } } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs deleted file mode 100644 index a20f5a9ecf..0000000000 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs +++ /dev/null @@ -1,11 +0,0 @@ -using GitVersion.OutputVariables; - -namespace GitVersion; - -public interface IGitVersionOutputTool -{ - void OutputVariables(VersionVariables variables, bool updateBuildNumber); - void UpdateAssemblyInfo(VersionVariables variables); - void UpdateWixVersionFile(VersionVariables variables); - void GenerateGitVersionInformation(VersionVariables variables, FileWriteInfo fileWriteInfo); -} diff --git a/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs b/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs index 3644ba26b9..18fc7edd92 100644 --- a/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs +++ b/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs @@ -1,43 +1,40 @@ -using GitVersion.Model.Configuration; +using GitVersion.Configuration; +using GitVersion.Git; namespace GitVersion.Common; public interface IRepositoryStore { + int UncommittedChangesCount { get; } + IBranch Head { get; } + IBranchCollection Branches { get; } + ITagCollection Tags { get; } + /// /// Find the merge base of the two branches, i.e. the best common ancestor of the two branches' tips. /// ICommit? FindMergeBase(IBranch? branch, IBranch? otherBranch); ICommit? FindMergeBase(ICommit commit, ICommit mainlineTip); - ICommit? GetCurrentCommit(IBranch currentBranch, string? commitId); - ICommit GetBaseVersionSource(ICommit currentBranchTip); - IEnumerable GetMainlineCommitLog(ICommit? baseVersionSource, ICommit? mainlineTip); - IEnumerable GetMergeBaseCommits(ICommit? mergeCommit, ICommit? mergedHead, ICommit? findMergeBase); - IEnumerable GetCommitLog(ICommit? baseVersionSource, ICommit? currentCommit); + + ICommit? GetCurrentCommit(IBranch currentBranch, string? commitId, IIgnoreConfiguration ignore); + ICommit? GetForwardMerge(ICommit? commitToFindCommonBase, ICommit? findMergeBase); + + IReadOnlyList GetCommitLog(ICommit? baseVersionSource, ICommit currentCommit, IIgnoreConfiguration ignore); + IReadOnlyList GetCommitsReacheableFromHead(ICommit? headCommit, IIgnoreConfiguration ignore); + IReadOnlyList GetCommitsReacheableFrom(ICommit commit, IBranch branch); IBranch GetTargetBranch(string? targetBranchName); - IBranch? FindBranch(string? branchName); - IBranch? FindMainBranch(Config configuration); - IBranch? GetChosenBranch(Config configuration); - IEnumerable GetBranchesForCommit(ICommit commit); - IEnumerable GetExcludedInheritBranches(Config configuration); - IEnumerable GetReleaseBranches(IEnumerable> releaseBranchConfig); + IBranch? FindBranch(ReferenceName branchName); + IEnumerable ExcludingBranches(IEnumerable branchesToExclude); - IEnumerable GetBranchesContainingCommit(ICommit? commit, IEnumerable? branches = null, bool onlyTrackedBranches = false); - IDictionary> GetMainlineBranches(ICommit commit, Config configuration, IEnumerable>? mainlineBranchConfigs); + IEnumerable GetBranchesContainingCommit(ICommit commit, IEnumerable? branches = null, bool onlyTrackedBranches = false); - /// - /// Find the commit where the given branch was branched from another branch. - /// If there are multiple such commits and branches, tries to guess based on commit histories. - /// - BranchCommit FindCommitBranchWasBranchedFrom(IBranch? branch, Config configuration, params IBranch[] excludedBranches); + IEnumerable FindCommitBranchesBranchedFrom(IBranch branch, IGitVersionConfiguration configuration, params IBranch[] excludedBranches); - SemanticVersion GetCurrentCommitTaggedVersion(ICommit? commit, string? tagPrefix, bool handleDetachedBranch); - IEnumerable GetVersionTagsOnBranch(IBranch branch, string? tagPrefixRegex); - IEnumerable<(ITag Tag, SemanticVersion Semver, ICommit Commit)> GetValidVersionTags(string? tagPrefixRegex, DateTimeOffset? olderThan = null); + IEnumerable GetSourceBranches(IBranch branch, IGitVersionConfiguration configuration, params IBranch[] excludedBranches); - bool IsCommitOnBranch(ICommit? baseVersionSource, IBranch branch, ICommit firstMatchingCommit); + IEnumerable GetSourceBranches(IBranch branch, IGitVersionConfiguration configuration, IEnumerable excludedBranches); - int GetNumberOfUncommittedChanges(); + bool IsCommitOnBranch(ICommit? baseVersionSource, IBranch branch, ICommit firstMatchingCommit); } diff --git a/src/GitVersion.Core/Core/BranchRepository.cs b/src/GitVersion.Core/Core/BranchRepository.cs new file mode 100644 index 0000000000..6d54eafe53 --- /dev/null +++ b/src/GitVersion.Core/Core/BranchRepository.cs @@ -0,0 +1,33 @@ +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.Core; + +internal sealed class BranchRepository(IRepositoryStore repositoryStore) : IBranchRepository +{ + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + + public IEnumerable GetMainBranches(IGitVersionConfiguration configuration, params IBranch[] excludeBranches) + => GetBranches(configuration, [.. excludeBranches], branchConfiguration => branchConfiguration.IsMainBranch == true); + + public IEnumerable GetReleaseBranches(IGitVersionConfiguration configuration, params IBranch[] excludeBranches) + => GetBranches(configuration, [.. excludeBranches], branchConfiguration => branchConfiguration.IsReleaseBranch == true); + + private IEnumerable GetBranches( + IGitVersionConfiguration configuration, HashSet excludeBranches, Func predicate) + { + predicate.NotNull(); + + foreach (var branch in this.repositoryStore.Branches) + { + if (excludeBranches.Contains(branch)) continue; + var branchConfiguration = configuration.GetBranchConfiguration(branch.Name); + if (predicate(branchConfiguration)) + { + yield return branch; + } + } + } +} diff --git a/src/GitVersion.Core/Core/BranchesContainingCommitFinder.cs b/src/GitVersion.Core/Core/BranchesContainingCommitFinder.cs index 1c4c74a1e4..d078714e98 100644 --- a/src/GitVersion.Core/Core/BranchesContainingCommitFinder.cs +++ b/src/GitVersion.Core/Core/BranchesContainingCommitFinder.cs @@ -1,23 +1,19 @@ +using GitVersion.Common; using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Logging; namespace GitVersion; -internal class BranchesContainingCommitFinder +internal class BranchesContainingCommitFinder(IRepositoryStore repositoryStore, ILog log) { - private readonly ILog log; - private readonly IGitRepository repository; + private readonly ILog log = log.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); - public BranchesContainingCommitFinder(IGitRepository repository, ILog log) + public IEnumerable GetBranchesContainingCommit(ICommit commit, IEnumerable? branches = null, bool onlyTrackedBranches = false) { - this.repository = repository.NotNull(); - this.log = log.NotNull(); - } - - public IEnumerable GetBranchesContainingCommit(ICommit? commit, IEnumerable? branches = null, bool onlyTrackedBranches = false) - { - commit = commit.NotNull(); - branches ??= this.repository.Branches.ToList(); + commit.NotNull(); + branches ??= [.. this.repositoryStore.Branches]; // TODO Should we cache this? // Yielding part is split from the main part of the method to avoid having the exception check performed lazily. @@ -25,14 +21,14 @@ public IEnumerable GetBranchesContainingCommit(ICommit? commit, IEnumer return InnerGetBranchesContainingCommit(commit, branches, onlyTrackedBranches); } - private IEnumerable InnerGetBranchesContainingCommit(IGitObject commit, IEnumerable branches, bool onlyTrackedBranches) + private IEnumerable InnerGetBranchesContainingCommit(ICommit commit, IEnumerable branches, bool onlyTrackedBranches) { using (log.IndentLog($"Getting branches containing the commit '{commit.Id}'.")) { var directBranchHasBeenFound = false; log.Info("Trying to find direct branches."); // TODO: It looks wasteful looping through the branches twice. Can't these loops be merged somehow? @asbjornu - List branchList = branches.ToList(); + var branchList = branches.ToList(); foreach (var branch in branchList.Where(branch => BranchTipIsNullOrCommit(branch, commit) && !IncludeTrackedBranches(branch, onlyTrackedBranches))) { directBranchHasBeenFound = true; @@ -46,11 +42,11 @@ private IEnumerable InnerGetBranchesContainingCommit(IGitObject commit, } log.Info($"No direct branches found, searching through {(onlyTrackedBranches ? "tracked" : "all")} branches."); - foreach (IBranch branch in branchList.Where(b => IncludeTrackedBranches(b, onlyTrackedBranches))) + foreach (var branch in branchList.Where(b => IncludeTrackedBranches(b, onlyTrackedBranches))) { log.Info($"Searching for commits reachable from '{branch}'."); - var commits = GetCommitsReacheableFrom(commit, branch); + var commits = this.repositoryStore.GetCommitsReacheableFrom(commit, branch); if (!commits.Any()) { @@ -64,17 +60,9 @@ private IEnumerable InnerGetBranchesContainingCommit(IGitObject commit, } } - private IEnumerable GetCommitsReacheableFrom(IGitObject commit, IBranch branch) - { - var filter = new CommitFilter { IncludeReachableFrom = branch }; - var commitCollection = this.repository.Commits.QueryBy(filter); - - return commitCollection.Where(c => c.Sha == commit.Sha); - } - private static bool IncludeTrackedBranches(IBranch branch, bool includeOnlyTracked) - => includeOnlyTracked && branch.IsTracking || !includeOnlyTracked; + => (includeOnlyTracked && branch.IsTracking) || !includeOnlyTracked; - private static bool BranchTipIsNullOrCommit(IBranch branch, IGitObject commit) + private static bool BranchTipIsNullOrCommit(IBranch branch, ICommit commit) => branch.Tip == null || branch.Tip.Sha == commit.Sha; } diff --git a/src/GitVersion.Core/Core/EffectiveConfigurationExtensions.cs b/src/GitVersion.Core/Core/EffectiveConfigurationExtensions.cs new file mode 100644 index 0000000000..0916dc11d3 --- /dev/null +++ b/src/GitVersion.Core/Core/EffectiveConfigurationExtensions.cs @@ -0,0 +1,30 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.Core; + +internal static class EffectiveConfigurationExtensions +{ + public static TaggedSemanticVersions GetTaggedSemanticVersion(this EffectiveConfiguration effectiveConfiguration) + { + effectiveConfiguration.NotNull(); + + var taggedSemanticVersion = TaggedSemanticVersions.OfBranch; + + if (effectiveConfiguration.TrackMergeTarget) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfMergeTargets; + } + + if (effectiveConfiguration.TracksReleaseBranches) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfReleaseBranches; + } + + if (effectiveConfiguration is { IsMainBranch: false, IsReleaseBranch: false }) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfMainBranches; + } + return taggedSemanticVersion; + } +} diff --git a/src/GitVersion.Core/Core/Environment.cs b/src/GitVersion.Core/Core/Environment.cs index 7e9200007a..cc4c99c192 100644 --- a/src/GitVersion.Core/Core/Environment.cs +++ b/src/GitVersion.Core/Core/Environment.cs @@ -1,8 +1,8 @@ namespace GitVersion; -public class Environment : IEnvironment +internal class Environment : IEnvironment { - public string? GetEnvironmentVariable(string variableName) => System.Environment.GetEnvironmentVariable(variableName); + public string? GetEnvironmentVariable(string variableName) => SysEnv.GetEnvironmentVariable(variableName); - public void SetEnvironmentVariable(string variableName, string? value) => System.Environment.SetEnvironmentVariable(variableName, value); + public void SetEnvironmentVariable(string variableName, string? value) => SysEnv.SetEnvironmentVariable(variableName, value); } diff --git a/src/GitVersion.Core/Core/Exceptions/BugException.cs b/src/GitVersion.Core/Core/Exceptions/BugException.cs new file mode 100644 index 0000000000..ba231b96eb --- /dev/null +++ b/src/GitVersion.Core/Core/Exceptions/BugException.cs @@ -0,0 +1,16 @@ +namespace GitVersion; + +public class BugException : Exception +{ + public BugException(string message) : base(message) + { + } + + public BugException() + { + } + + public BugException(string? message, Exception? innerException) : base(message, innerException) + { + } +} diff --git a/src/GitVersion.Core/Model/Exceptions/GitVersionException.cs b/src/GitVersion.Core/Core/Exceptions/GitVersionException.cs similarity index 53% rename from src/GitVersion.Core/Model/Exceptions/GitVersionException.cs rename to src/GitVersion.Core/Core/Exceptions/GitVersionException.cs index cd74c8f98f..3fc07f140b 100644 --- a/src/GitVersion.Core/Model/Exceptions/GitVersionException.cs +++ b/src/GitVersion.Core/Core/Exceptions/GitVersionException.cs @@ -1,16 +1,23 @@ namespace GitVersion; [Serializable] -public class GitVersionException : GitToolsException +public class GitVersionException : Exception { + public GitVersionException() + { + } + public GitVersionException(string message) : base(message) { } - public GitVersionException(string message, Exception innerException) : base(message, innerException) { } + + public GitVersionException(string messageFormat, params object[] args) : base(string.Format(messageFormat, args)) + { + } } diff --git a/src/GitVersion.Core/Core/Exceptions/LockedFileException.cs b/src/GitVersion.Core/Core/Exceptions/LockedFileException.cs new file mode 100644 index 0000000000..3cef30a364 --- /dev/null +++ b/src/GitVersion.Core/Core/Exceptions/LockedFileException.cs @@ -0,0 +1,20 @@ +namespace GitVersion; + +public class LockedFileException : Exception +{ + public LockedFileException(Exception inner) : base(inner.Message, inner) + { + } + + public LockedFileException() + { + } + + public LockedFileException(string? message) : base(message) + { + } + + public LockedFileException(string? message, Exception? innerException) : base(message, innerException) + { + } +} diff --git a/src/GitVersion.Core/Model/Exceptions/WarningException.cs b/src/GitVersion.Core/Core/Exceptions/WarningException.cs similarity index 50% rename from src/GitVersion.Core/Model/Exceptions/WarningException.cs rename to src/GitVersion.Core/Core/Exceptions/WarningException.cs index 4c40ff9eca..eae03f9071 100644 --- a/src/GitVersion.Core/Model/Exceptions/WarningException.cs +++ b/src/GitVersion.Core/Core/Exceptions/WarningException.cs @@ -7,4 +7,12 @@ public WarningException(string message) : base(message) { } + + public WarningException() + { + } + + public WarningException(string? message, Exception? innerException) : base(message, innerException) + { + } } diff --git a/src/GitVersion.Core/Core/FileSystem.cs b/src/GitVersion.Core/Core/FileSystem.cs deleted file mode 100644 index d8eb0b3175..0000000000 --- a/src/GitVersion.Core/Core/FileSystem.cs +++ /dev/null @@ -1,61 +0,0 @@ -using GitVersion.Helpers; - -namespace GitVersion; - -public class FileSystem : IFileSystem -{ - public void Copy(string from, string to, bool overwrite) => File.Copy(from, to, overwrite); - - public void Move(string from, string to) => File.Move(from, to); - - public bool Exists(string file) => File.Exists(file); - - public void Delete(string path) => File.Delete(path); - - public string ReadAllText(string path) => File.ReadAllText(path); - - public void WriteAllText(string? file, string fileContents) - { - // Opinionated decision to use UTF8 with BOM when creating new files or when the existing - // encoding was not easily detected due to the file not having an encoding preamble. - var encoding = EncodingHelper.DetectEncoding(file) ?? Encoding.UTF8; - WriteAllText(file, fileContents, encoding); - } - - public void WriteAllText(string? file, string fileContents, Encoding encoding) - { - if (string.IsNullOrEmpty(file)) - throw new ArgumentNullException(nameof(file)); - - File.WriteAllText(file, fileContents, encoding); - } - - public IEnumerable DirectoryEnumerateFiles(string? directory, string searchPattern, SearchOption searchOption) - { - if (string.IsNullOrEmpty(directory)) - throw new ArgumentNullException(nameof(directory)); - - return Directory.EnumerateFiles(directory, searchPattern, searchOption); - } - - public Stream OpenWrite(string path) => File.OpenWrite(path); - - public Stream OpenRead(string path) => File.OpenRead(path); - - public void CreateDirectory(string path) => Directory.CreateDirectory(path); - - public bool DirectoryExists(string path) => Directory.Exists(path); - - public long GetLastDirectoryWrite(string path) => new DirectoryInfo(path) - .GetDirectories("*.*", SearchOption.AllDirectories) - .Select(d => d.LastWriteTimeUtc) - .DefaultIfEmpty() - .Max() - .Ticks; - - public bool PathsEqual(string? path, string? otherPath) => - string.Equals( - PathHelper.GetFullPath(path).TrimEnd('\\').TrimEnd('/'), - PathHelper.GetFullPath(otherPath).TrimEnd('\\').TrimEnd('/'), - StringComparerUtils.OsDependentComparison); -} diff --git a/src/GitVersion.Core/Core/GitPreparer.cs b/src/GitVersion.Core/Core/GitPreparer.cs index 47436d041a..52281942de 100644 --- a/src/GitVersion.Core/Core/GitPreparer.cs +++ b/src/GitVersion.Core/Core/GitPreparer.cs @@ -1,36 +1,36 @@ -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Agents; +using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model.Configuration; using Microsoft.Extensions.Options; namespace GitVersion; -public class GitPreparer : IGitPreparer +internal class GitPreparer( + ILog log, + IFileSystem fileSystem, + IEnvironment environment, + ICurrentBuildAgent buildAgent, + IOptions options, + IMutatingGitRepository repository, + IGitRepositoryInfo repositoryInfo, + Lazy versionContext) + : IGitPreparer { - private readonly ILog log; - private readonly IEnvironment environment; - private readonly IMutatingGitRepository repository; - private readonly IOptions options; - private readonly IGitRepositoryInfo repositoryInfo; - private readonly ICurrentBuildAgent buildAgent; - private readonly RetryAction retryAction; - private readonly Lazy versionContext; - private const string DefaultRemoteName = "origin"; + private readonly ILog log = log.NotNull(); + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IEnvironment environment = environment.NotNull(); + private readonly IMutatingGitRepository repository = repository.NotNull(); + private readonly IOptions options = options.NotNull(); + private readonly IGitRepositoryInfo repositoryInfo = repositoryInfo.NotNull(); + private readonly ICurrentBuildAgent buildAgent = buildAgent.NotNull(); + private readonly RetryAction retryAction = new(); + private readonly Lazy versionContext = versionContext.NotNull(); - public GitPreparer(ILog log, IEnvironment environment, ICurrentBuildAgent buildAgent, IOptions options, - IMutatingGitRepository repository, IGitRepositoryInfo repositoryInfo, Lazy versionContext) - { - this.log = log.NotNull(); - this.environment = environment.NotNull(); - this.repository = repository.NotNull(); - this.options = options.NotNull(); - this.repositoryInfo = repositoryInfo.NotNull(); - this.buildAgent = buildAgent.NotNull(); - this.retryAction = new RetryAction(); - this.versionContext = versionContext.NotNull(); - } + private const string DefaultRemoteName = "origin"; public void Prepare() { @@ -42,7 +42,7 @@ public void Prepare() this.log.Info($"DotGit directory is: {dotGitDirectory}"); if (dotGitDirectory.IsNullOrEmpty() || projectRoot.IsNullOrEmpty()) { - throw new Exception($"Failed to prepare or find the .git directory in path '{gitVersionOptions.WorkingDirectory}'."); + throw new($"Failed to prepare or find the .git directory in path '{gitVersionOptions.WorkingDirectory}'."); } PrepareInternal(gitVersionOptions); @@ -106,7 +106,7 @@ private void CreateDynamicRepository(string? targetBranch) { if (targetBranch.IsNullOrWhiteSpace()) { - throw new Exception("Dynamic Git repositories must have a target branch (/b)"); + throw new("Dynamic Git repositories must have a target branch (/b)"); } var gitDirectory = this.repositoryInfo.DynamicGitRepositoryPath; @@ -114,8 +114,12 @@ private void CreateDynamicRepository(string? targetBranch) using (this.log.IndentLog($"Creating dynamic repository at '{gitDirectory}'")) { var gitVersionOptions = this.options.Value; - var authentication = gitVersionOptions.Authentication; - if (!Directory.Exists(gitDirectory)) + var authentication = gitVersionOptions.AuthenticationInfo; + if (string.IsNullOrWhiteSpace(gitDirectory)) + { + throw new("Dynamic Git repositories should have a path specified"); + } + if (!this.fileSystem.Directory.Exists(gitDirectory)) { CloneRepository(gitVersionOptions.RepositoryInfo.TargetUrl, gitDirectory, authentication); } @@ -151,57 +155,70 @@ private void CloneRepository(string? repositoryUrl, string? gitDirectory, Authen /// private void NormalizeGitDirectory(bool noFetch, string? currentBranchName, bool isDynamicRepository) { - var authentication = this.options.Value.Authentication; + var authentication = this.options.Value.AuthenticationInfo; // Need to ensure the HEAD does not move, this is essentially a BugCheck var expectedSha = this.repository.Head.Tip?.Sha; var expectedBranchName = this.repository.Head.Name.Canonical; - try + var remote = EnsureOnlyOneRemoteIsDefined(); + EnsureRepositoryHeadDuringNormalisation(nameof(EnsureOnlyOneRemoteIsDefined), expectedSha); + FetchRemotesIfRequired(remote, noFetch, authentication); + EnsureRepositoryHeadDuringNormalisation(nameof(FetchRemotesIfRequired), expectedSha); + EnsureLocalBranchExistsForCurrentBranch(remote, currentBranchName); + EnsureRepositoryHeadDuringNormalisation(nameof(EnsureLocalBranchExistsForCurrentBranch), expectedSha); + CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(remote.Name); + EnsureRepositoryHeadDuringNormalisation(nameof(CreateOrUpdateLocalBranchesFromRemoteTrackingOnes), expectedSha); + + var currentBranch = this.repository.Branches.FirstOrDefault(x => x.Name.EquivalentTo(currentBranchName)); + // Bug fix for https://github.com/GitTools/GitVersion/issues/1754, head maybe have been changed + // if this is a dynamic repository. But only allow this in case the branches are different (branch switch) + if (expectedSha != this.repository.Head.Tip?.Sha) { - var remote = EnsureOnlyOneRemoteIsDefined(); - - FetchRemotesIfRequired(remote, noFetch, authentication); - EnsureLocalBranchExistsForCurrentBranch(remote, currentBranchName); - CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(remote.Name); - - var currentBranch = this.repository.Branches.FirstOrDefault(x => x.Name.EquivalentTo(currentBranchName)); - // Bug fix for https://github.com/GitTools/GitVersion/issues/1754, head maybe have been changed - // if this is a dynamic repository. But only allow this in case the branches are different (branch switch) - if (expectedSha != this.repository.Head.Tip?.Sha) + if (isDynamicRepository || currentBranch is null || !this.repository.Head.Equals(currentBranch)) { - if (isDynamicRepository || currentBranch is null || !this.repository.Head.Equals(currentBranch)) - { - var newExpectedSha = this.repository.Head.Tip?.Sha; - var newExpectedBranchName = this.repository.Head.Name.Canonical; + var newExpectedSha = this.repository.Head.Tip?.Sha; + var newExpectedBranchName = this.repository.Head.Name.Canonical; - this.log.Info($"Head has moved from '{expectedBranchName} | {expectedSha}' => '{newExpectedBranchName} | {newExpectedSha}', allowed since this is a dynamic repository"); + this.log.Info($"Head has moved from '{expectedBranchName} | {expectedSha}' => '{newExpectedBranchName} | {newExpectedSha}', allowed since this is a dynamic repository"); - expectedSha = newExpectedSha; - } + expectedSha = newExpectedSha; } + } + + EnsureHeadIsAttachedToBranch(currentBranchName, authentication); + EnsureRepositoryHeadDuringNormalisation(nameof(EnsureHeadIsAttachedToBranch), expectedSha); - EnsureHeadIsAttachedToBranch(currentBranchName, authentication); + if (!this.repository.IsShallow) return; + if (this.options.Value.Settings.AllowShallow) + { + this.log.Info("Repository is a shallow clone. GitVersion will continue, but it is recommended to use a full clone for accurate versioning."); } - finally + else { - if (this.repository.Head.Tip?.Sha != expectedSha) - { - if (this.environment.GetEnvironmentVariable("IGNORE_NORMALISATION_GIT_HEAD_MOVE") != "1") - { - // Whoa, HEAD has moved, it shouldn't have. We need to blow up because there is a bug in normalisation - throw new BugException($@"GitVersion has a bug, your HEAD has moved after repo normalisation. + throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + } + } -To disable this error set an environmental variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1 + private void EnsureRepositoryHeadDuringNormalisation(string occasion, string? expectedSha) + { + expectedSha.NotNull(); + if (this.repository.Head.Tip?.Sha == expectedSha) + return; -Please run `git {GitExtensions.CreateGitLogArgs(100)}` and submit it along with your build log (with personal info removed) in a new issue at https://github.com/GitTools/GitVersion"); - } - } - } + if (this.environment.GetEnvironmentVariable("IGNORE_NORMALISATION_GIT_HEAD_MOVE") == "1") + return; + + // Whoa, HEAD has moved, it shouldn't have. We need to blow up because there is a bug in normalisation + throw new BugException($""" + GitVersion has a bug, your HEAD has moved after repo normalisation after step '{occasion}' + To disable this error set an environmental variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1 + Please run `git {GitExtensions.CreateGitLogArgs(100)}` and submit it along with your build log (with personal info removed) in a new issue at https://github.com/GitTools/GitVersion + """); } private void EnsureHeadIsAttachedToBranch(string? currentBranchName, AuthenticationInfo authentication) { - var headSha = this.repository.Refs.Head?.TargetIdentifier; + var headSha = this.repository.References.Head?.TargetIdentifier; if (!this.repository.IsHeadDetached) { this.log.Info($"HEAD points at branch '{headSha}'."); @@ -209,8 +226,8 @@ private void EnsureHeadIsAttachedToBranch(string? currentBranchName, Authenticat } this.log.Info($"HEAD is detached and points at commit '{headSha}'."); - var localRefs = this.repository.Refs.FromGlob("*").Select(r => $"{r.Name.Canonical} ({r.TargetIdentifier})"); - this.log.Info($"Local Refs:{System.Environment.NewLine}" + string.Join(System.Environment.NewLine, localRefs)); + var localRefs = this.repository.References.FromGlob("*").Select(r => $"{r.Name.Canonical} ({r.TargetIdentifier})"); + this.log.Info($"Local Refs:{FileSystemHelper.Path.NewLine}" + string.Join(FileSystemHelper.Path.NewLine, localRefs)); // In order to decide whether a fake branch is required or not, first check to see if any local branches have the same commit SHA of the head SHA. // If they do, go ahead and checkout that branch @@ -250,11 +267,11 @@ private void ChooseLocalBranchToAttach(string? headSha, IReadOnlyCollection n.Name.EquivalentTo(Config.MainBranchKey)); + var mainBranch = localBranches.SingleOrDefault(n => n.Name.EquivalentTo(ConfigurationConstants.MainBranchKey)); if (mainBranch != null) { this.log.Warning("Because one of the branches is 'main', will build main." + moveBranchMsg); - Checkout(Config.MainBranchKey); + Checkout(ConfigurationConstants.MainBranchKey); } else { @@ -271,6 +288,7 @@ private void ChooseLocalBranchToAttach(string? headSha, IReadOnlyCollection r.Specification)); this.log.Info($"Fetching from remote '{remote.Name}' using the following refspecs: {refSpecs}."); - this.retryAction.Execute(() => this.repository.Fetch(remote.Name, Enumerable.Empty(), authentication, null)); + this.retryAction.Execute(() => this.repository.Fetch(remote.Name, [], authentication, null)); } } @@ -313,20 +331,20 @@ private void CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(string remoteName var prefix = $"refs/remotes/{remoteName}/"; var remoteHeadCanonicalName = $"{prefix}HEAD"; var headReferenceName = ReferenceName.Parse(remoteHeadCanonicalName); - var remoteTrackingReferences = this.repository.Refs + var remoteTrackingReferences = this.repository.References .FromGlob(prefix + "*") .Where(r => !r.Name.Equals(headReferenceName)); foreach (var remoteTrackingReference in remoteTrackingReferences) { var remoteTrackingReferenceName = remoteTrackingReference.Name.Canonical; - var branchName = remoteTrackingReferenceName.Substring(prefix.Length); + var branchName = remoteTrackingReferenceName[prefix.Length..]; var localReferenceName = ReferenceName.FromBranchName(branchName); // We do not want to touch our current branch if (this.repository.Head.Name.EquivalentTo(branchName)) continue; - var localRef = this.repository.Refs[localReferenceName]; + var localRef = this.repository.References[localReferenceName]; if (localRef != null) { if (localRef.TargetIdentifier == remoteTrackingReference.TargetIdentifier) @@ -338,13 +356,13 @@ private void CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(string remoteName if (remoteRefTipId != null) { this.log.Info($"Updating local ref '{localRef.Name.Canonical}' to point at {remoteRefTipId}."); - this.retryAction.Execute(() => this.repository.Refs.UpdateTarget(localRef, remoteRefTipId)); + this.retryAction.Execute(() => this.repository.References.UpdateTarget(localRef, remoteRefTipId)); } continue; } this.log.Info($"Creating local branch from remote tracking '{remoteTrackingReference.Name.Canonical}'."); - this.repository.Refs.Add(localReferenceName.Canonical, remoteTrackingReference.TargetIdentifier, true); + this.repository.References.Add(localReferenceName.Canonical, remoteTrackingReference.TargetIdentifier, true); var branch = this.repository.Branches[branchName]; if (branch != null) @@ -354,19 +372,19 @@ private void CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(string remoteName } } - public void EnsureLocalBranchExistsForCurrentBranch(IRemote? remote, string? currentBranch) + public void EnsureLocalBranchExistsForCurrentBranch(IRemote remote, string? currentBranch) { remote.NotNull(); if (currentBranch.IsNullOrEmpty()) return; - var isRef = currentBranch.Contains("refs"); - var isBranch = currentBranch.Contains("refs/heads"); - var localCanonicalName = !isRef - ? "refs/heads/" + currentBranch - : isBranch + const string referencePrefix = "refs/"; + var isLocalBranch = currentBranch.StartsWith(ReferenceName.LocalBranchPrefix); + var localCanonicalName = !currentBranch.StartsWith(referencePrefix) + ? ReferenceName.LocalBranchPrefix + currentBranch + : isLocalBranch ? currentBranch - : currentBranch.Replace("refs/", "refs/heads/"); + : ReferenceName.LocalBranchPrefix + currentBranch[referencePrefix.Length..]; var repoTip = this.repository.Head.Tip; @@ -385,20 +403,20 @@ public void EnsureLocalBranchExistsForCurrentBranch(IRemote? remote, string? cur var referenceName = ReferenceName.Parse(localCanonicalName); if (this.repository.Branches.All(b => !b.Name.Equals(referenceName))) { - this.log.Info(isBranch + this.log.Info(isLocalBranch ? $"Creating local branch {referenceName}" : $"Creating local branch {referenceName} pointing at {repoTipId}"); - this.repository.Refs.Add(localCanonicalName, repoTipId.Sha); + this.repository.References.Add(localCanonicalName, repoTipId.Sha); } else { - this.log.Info(isBranch + this.log.Info(isLocalBranch ? $"Updating local branch {referenceName} to point at {repoTipId}" : $"Updating local branch {referenceName} to match ref {currentBranch}"); - var localRef = this.repository.Refs[localCanonicalName]; + var localRef = this.repository.References[localCanonicalName]; if (localRef != null) { - this.retryAction.Execute(() => this.repository.Refs.UpdateTarget(localRef, repoTipId)); + this.retryAction.Execute(() => this.repository.References.UpdateTarget(localRef, repoTipId)); } } } diff --git a/src/GitVersion.Core/Core/GitVersionCalculateTool.cs b/src/GitVersion.Core/Core/GitVersionCalculateTool.cs index 9274ec265f..72703484ec 100644 --- a/src/GitVersion.Core/Core/GitVersionCalculateTool.cs +++ b/src/GitVersion.Core/Core/GitVersionCalculateTool.cs @@ -1,65 +1,62 @@ +using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Helpers; using GitVersion.Logging; using GitVersion.OutputVariables; using GitVersion.VersionCalculation; -using GitVersion.VersionCalculation.Cache; +using GitVersion.VersionCalculation.Caching; using Microsoft.Extensions.Options; namespace GitVersion; -public class GitVersionCalculateTool : IGitVersionCalculateTool +internal class GitVersionCalculateTool( + ILog log, + INextVersionCalculator nextVersionCalculator, + IVariableProvider variableProvider, + IGitPreparer gitPreparer, + IGitVersionCacheProvider gitVersionCacheProvider, + IOptions options, + Lazy versionContext) + : IGitVersionCalculateTool { - private readonly ILog log; - private readonly IGitVersionCache gitVersionCache; - private readonly INextVersionCalculator nextVersionCalculator; - private readonly IVariableProvider variableProvider; - private readonly IGitPreparer gitPreparer; - private readonly IGitVersionCacheKeyFactory cacheKeyFactory; + private readonly ILog log = log.NotNull(); + private readonly IGitVersionCacheProvider gitVersionCacheProvider = gitVersionCacheProvider.NotNull(); + private readonly INextVersionCalculator nextVersionCalculator = nextVersionCalculator.NotNull(); + private readonly IVariableProvider variableProvider = variableProvider.NotNull(); + private readonly IGitPreparer gitPreparer = gitPreparer.NotNull(); - private readonly IOptions options; - private readonly Lazy versionContext; - private GitVersionContext context => this.versionContext.Value; + private readonly IOptions options = options.NotNull(); + private readonly Lazy versionContext = versionContext.NotNull(); - public GitVersionCalculateTool(ILog log, INextVersionCalculator nextVersionCalculator, - IVariableProvider variableProvider, IGitPreparer gitPreparer, - IGitVersionCache gitVersionCache, IGitVersionCacheKeyFactory cacheKeyFactory, - IOptions options, Lazy versionContext) - { - this.log = log.NotNull(); - - this.nextVersionCalculator = nextVersionCalculator.NotNull(); - this.variableProvider = variableProvider.NotNull(); - this.gitPreparer = gitPreparer.NotNull(); - - this.cacheKeyFactory = cacheKeyFactory.NotNull(); - this.gitVersionCache = gitVersionCache.NotNull(); + private GitVersionContext Context => this.versionContext.Value; - this.options = options.NotNull(); - this.versionContext = versionContext.NotNull(); - } - - public VersionVariables CalculateVersionVariables() + public GitVersionVariables CalculateVersionVariables() { this.gitPreparer.Prepare(); //we need to prepare the repository before using it for version calculation var gitVersionOptions = this.options.Value; - var cacheKey = this.cacheKeyFactory.Create(gitVersionOptions.ConfigInfo.OverrideConfig); - var versionVariables = gitVersionOptions.Settings.NoCache ? default : this.gitVersionCache.LoadVersionVariablesFromDiskCache(cacheKey); + var versionVariables = !gitVersionOptions.Settings.NoCache + ? this.gitVersionCacheProvider.LoadVersionVariablesFromDiskCache() + : null; if (versionVariables != null) return versionVariables; - var nextVersion = this.nextVersionCalculator.FindVersion(); - versionVariables = this.variableProvider.GetVariablesFor(nextVersion.IncrementedVersion, nextVersion.Configuration, context.IsCurrentCommitTagged); + var semanticVersion = this.nextVersionCalculator.FindVersion(); + + var branchConfiguration = Context.Configuration.GetBranchConfiguration(Context.CurrentBranch); + EffectiveConfiguration effectiveConfiguration = new(Context.Configuration, branchConfiguration); + versionVariables = this.variableProvider.GetVariablesFor( + semanticVersion, Context.Configuration, effectiveConfiguration.PreReleaseWeight); if (gitVersionOptions.Settings.NoCache) return versionVariables; try { - this.gitVersionCache.WriteVariablesToDiskCache(cacheKey, versionVariables); + this.gitVersionCacheProvider.WriteVariablesToDiskCache(versionVariables); } catch (AggregateException e) { - this.log.Warning($"One or more exceptions during cache write:{System.Environment.NewLine}{e}"); + this.log.Warning($"One or more exceptions during cache write:{FileSystemHelper.Path.NewLine}{e}"); } return versionVariables; diff --git a/src/GitVersion.Core/Core/GitVersionContextFactory.cs b/src/GitVersion.Core/Core/GitVersionContextFactory.cs index 2f8ed80193..999da28fbc 100644 --- a/src/GitVersion.Core/Core/GitVersionContextFactory.cs +++ b/src/GitVersion.Core/Core/GitVersionContextFactory.cs @@ -1,41 +1,49 @@ using GitVersion.Common; using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; using Microsoft.Extensions.Options; namespace GitVersion; -public class GitVersionContextFactory : IGitVersionContextFactory +internal class GitVersionContextFactory( + IConfigurationProvider configurationProvider, + IRepositoryStore repositoryStore, + ITaggedSemanticVersionRepository taggedSemanticVersionRepository, + IOptions options) + : IGitVersionContextFactory { - private readonly IConfigProvider configProvider; - private readonly IRepositoryStore repositoryStore; - private readonly IOptions options; + private readonly IConfigurationProvider configurationProvider = configurationProvider.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly ITaggedSemanticVersionRepository taggedSemanticVersionRepository = taggedSemanticVersionRepository.NotNull(); + private readonly IOptions options = options.NotNull(); - public GitVersionContextFactory(IConfigProvider configProvider, IRepositoryStore repositoryStore, IOptions options) + public GitVersionContext Create() { - this.configProvider = configProvider.NotNull(); - this.repositoryStore = repositoryStore.NotNull(); - this.options = options.NotNull(); - } - - public GitVersionContext Create(GitVersionOptions gitVersionOptions) - { - var currentBranch = this.repositoryStore.GetTargetBranch(gitVersionOptions.RepositoryInfo.TargetBranch); - if (currentBranch == null) - throw new InvalidOperationException("Need a branch to operate on"); - - var currentCommit = this.repositoryStore.GetCurrentCommit(currentBranch, gitVersionOptions.RepositoryInfo.CommitId); - - var configuration = this.configProvider.Provide(this.options.Value.ConfigInfo.OverrideConfig); + var gitVersionOptions = this.options.Value; + var overrideConfiguration = gitVersionOptions.ConfigurationInfo.OverrideConfiguration; + var configuration = this.configurationProvider.Provide(overrideConfiguration); + + var currentBranch = this.repositoryStore.GetTargetBranch(gitVersionOptions.RepositoryInfo.TargetBranch) + ?? throw new InvalidOperationException("Need a branch to operate on"); + var currentCommit = this.repositoryStore.GetCurrentCommit( + currentBranch, gitVersionOptions.RepositoryInfo.CommitId, configuration.Ignore + ) ?? throw new GitVersionException("No commits found on the current branch."); if (currentBranch.IsDetachedHead) { - var branchForCommit = this.repositoryStore.GetBranchesContainingCommit(currentCommit, onlyTrackedBranches: gitVersionOptions.Settings.OnlyTrackedBranches).OnlyOrDefault(); + var branchForCommit = this.repositoryStore.GetBranchesContainingCommit( + currentCommit, onlyTrackedBranches: gitVersionOptions.Settings.OnlyTrackedBranches + ).OnlyOrDefault(); currentBranch = branchForCommit ?? currentBranch; } - var currentCommitTaggedVersion = this.repositoryStore.GetCurrentCommitTaggedVersion(currentCommit, configuration.TagPrefix, handleDetachedBranch: currentBranch.IsDetachedHead); - var numberOfUncommittedChanges = this.repositoryStore.GetNumberOfUncommittedChanges(); + var isCurrentCommitTagged = this.taggedSemanticVersionRepository.GetTaggedSemanticVersions( + tagPrefix: configuration.TagPrefixPattern, + format: configuration.SemanticVersionFormat, + ignore: configuration.Ignore + ).Contains(currentCommit); + var numberOfUncommittedChanges = this.repositoryStore.UncommittedChangesCount; - return new GitVersionContext(currentBranch, currentCommit, configuration, currentCommitTaggedVersion, numberOfUncommittedChanges); + return new(currentBranch, currentCommit, configuration, isCurrentCommitTagged, numberOfUncommittedChanges); } } diff --git a/src/GitVersion.Core/Core/GitVersionModule.cs b/src/GitVersion.Core/Core/GitVersionModule.cs deleted file mode 100644 index 3762aeb2ec..0000000000 --- a/src/GitVersion.Core/Core/GitVersionModule.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion; - -public abstract class GitVersionModule : IGitVersionModule -{ - public abstract void RegisterTypes(IServiceCollection services); - - protected static IEnumerable FindAllDerivedTypes(Assembly assembly) - { - var derivedType = typeof(T); - return assembly.GetTypes().Where(t => t != derivedType && derivedType.IsAssignableFrom(t)); - } -} diff --git a/src/GitVersion.Core/Core/GitVersionOutputTool.cs b/src/GitVersion.Core/Core/GitVersionOutputTool.cs deleted file mode 100644 index 2de67aeb6a..0000000000 --- a/src/GitVersion.Core/Core/GitVersionOutputTool.cs +++ /dev/null @@ -1,81 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.OutputVariables; -using GitVersion.VersionConverters.AssemblyInfo; -using GitVersion.VersionConverters.GitVersionInfo; -using GitVersion.VersionConverters.OutputGenerator; -using GitVersion.VersionConverters.WixUpdater; -using Microsoft.Extensions.Options; - -namespace GitVersion; - -public class GitVersionOutputTool : IGitVersionOutputTool -{ - private readonly GitVersionOptions gitVersionOptions; - private readonly IOutputGenerator outputGenerator; - private readonly IWixVersionFileUpdater wixVersionFileUpdater; - private readonly IGitVersionInfoGenerator gitVersionInfoGenerator; - private readonly IAssemblyInfoFileUpdater assemblyInfoFileUpdater; - private readonly IProjectFileUpdater projectFileUpdater; - - public GitVersionOutputTool(IOptions options, - IOutputGenerator outputGenerator, IWixVersionFileUpdater wixVersionFileUpdater, - IGitVersionInfoGenerator gitVersionInfoGenerator, IAssemblyInfoFileUpdater assemblyInfoFileUpdater, - IProjectFileUpdater projectFileUpdater) - { - this.gitVersionOptions = options.Value.NotNull(); - - this.outputGenerator = outputGenerator.NotNull(); - - this.wixVersionFileUpdater = wixVersionFileUpdater.NotNull(); - this.gitVersionInfoGenerator = gitVersionInfoGenerator.NotNull(); - this.assemblyInfoFileUpdater = assemblyInfoFileUpdater.NotNull(); - this.projectFileUpdater = projectFileUpdater.NotNull(); - } - - public void OutputVariables(VersionVariables variables, bool updateBuildNumber) - { - using (this.outputGenerator) - { - this.outputGenerator.Execute(variables, new OutputContext(gitVersionOptions.WorkingDirectory, gitVersionOptions.OutputFile, updateBuildNumber)); - } - } - - public void UpdateAssemblyInfo(VersionVariables variables) - { - var assemblyInfoContext = new AssemblyInfoContext(gitVersionOptions.WorkingDirectory, gitVersionOptions.AssemblyInfo.EnsureAssemblyInfo, gitVersionOptions.AssemblyInfo.Files.ToArray()); - - if (gitVersionOptions.AssemblyInfo.UpdateProjectFiles) - { - using (this.projectFileUpdater) - { - this.projectFileUpdater.Execute(variables, assemblyInfoContext); - } - } - else if (gitVersionOptions.AssemblyInfo.UpdateAssemblyInfo) - { - using (this.assemblyInfoFileUpdater) - { - this.assemblyInfoFileUpdater.Execute(variables, assemblyInfoContext); - } - } - } - - public void UpdateWixVersionFile(VersionVariables variables) - { - if (gitVersionOptions.WixInfo.ShouldUpdate) - { - using (this.wixVersionFileUpdater) - { - this.wixVersionFileUpdater.Execute(variables, new WixVersionContext(gitVersionOptions.WorkingDirectory)); - } - } - } - - public void GenerateGitVersionInformation(VersionVariables variables, FileWriteInfo fileWriteInfo) - { - using (this.gitVersionInfoGenerator) - { - this.gitVersionInfoGenerator.Execute(variables, new GitVersionInfoContext(gitVersionOptions.WorkingDirectory, fileWriteInfo.FileName, fileWriteInfo.FileExtension)); - } - } -} diff --git a/src/GitVersion.Core/Core/IBranchRepository.cs b/src/GitVersion.Core/Core/IBranchRepository.cs new file mode 100644 index 0000000000..a58e603988 --- /dev/null +++ b/src/GitVersion.Core/Core/IBranchRepository.cs @@ -0,0 +1,11 @@ +using GitVersion.Configuration; +using GitVersion.Git; + +namespace GitVersion.Core; + +internal interface IBranchRepository +{ + IEnumerable GetMainBranches(IGitVersionConfiguration configuration, params IBranch[] excludeBranches); + + IEnumerable GetReleaseBranches(IGitVersionConfiguration configuration, params IBranch[] excludeBranches); +} diff --git a/src/GitVersion.Core/Core/ITaggedSemanticVersionRepository.cs b/src/GitVersion.Core/Core/ITaggedSemanticVersionRepository.cs new file mode 100644 index 0000000000..8177f1600d --- /dev/null +++ b/src/GitVersion.Core/Core/ITaggedSemanticVersionRepository.cs @@ -0,0 +1,22 @@ +using GitVersion.Configuration; +using GitVersion.Git; + +namespace GitVersion.Core; + +internal interface ITaggedSemanticVersionRepository +{ + ILookup GetTaggedSemanticVersionsOfBranch( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore); + + ILookup GetTaggedSemanticVersionsOfMergeTarget( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore); + + ILookup GetTaggedSemanticVersions( + string? tagPrefix, SemanticVersionFormat format, IIgnoreConfiguration ignore); +} diff --git a/src/GitVersion.Core/Core/ITaggedSemanticVersionService.cs b/src/GitVersion.Core/Core/ITaggedSemanticVersionService.cs new file mode 100644 index 0000000000..8c476cc7f5 --- /dev/null +++ b/src/GitVersion.Core/Core/ITaggedSemanticVersionService.cs @@ -0,0 +1,42 @@ +using GitVersion.Configuration; +using GitVersion.Git; + +namespace GitVersion.Core; + +internal interface ITaggedSemanticVersionService +{ + ILookup GetTaggedSemanticVersions( + IBranch branch, + IGitVersionConfiguration configuration, + string? label, + DateTimeOffset? notOlderThan, + TaggedSemanticVersions taggedSemanticVersion); + + ILookup GetTaggedSemanticVersionsOfBranch( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label = null, + DateTimeOffset? notOlderThan = null); + + ILookup GetTaggedSemanticVersionsOfMergeTarget( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label = null, + DateTimeOffset? notOlderThan = null); + + ILookup GetTaggedSemanticVersionsOfMainBranches( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan = null, + string? label = null, + params IBranch[] excludeBranches); + + ILookup GetTaggedSemanticVersionsOfReleaseBranches( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan = null, + string? label = null, + params IBranch[] excludeBranches); +} diff --git a/src/GitVersion.Core/Core/MainlineBranchFinder.cs b/src/GitVersion.Core/Core/MainlineBranchFinder.cs deleted file mode 100644 index b4fed2e22b..0000000000 --- a/src/GitVersion.Core/Core/MainlineBranchFinder.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Common; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion; - -internal class MainlineBranchFinder -{ - private readonly Config configuration; - private readonly ILog log; - private readonly IEnumerable>? mainlineBranchConfigs; - private readonly IGitRepository repository; - private readonly IRepositoryStore repositoryStore; - - - public MainlineBranchFinder(IRepositoryStore repositoryStore, - IGitRepository repository, - Config configuration, - IEnumerable>? mainlineBranchConfigs, - ILog log) - { - this.repositoryStore = repositoryStore.NotNull(); - this.repository = repository.NotNull(); - this.configuration = configuration.NotNull(); - this.mainlineBranchConfigs = mainlineBranchConfigs; - this.log = log.NotNull(); - } - - - public IDictionary> FindMainlineBranches(ICommit commit) - { - var branchOriginFinder = new BranchOriginFinder(commit, this.repositoryStore, this.configuration, this.log); - return this.repository.Branches - .Where(BranchIsMainline) - .Select(branchOriginFinder.BranchOrigin) - .Where(bc => bc != BranchCommit.Empty) - .GroupBy(bc => bc.Commit.Sha, bc => bc.Branch) - .ToDictionary(group => group.Key, x => x.ToList()); - } - - - private bool BranchIsMainline(INamedReference branch) - { - var matcher = new MainlineConfigBranchMatcher(branch, this.log); - return this.mainlineBranchConfigs?.Any(matcher.IsMainline) == true; - } - - private class MainlineConfigBranchMatcher - { - private readonly INamedReference branch; - private readonly ILog log; - - public MainlineConfigBranchMatcher(INamedReference branch, ILog log) - { - this.branch = branch; - this.log = log; - } - - public bool IsMainline(KeyValuePair mainlineBranchConfig) - { - var (_, value) = mainlineBranchConfig; - if (value?.Regex == null) - return false; - - var mainlineRegex = value.Regex; - var branchName = this.branch.Name.WithoutRemote; - var match = Regex.IsMatch(branchName, mainlineRegex); - this.log.Info($"'{mainlineRegex}' {(match ? "matches" : "does not match")} '{branchName}'."); - return match; - } - } - - - private class BranchOriginFinder - { - private readonly ICommit commit; - private readonly Config configuration; - private readonly ILog log; - private readonly IRepositoryStore repositoryStore; - - public BranchOriginFinder(ICommit commit, IRepositoryStore repositoryStore, Config configuration, ILog log) - { - this.repositoryStore = repositoryStore; - this.commit = commit; - this.configuration = configuration; - this.log = log; - } - - public BranchCommit BranchOrigin(IBranch branch) - { - var branchOrigin = FindBranchOrigin(branch); - return branchOrigin == null - ? BranchCommit.Empty - : new BranchCommit(branchOrigin, branch); - } - - - private ICommit? FindBranchOrigin(IBranch branch) - { - if (branch.Tip == null) - return null; - - var branchName = branch.Name.Friendly; - var mergeBase = this.repositoryStore.FindMergeBase(branch.Tip, this.commit); - if (mergeBase is not null) - { - this.log.Info($"Found merge base {mergeBase.Sha} for '{branchName}'."); - return mergeBase; - } - - var branchCommit = this.repositoryStore.FindCommitBranchWasBranchedFrom(branch, this.configuration); - if (branchCommit != BranchCommit.Empty) - { - this.log.Info($"Found parent commit {branchCommit.Commit.Sha} for '{branchName}'."); - return branchCommit.Commit; - } - - this.log.Info($"Found no merge base or parent commit for '{branchName}'."); - return null; - } - } -} diff --git a/src/GitVersion.Core/Core/MergeBaseFinder.cs b/src/GitVersion.Core/Core/MergeBaseFinder.cs index 4935e5b0c8..a281a01ce7 100644 --- a/src/GitVersion.Core/Core/MergeBaseFinder.cs +++ b/src/GitVersion.Core/Core/MergeBaseFinder.cs @@ -1,22 +1,15 @@ using GitVersion.Common; using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Logging; namespace GitVersion; -internal class MergeBaseFinder +internal class MergeBaseFinder(IRepositoryStore repositoryStore, ILog log) { - private readonly ILog log; - private readonly Dictionary, ICommit> mergeBaseCache = new(); - private readonly IGitRepository repository; - private readonly IRepositoryStore repositoryStore; - - public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepository, ILog log) - { - this.repositoryStore = repositoryStore.NotNull(); - this.repository = gitRepository.NotNull(); - this.log = log.NotNull(); - } + private readonly ILog log = log.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly Dictionary, ICommit> mergeBaseCache = []; public ICommit? FindMergeBaseOf(IBranch? first, IBranch? second) { @@ -25,16 +18,16 @@ public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepos var key = Tuple.Create(first, second); - if (this.mergeBaseCache.ContainsKey(key)) + if (this.mergeBaseCache.TryGetValue(key, out var mergeBase)) { this.log.Debug($"Cache hit for merge base between '{first}' and '{second}'."); - return this.mergeBaseCache[key]; + return mergeBase; } using (this.log.IndentLog($"Finding merge base between '{first}' and '{second}'.")) { // Other branch tip is a forward merge - var commitToFindCommonBase = second?.Tip; + var commitToFindCommonBase = second.Tip; var commit = first.Tip; if (commit == null) @@ -42,7 +35,7 @@ public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepos if (commitToFindCommonBase?.Parents.Contains(commit) == true) { - commitToFindCommonBase = commitToFindCommonBase.Parents.First(); + commitToFindCommonBase = commitToFindCommonBase.Parents[0]; } if (commitToFindCommonBase == null) @@ -52,14 +45,14 @@ public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepos if (findMergeBase == null) { - this.log.Info($"No merge base of {first}' and '{second} could be found."); + this.log.Info($"No merge base of '{first}' and '{second}' could be found."); return null; } // Store in cache. this.mergeBaseCache.Add(key, findMergeBase); - this.log.Info($"Merge base of {first}' and '{second} is {findMergeBase}"); + this.log.Info($"Merge base of '{first}' and '{second}' is '{findMergeBase}'"); return findMergeBase; } } @@ -70,20 +63,20 @@ public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepos if (findMergeBase == null) return null; - this.log.Info($"Found merge base of {findMergeBase}"); + this.log.Info($"Found merge base of '{findMergeBase}'"); // We do not want to include merge base commits which got forward merged into the other branch ICommit? forwardMerge; do { // Now make sure that the merge base is not a forward merge - forwardMerge = GetForwardMerge(commitToFindCommonBase, findMergeBase); + forwardMerge = this.repositoryStore.GetForwardMerge(commitToFindCommonBase, findMergeBase); if (forwardMerge == null) continue; // TODO Fix the logging up in this section - var second = forwardMerge.Parents.First(); + var second = forwardMerge.Parents[0]; this.log.Debug($"Second {second}"); var mergeBase = this.repositoryStore.FindMergeBase(commit, second); if (mergeBase == null) @@ -103,21 +96,9 @@ public MergeBaseFinder(IRepositoryStore repositoryStore, IGitRepository gitRepos findMergeBase = mergeBase; commitToFindCommonBase = second; - this.log.Info($"Merge base was due to a forward merge, next merge base is {findMergeBase}"); + this.log.Info($"next merge base --> {findMergeBase}"); } while (forwardMerge != null); return findMergeBase; } - - private ICommit? GetForwardMerge(ICommit? commitToFindCommonBase, ICommit? findMergeBase) - { - var filter = new CommitFilter - { - IncludeReachableFrom = commitToFindCommonBase, - ExcludeReachableFrom = findMergeBase - }; - var commitCollection = this.repository.Commits.QueryBy(filter); - - return commitCollection.FirstOrDefault(c => c.Parents.Contains(findMergeBase)); - } } diff --git a/src/GitVersion.Core/Core/MergeCommitFinder.cs b/src/GitVersion.Core/Core/MergeCommitFinder.cs index 20e496f6a3..c38da050af 100644 --- a/src/GitVersion.Core/Core/MergeCommitFinder.cs +++ b/src/GitVersion.Core/Core/MergeCommitFinder.cs @@ -1,33 +1,27 @@ +using GitVersion.Common; +using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Logging; -using GitVersion.Model.Configuration; namespace GitVersion; -internal class MergeCommitFinder +internal class MergeCommitFinder(IRepositoryStore repositoryStore, IGitVersionConfiguration configuration, IEnumerable excludedBranches, ILog log) { - private readonly IEnumerable excludedBranches; - private readonly ILog log; - private readonly Dictionary> mergeBaseCommitsCache = new(); - private readonly RepositoryStore repositoryStore; - private readonly Config configuration; - - public MergeCommitFinder(RepositoryStore repositoryStore, Config configuration, IEnumerable excludedBranches, ILog log) - { - this.repositoryStore = repositoryStore.NotNull(); - this.configuration = configuration.NotNull(); - this.excludedBranches = repositoryStore.ExcludingBranches(excludedBranches.NotNull()); - this.log = log.NotNull(); - } + private readonly ILog log = log.NotNull(); + private readonly IEnumerable branches = repositoryStore.ExcludingBranches(excludedBranches.NotNull()); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly IGitVersionConfiguration configuration = configuration.NotNull(); + private readonly Dictionary> mergeBaseCommitsCache = []; public IEnumerable FindMergeCommitsFor(IBranch branch) { branch = branch.NotNull(); - if (this.mergeBaseCommitsCache.ContainsKey(branch)) + if (this.mergeBaseCommitsCache.TryGetValue(branch, out var mergeCommitsFor)) { - this.log.Debug($"Cache hit for getting merge commits for branch {branch?.Name.Canonical}."); - return this.mergeBaseCommitsCache[branch]; + this.log.Debug($"Cache hit for getting merge commits for branch {branch.Name.Canonical}."); + return mergeCommitsFor; } var branchMergeBases = FindMergeBases(branch) @@ -36,12 +30,12 @@ public IEnumerable FindMergeCommitsFor(IBranch branch) this.mergeBaseCommitsCache.Add(branch, branchMergeBases); - return branchMergeBases.Where(b => !branch.Name.EquivalentTo(b.Branch.Name.WithoutRemote)); + return branchMergeBases.Where(b => !branch.Name.EquivalentTo(b.Branch.Name.WithoutOrigin)); } private IEnumerable FindMergeBases(IBranch branch) { - var sourceBranches = new SourceBranchFinder(this.excludedBranches, this.configuration) + var sourceBranches = new SourceBranchFinder(this.branches, this.configuration) .FindSourceBranchesOf(branch); foreach (var sourceBranch in sourceBranches) @@ -54,7 +48,7 @@ private IEnumerable FindMergeBases(IBranch branch) var findMergeBase = this.repositoryStore.FindMergeBase(branch, sourceBranch); if (findMergeBase != null) - yield return new BranchCommit(findMergeBase, sourceBranch); + yield return new(findMergeBase, sourceBranch); } } } diff --git a/src/GitVersion.Core/Core/RegexPatterns.cs b/src/GitVersion.Core/Core/RegexPatterns.cs new file mode 100644 index 0000000000..a84161731d --- /dev/null +++ b/src/GitVersion.Core/Core/RegexPatterns.cs @@ -0,0 +1,456 @@ +using System.Collections.Concurrent; +using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; +using System.Text.RegularExpressions; + +namespace GitVersion.Core; + +internal static partial class RegexPatterns +{ + private const RegexOptions Options = RegexOptions.IgnoreCase | RegexOptions.Compiled; + + public static class Cache + { + private static readonly ConcurrentDictionary cache = new(); + + public static Regex GetOrAdd([StringSyntax(StringSyntaxAttribute.Regex)] string pattern) + { + ArgumentNullException.ThrowIfNull(pattern); + + return cache.GetOrAdd(pattern, key => + KnownRegexes.TryGetValue(key, out var factory) + ? factory() + : new Regex(key, Options)); + } + + private static readonly ImmutableDictionary> KnownRegexes = + new Dictionary> + { + [Common.SwitchArgumentRegexPattern] = Common.SwitchArgumentRegex, + [Common.ObscurePasswordRegexPattern] = Common.ObscurePasswordRegex, + [Common.ExpandTokensRegexPattern] = Common.ExpandTokensRegex, + [Common.SanitizeEnvVarNameRegexPattern] = Common.SanitizeEnvVarNameRegex, + [Common.SanitizeMemberNameRegexPattern] = Common.SanitizeMemberNameRegex, + [Common.SanitizeNameRegexPattern] = Common.SanitizeNameRegex, + [Configuration.DefaultTagPrefixRegexPattern] = Configuration.DefaultTagPrefixRegex, + [Configuration.DefaultVersionInBranchRegexPattern] = Configuration.DefaultVersionInBranchRegex, + [Configuration.MainBranchRegexPattern] = Configuration.MainBranchRegex, + [Configuration.DevelopBranchRegexPattern] = Configuration.DevelopBranchRegex, + [Configuration.ReleaseBranchRegexPattern] = Configuration.ReleaseBranchRegex, + [Configuration.FeatureBranchRegexPattern] = Configuration.FeatureBranchRegex, + [Configuration.PullRequestBranchRegexPattern] = Configuration.PullRequestBranchRegex, + [Configuration.HotfixBranchRegexPattern] = Configuration.HotfixBranchRegex, + [Configuration.SupportBranchRegexPattern] = Configuration.SupportBranchRegex, + [Configuration.UnknownBranchRegexPattern] = Configuration.UnknownBranchRegex, + [MergeMessage.DefaultMergeMessageRegexPattern] = MergeMessage.DefaultMergeMessageRegex, + [MergeMessage.SmartGitMergeMessageRegexPattern] = MergeMessage.SmartGitMergeMessageRegex, + [MergeMessage.BitBucketPullMergeMessageRegexPattern] = MergeMessage.BitBucketPullMergeMessageRegex, + [MergeMessage.BitBucketPullv7MergeMessageRegexPattern] = MergeMessage.BitBucketPullv7MergeMessageRegex, + [MergeMessage.BitBucketCloudPullMergeMessageRegexPattern] = MergeMessage.BitBucketCloudPullMergeMessageRegex, + [MergeMessage.GitHubPullMergeMessageRegexPattern] = MergeMessage.GitHubPullMergeMessageRegex, + [MergeMessage.RemoteTrackingMergeMessageRegexPattern] = MergeMessage.RemoteTrackingMergeMessageRegex, + [MergeMessage.AzureDevOpsPullMergeMessageRegexPattern] = MergeMessage.AzureDevOpsPullMergeMessageRegex, + [Output.AssemblyVersionRegexPattern] = Output.AssemblyVersionRegex, + [Output.AssemblyInfoVersionRegexPattern] = Output.AssemblyInfoVersionRegex, + [Output.AssemblyFileVersionRegexPattern] = Output.AssemblyFileVersionRegex, + [Output.SanitizeAssemblyInfoRegexPattern] = Output.SanitizeAssemblyInfoRegex, + [Output.CsharpAssemblyAttributeRegexPattern] = Output.CsharpAssemblyAttributeRegex, + [Output.FsharpAssemblyAttributeRegexPattern] = Output.FsharpAssemblyAttributeRegex, + [Output.VisualBasicAssemblyAttributeRegexPattern] = Output.VisualBasicAssemblyAttributeRegex, + [Output.SanitizeParticipantRegexPattern] = Output.SanitizeParticipantRegex, + [VersionCalculation.DefaultMajorRegexPattern] = VersionCalculation.DefaultMajorRegex, + [VersionCalculation.DefaultMinorRegexPattern] = VersionCalculation.DefaultMinorRegex, + [VersionCalculation.DefaultPatchRegexPattern] = VersionCalculation.DefaultPatchRegex, + [VersionCalculation.DefaultNoBumpRegexPattern] = VersionCalculation.DefaultNoBumpRegex, + [SemanticVersion.ParseStrictRegexPattern] = SemanticVersion.ParseStrictRegex, + [SemanticVersion.ParseLooseRegexPattern] = SemanticVersion.ParseLooseRegex, + [SemanticVersion.ParseBuildMetaDataRegexPattern] = SemanticVersion.ParseBuildMetaDataRegex, + [SemanticVersion.FormatBuildMetaDataRegexPattern] = SemanticVersion.FormatBuildMetaDataRegex, + [SemanticVersion.ParsePreReleaseTagRegexPattern] = SemanticVersion.ParsePreReleaseTagRegex, + [AssemblyVersion.CSharp.TriviaRegexPattern] = AssemblyVersion.CSharp.TriviaRegex, + [AssemblyVersion.CSharp.AttributeRegexPattern] = AssemblyVersion.CSharp.AttributeRegex, + [AssemblyVersion.FSharp.TriviaRegexPattern] = AssemblyVersion.FSharp.TriviaRegex, + // AssemblyVersion.FSharp.TriviaRegexPattern is same as C# so can't be added to the cache so C# TriviaRegex is used for F# as well. + [AssemblyVersion.FSharp.AttributeRegexPattern] = AssemblyVersion.FSharp.AttributeRegex, + [AssemblyVersion.VisualBasic.TriviaRegexPattern] = AssemblyVersion.VisualBasic.TriviaRegex, + [AssemblyVersion.VisualBasic.AttributeRegexPattern] = AssemblyVersion.VisualBasic.AttributeRegex + }.ToImmutableDictionary(); + } + + internal static partial class Common + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string SwitchArgumentRegexPattern = @"/\w+:"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ObscurePasswordRegexPattern = "(https?://)(.+)(:.+@)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ExpandTokensRegexPattern = """ + \{ # Opening brace + (?: # Start of either env or member expression + env:(?!env:)(?[A-Za-z_][A-Za-z0-9_]*) # Only a single env: prefix, not followed by another env: + | # OR + (?[A-Za-z_][A-Za-z0-9_]*) # member/property name + (?: # Optional format specifier + :(?[A-Za-z0-9\.\-,]+) # Colon followed by format string (no spaces, ?, or }), format cannot contain colon + )? # Format is optional + ) # End group for env or member + (?: # Optional fallback group + \s*\?\?\s+ # '??' operator with optional whitespace: exactly two question marks for fallback + (?: # Fallback value alternatives: + (?\w+) # A single word fallback + | # OR + "(?[^"]*)" # A quoted string fallback + ) + )? # Fallback is optional + \} + """; + + /// + /// Allow alphanumeric, underscore, colon (for custom format specification), hyphen, and dot + /// + [StringSyntax(StringSyntaxAttribute.Regex, Options)] + internal const string SanitizeEnvVarNameRegexPattern = @"^[A-Za-z0-9_:\-\.]+$"; + + /// + /// Allow alphanumeric, underscore, and dot for property/field access + /// + [StringSyntax(StringSyntaxAttribute.Regex, Options)] + internal const string SanitizeMemberNameRegexPattern = @"^[A-Za-z0-9_\.]+$"; + + [StringSyntax(StringSyntaxAttribute.Regex, Options)] + internal const string SanitizeNameRegexPattern = "[^a-zA-Z0-9-]"; + + [GeneratedRegex(SwitchArgumentRegexPattern, Options)] + public static partial Regex SwitchArgumentRegex(); + + [GeneratedRegex(ObscurePasswordRegexPattern, Options)] + public static partial Regex ObscurePasswordRegex(); + + [GeneratedRegex(ExpandTokensRegexPattern, RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex ExpandTokensRegex(); + + [GeneratedRegex(SanitizeEnvVarNameRegexPattern, Options)] + public static partial Regex SanitizeEnvVarNameRegex(); + + [GeneratedRegex(SanitizeMemberNameRegexPattern, Options)] + public static partial Regex SanitizeMemberNameRegex(); + + [GeneratedRegex(SanitizeNameRegexPattern, Options)] + public static partial Regex SanitizeNameRegex(); + } + + internal static partial class Configuration + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultTagPrefixRegexPattern = "[vV]?"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultVersionInBranchRegexPattern = @"(?[vV]?\d+(\.\d+)?(\.\d+)?).*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string MainBranchRegexPattern = "^master$|^main$"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DevelopBranchRegexPattern = "^dev(elop)?(ment)?$"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ReleaseBranchRegexPattern = @"^releases?[\/-](?.+)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string FeatureBranchRegexPattern = @"^features?[\/-](?.+)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string PullRequestBranchRegexPattern = @"^(pull-requests|pull|pr)[\/-](?\d*)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string HotfixBranchRegexPattern = @"^hotfix(es)?[\/-](?.+)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string SupportBranchRegexPattern = @"^support[\/-](?.+)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string UnknownBranchRegexPattern = "(?.+)"; + + [GeneratedRegex(DefaultTagPrefixRegexPattern, Options)] + public static partial Regex DefaultTagPrefixRegex(); + + [GeneratedRegex(DefaultVersionInBranchRegexPattern, Options)] + public static partial Regex DefaultVersionInBranchRegex(); + + [GeneratedRegex(MainBranchRegexPattern, Options)] + public static partial Regex MainBranchRegex(); + + [GeneratedRegex(DevelopBranchRegexPattern, Options)] + public static partial Regex DevelopBranchRegex(); + + [GeneratedRegex(ReleaseBranchRegexPattern, Options)] + public static partial Regex ReleaseBranchRegex(); + + [GeneratedRegex(FeatureBranchRegexPattern, Options)] + public static partial Regex FeatureBranchRegex(); + + [GeneratedRegex(PullRequestBranchRegexPattern, Options)] + public static partial Regex PullRequestBranchRegex(); + + [GeneratedRegex(HotfixBranchRegexPattern, Options)] + public static partial Regex HotfixBranchRegex(); + + [GeneratedRegex(SupportBranchRegexPattern, Options)] + public static partial Regex SupportBranchRegex(); + + [GeneratedRegex(UnknownBranchRegexPattern, Options)] + public static partial Regex UnknownBranchRegex(); + } + + internal static partial class MergeMessage + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultMergeMessageRegexPattern = @"^Merge (branch|tag) '(?[^']*)'(?: into (?[^\s]*))*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string SmartGitMergeMessageRegexPattern = @"^Finish (?[^\s]*)(?: into (?[^\s]*))*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string BitBucketPullMergeMessageRegexPattern = @"^Merge pull request #(?\d+) (from|in) (?.*) from (?[^\s]*) to (?[^\s]*)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string BitBucketPullv7MergeMessageRegexPattern = @"^Pull request #(?\d+).*\r?\n\r?\nMerge in (?.*) from (?[^\s]*) to (?[^\s]*)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string BitBucketCloudPullMergeMessageRegexPattern = @"^Merged in (?[^\s]*) \(pull request #(?\d+)\)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string GitHubPullMergeMessageRegexPattern = @"^Merge pull request #(?\d+) (from|in) (?:[^\s\/]+\/)?(?[^\s]*)(?: into (?[^\s]*))*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string RemoteTrackingMergeMessageRegexPattern = @"^Merge remote-tracking branch '(?[^\s]*)'(?: into (?[^\s]*))*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AzureDevOpsPullMergeMessageRegexPattern = @"^Merge pull request (?\d+) from (?[^\s]*) into (?[^\s]*)"; + + [GeneratedRegex(DefaultMergeMessageRegexPattern, Options)] + public static partial Regex DefaultMergeMessageRegex(); + + [GeneratedRegex(SmartGitMergeMessageRegexPattern, Options)] + public static partial Regex SmartGitMergeMessageRegex(); + + [GeneratedRegex(BitBucketPullMergeMessageRegexPattern, Options)] + public static partial Regex BitBucketPullMergeMessageRegex(); + + [GeneratedRegex(BitBucketPullv7MergeMessageRegexPattern, Options)] + public static partial Regex BitBucketPullv7MergeMessageRegex(); + + [GeneratedRegex(BitBucketCloudPullMergeMessageRegexPattern, Options)] + public static partial Regex BitBucketCloudPullMergeMessageRegex(); + + [GeneratedRegex(GitHubPullMergeMessageRegexPattern, Options)] + public static partial Regex GitHubPullMergeMessageRegex(); + + [GeneratedRegex(RemoteTrackingMergeMessageRegexPattern, Options)] + public static partial Regex RemoteTrackingMergeMessageRegex(); + + [GeneratedRegex(AzureDevOpsPullMergeMessageRegexPattern, Options)] + public static partial Regex AzureDevOpsPullMergeMessageRegex(); + } + + internal static partial class Output + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AssemblyVersionRegexPattern = @"AssemblyVersion(Attribute)?\s*\(.*\)\s*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AssemblyInfoVersionRegexPattern = @"AssemblyInformationalVersion(Attribute)?\s*\(.*\)\s*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AssemblyFileVersionRegexPattern = @"AssemblyFileVersion(Attribute)?\s*\(.*\)\s*"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string CsharpAssemblyAttributeRegexPattern = @"(\s*\[\s*assembly:\s*(?:.*)\s*\]\s*$(\r?\n)?)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string FsharpAssemblyAttributeRegexPattern = @"(\s*\[\s*\\s*\]\s*$(\r?\n)?)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string VisualBasicAssemblyAttributeRegexPattern = @"(\s*\\s*$(\r?\n)?)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string SanitizeParticipantRegexPattern = "[^a-zA-Z0-9]"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string SanitizeAssemblyInfoRegexPattern = "[^0-9A-Za-z-.+]"; + + [GeneratedRegex(AssemblyVersionRegexPattern, Options)] + public static partial Regex AssemblyVersionRegex(); + + [GeneratedRegex(AssemblyInfoVersionRegexPattern, Options)] + public static partial Regex AssemblyInfoVersionRegex(); + + [GeneratedRegex(AssemblyFileVersionRegexPattern, Options)] + public static partial Regex AssemblyFileVersionRegex(); + + [GeneratedRegex(CsharpAssemblyAttributeRegexPattern, Options | RegexOptions.Multiline)] + public static partial Regex CsharpAssemblyAttributeRegex(); + + [GeneratedRegex(FsharpAssemblyAttributeRegexPattern, Options | RegexOptions.Multiline)] + public static partial Regex FsharpAssemblyAttributeRegex(); + + [GeneratedRegex(VisualBasicAssemblyAttributeRegexPattern, Options | RegexOptions.Multiline)] + public static partial Regex VisualBasicAssemblyAttributeRegex(); + + [GeneratedRegex(SanitizeParticipantRegexPattern, Options)] + public static partial Regex SanitizeParticipantRegex(); + + [GeneratedRegex(SanitizeAssemblyInfoRegexPattern, RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex SanitizeAssemblyInfoRegex(); + } + + internal static partial class VersionCalculation + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultMajorRegexPattern = @"\+semver:\s?(breaking|major)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultMinorRegexPattern = @"\+semver:\s?(feature|minor)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultPatchRegexPattern = @"\+semver:\s?(fix|patch)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string DefaultNoBumpRegexPattern = @"\+semver:\s?(none|skip)"; + + [GeneratedRegex(DefaultMajorRegexPattern, Options)] + public static partial Regex DefaultMajorRegex(); + + [GeneratedRegex(DefaultMinorRegexPattern, Options)] + public static partial Regex DefaultMinorRegex(); + + [GeneratedRegex(DefaultPatchRegexPattern, Options)] + public static partial Regex DefaultPatchRegex(); + + [GeneratedRegex(DefaultNoBumpRegexPattern, Options)] + public static partial Regex DefaultNoBumpRegex(); + } + + internal static partial class SemanticVersion + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ParseStrictRegexPattern = @"^(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ParseLooseRegexPattern = @"^(?(?\d+)(\.(?\d+))?(\.(?\d+))?)(\.(?\d+))?(-(?[^\+]*))?(\+(?.*))?$"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ParseBuildMetaDataRegexPattern = @"(?\d+)?(\.?Branch(Name)?\.(?[^\.]+))?(\.?Sha?\.(?[^\.]+))?(?.*)"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string FormatBuildMetaDataRegexPattern = "[^0-9A-Za-z-.]"; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string ParsePreReleaseTagRegexPattern = @"(?.*?)\.?(?\d+)?$"; + + // uses the git-semver spec https://github.com/semver/semver/blob/master/semver.md + [GeneratedRegex(ParseStrictRegexPattern, Options)] + public static partial Regex ParseStrictRegex(); + + [GeneratedRegex(ParseLooseRegexPattern, Options)] + public static partial Regex ParseLooseRegex(); + + [GeneratedRegex(ParseBuildMetaDataRegexPattern, Options)] + public static partial Regex ParseBuildMetaDataRegex(); + + [GeneratedRegex(FormatBuildMetaDataRegexPattern, Options)] + public static partial Regex FormatBuildMetaDataRegex(); + + [GeneratedRegex(ParsePreReleaseTagRegexPattern, Options)] + public static partial Regex ParsePreReleaseTagRegex(); + } + + internal static partial class AssemblyVersion + { + internal static partial class CSharp + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string TriviaRegexPattern = + """ + /\*(.*?)\*/ # Block comments: matches /* ... */ + |//(.*?)\r?\n # Line comments: matches // ... followed by a newline + |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes + """; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AttributeRegexPattern = + """ + (?x) # IgnorePatternWhitespace + \[\s*assembly\s*:\s* # The [assembly: part + (System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional) + Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion + \s*\(\s*\)\s*\] # End brackets ()] + """; + + [GeneratedRegex(TriviaRegexPattern, RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex TriviaRegex(); + + [GeneratedRegex(AttributeRegexPattern, RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex AttributeRegex(); + } + + internal static partial class FSharp + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string TriviaRegexPattern = + """ + /\*(.*?)\*/ # Block comments: matches /* ... */ + |//(.*?)\r?\n # Line comments: matches // ... followed by a newline + |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes + """; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AttributeRegexPattern = + """ + (?x) # IgnorePatternWhitespace + \[\s*<\s*assembly\s*:\s* # The [\s*\] # End brackets ()>] + """; + + /// + /// Note that while available to call direct, as the C# TriviaRegex is the same it will handle any calls through the cache for F# too. + /// + /// + [GeneratedRegex(TriviaRegexPattern, RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex TriviaRegex(); + + [GeneratedRegex(AttributeRegexPattern, RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex AttributeRegex(); + } + + internal static partial class VisualBasic + { + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string TriviaRegexPattern = + """ + '(.*?)\r?\n # Line comments: matches // ... followed by a newline + |"((\\[^\n]|[^"\n])*)" # Strings: matches " ... " including escaped quotes + """; + + [StringSyntax(StringSyntaxAttribute.Regex)] + internal const string AttributeRegexPattern = + """ + (?x) # IgnorePatternWhitespace + \<\s*Assembly\s*:\s* # The # End brackets ()> + """; + + [GeneratedRegex(TriviaRegexPattern, RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex TriviaRegex(); + + [GeneratedRegex(AttributeRegexPattern, RegexOptions.IgnorePatternWhitespace | Options)] + public static partial Regex AttributeRegex(); + } + } +} diff --git a/src/GitVersion.Core/Core/RepositoryStore.cs b/src/GitVersion.Core/Core/RepositoryStore.cs index d8ac4706dd..50b5512a07 100644 --- a/src/GitVersion.Core/Core/RepositoryStore.cs +++ b/src/GitVersion.Core/Core/RepositoryStore.cs @@ -1,34 +1,39 @@ -using System.Text.RegularExpressions; using GitVersion.Common; using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model.Configuration; namespace GitVersion; -public class RepositoryStore : IRepositoryStore +internal class RepositoryStore(ILog log, IGitRepository repository) : IRepositoryStore { - private readonly ILog log; - private readonly IGitRepository repository; - private readonly Dictionary> semanticVersionTagsOnBranchCache = new(); - private readonly MergeBaseFinder mergeBaseFinder; + private readonly ILog log = log.NotNull(); + private readonly IGitRepository repository = repository.NotNull(); - public RepositoryStore(ILog log, IGitRepository repository) - { - this.log = log.NotNull(); - this.repository = repository.NotNull(); - this.mergeBaseFinder = new MergeBaseFinder(this, repository, log); - } + public int UncommittedChangesCount => this.repository.UncommittedChangesCount(); + + public IBranch Head => this.repository.Head; + + public IBranchCollection Branches => this.repository.Branches; + + public ITagCollection Tags => this.repository.Tags; /// /// Find the merge base of the two branches, i.e. the best common ancestor of the two branches' tips. /// public ICommit? FindMergeBase(IBranch? branch, IBranch? otherBranch) - => this.mergeBaseFinder.FindMergeBaseOf(branch, otherBranch); + { + var mergeBaseFinder = new MergeBaseFinder(this, log); + return mergeBaseFinder.FindMergeBaseOf(branch, otherBranch); + } - public ICommit? GetCurrentCommit(IBranch currentBranch, string? commitId) + public ICommit? GetCurrentCommit(IBranch currentBranch, string? commitId, IIgnoreConfiguration ignore) { + currentBranch.NotNull(); + ignore.NotNull(); + ICommit? currentCommit = null; if (!commitId.IsNullOrWhiteSpace()) { @@ -45,51 +50,18 @@ public RepositoryStore(ILog log, IGitRepository repository) } } + IEnumerable commits = currentBranch.Commits; if (currentCommit != null) - return currentCommit; - - this.log.Info("Using latest commit on specified branch"); - currentCommit = currentBranch.Tip; - - return currentCommit; - } - - public ICommit GetBaseVersionSource(ICommit currentBranchTip) - { - try { - var filter = new CommitFilter { IncludeReachableFrom = currentBranchTip }; - var commitCollection = this.repository.Commits.QueryBy(filter); - - return commitCollection.First(c => !c.Parents.Any()); + commits = currentBranch.Commits.GetCommitsPriorTo(currentCommit.When); } - catch (Exception exception) - { - throw new GitVersionException($"Cannot find commit {currentBranchTip}. Please ensure that the repository is an unshallow clone with `git fetch --unshallow`.", exception); - } - } - - public IEnumerable GetMainlineCommitLog(ICommit? baseVersionSource, ICommit? mainlineTip) - { - if (mainlineTip is null) + else { - return Enumerable.Empty(); + this.log.Info("Using latest commit on specified branch"); } - var filter = new CommitFilter { IncludeReachableFrom = mainlineTip, ExcludeReachableFrom = baseVersionSource, SortBy = CommitSortStrategies.Reverse, FirstParentOnly = true }; - - return this.repository.Commits.QueryBy(filter); - } - - public IEnumerable GetMergeBaseCommits(ICommit? mergeCommit, ICommit? mergedHead, ICommit? findMergeBase) - { - var filter = new CommitFilter { IncludeReachableFrom = mergedHead, ExcludeReachableFrom = findMergeBase }; - var commitCollection = this.repository.Commits.QueryBy(filter); - - var commits = mergeCommit != null - ? new[] { mergeCommit }.Union(commitCollection) - : commitCollection; - return commits; + commits = ignore.Filter(commits.ToArray()); + return commits.FirstOrDefault(); } public IBranch GetTargetBranch(string? targetBranchName) @@ -102,7 +74,7 @@ public IBranch GetTargetBranch(string? targetBranchName) return desiredBranch; // There are some edge cases where HEAD is not pointing to the desired branch. - // Therefore it's important to verify if 'currentBranch' is indeed the desired branch. + // Therefore, it's important to verify if 'currentBranch' is indeed the desired branch. var targetBranch = FindBranch(targetBranchName); // CanonicalName can be "refs/heads/develop", so we need to check for "/{TargetBranch}" as well @@ -110,10 +82,7 @@ public IBranch GetTargetBranch(string? targetBranchName) return desiredBranch; // In the case where HEAD is not the desired branch, try to find the branch with matching name - desiredBranch = this.repository.Branches - .Where(b => b.Name.EquivalentTo(targetBranchName)) - .OrderBy(b => b.IsRemote) - .FirstOrDefault(); + desiredBranch = this.repository.Branches.Where(b => b.Name.EquivalentTo(targetBranchName)).MinBy(b => b.IsRemote); // Failsafe in case the specified branch is invalid desiredBranch ??= this.repository.Head; @@ -121,68 +90,88 @@ public IBranch GetTargetBranch(string? targetBranchName) return desiredBranch; } - public IBranch? FindBranch(string? branchName) => this.repository.Branches.FirstOrDefault(x => x.Name.EquivalentTo(branchName)); + public IBranch? FindBranch(ReferenceName branchName) => this.repository.Branches.FirstOrDefault(x => x.Name.Equals(branchName)); - public IBranch? FindMainBranch(Config configuration) - { - var mainBranchRegex = configuration.Branches[Config.MainBranchKey]?.Regex - ?? configuration.Branches[Config.MasterBranchKey]?.Regex; + public IEnumerable ExcludingBranches(IEnumerable branchesToExclude) => this.repository.Branches.ExcludeBranches(branchesToExclude); - if (mainBranchRegex == null) - { - return FindBranch(Config.MainBranchKey) ?? FindBranch(Config.MasterBranchKey); - } + public IEnumerable GetBranchesContainingCommit(ICommit commit, IEnumerable? branches = null, bool onlyTrackedBranches = false) + { + commit.NotNull(); - return this.repository.Branches.FirstOrDefault(b => - Regex.IsMatch(b.Name.Friendly, mainBranchRegex, RegexOptions.IgnoreCase)); + var branchesContainingCommitFinder = new BranchesContainingCommitFinder(this, this.log); + return branchesContainingCommitFinder.GetBranchesContainingCommit(commit, branches, onlyTrackedBranches); } - public IBranch? GetChosenBranch(Config configuration) + public IEnumerable GetSourceBranches(IBranch branch, IGitVersionConfiguration configuration, + params IBranch[] excludedBranches) + => GetSourceBranches(branch, configuration, (IEnumerable)excludedBranches); + + public IEnumerable GetSourceBranches( + IBranch branch, IGitVersionConfiguration configuration, IEnumerable excludedBranches) { - var developBranchRegex = configuration.Branches[Config.DevelopBranchKey]?.Regex; - var mainBranchRegex = configuration.Branches[Config.MainBranchKey]?.Regex; - - if (mainBranchRegex == null || developBranchRegex == null) return null; - var chosenBranch = this.repository.Branches.FirstOrDefault(b => - Regex.IsMatch(b.Name.Friendly, developBranchRegex, RegexOptions.IgnoreCase) - || Regex.IsMatch(b.Name.Friendly, mainBranchRegex, RegexOptions.IgnoreCase)); - return chosenBranch; - } + var returnedBranches = new HashSet(); + + var referenceLookup = this.repository.References.ToLookup(r => r.TargetIdentifier); - public IEnumerable GetBranchesForCommit(ICommit commit) - => this.repository.Branches.Where(b => !b.IsRemote && Equals(b.Tip, commit)).ToList(); + var commitBranches = FindCommitBranchesBranchedFrom(branch, configuration, excludedBranches).ToHashSet(); - public IEnumerable GetExcludedInheritBranches(Config configuration) - => this.repository.Branches.Where(b => + var ignore = new HashSet(); + foreach (var commitBranch in commitBranches) { - var branchConfiguration = configuration.ForBranch(b); + foreach (var commit in branch.Commits.Where(element => element.When > commitBranch.Commit.When)) + { + var parents = commit.Parents.ToArray(); + if (parents.Length > 1 && parents.Any(element => element.Equals(commitBranch.Commit))) + { + ignore.Add(commitBranch); + } + } + } - return branchConfiguration == null || branchConfiguration.Increment == IncrementStrategy.Inherit; - }).ToList(); + foreach (var item in commitBranches.Skip(1).Reverse()) + { + if (ignore.Contains(item)) continue; - public IEnumerable GetReleaseBranches(IEnumerable> releaseBranchConfig) - => this.repository.Branches.Where(b => IsReleaseBranch(b, releaseBranchConfig)); + foreach (var commitBranch in commitBranches) + { + if (item.Commit.Equals(commitBranch.Commit)) break; + + foreach (var commit in commitBranch.Branch.Commits.Where(element => element.When >= item.Commit.When)) + { + if (commit.Equals(item.Commit)) + { + commitBranches.Remove(item); + } + } + } + } - public IEnumerable ExcludingBranches(IEnumerable branchesToExclude) => this.repository.Branches.ExcludeBranches(branchesToExclude); + foreach (var branchGrouping in commitBranches.GroupBy(element => element.Commit, element => element.Branch)) + { + var referenceMatchFound = false; + var referenceNames = referenceLookup[branchGrouping.Key.Sha].Select(element => element.Name).ToHashSet(); - public IEnumerable GetBranchesContainingCommit(ICommit? commit, IEnumerable? branches = null, bool onlyTrackedBranches = false) - { - var branchesContainingCommitFinder = new BranchesContainingCommitFinder(this.repository, this.log); - return branchesContainingCommitFinder.GetBranchesContainingCommit(commit, branches, onlyTrackedBranches); - } + foreach (var item in branchGrouping) + { + if (!referenceNames.Contains(item.Name)) continue; + if (returnedBranches.Add(item)) yield return item; + referenceMatchFound = true; + } - public IDictionary> GetMainlineBranches(ICommit commit, Config configuration, IEnumerable>? mainlineBranchConfigs) - { - var mainlineBranchFinder = new MainlineBranchFinder(this, this.repository, configuration, mainlineBranchConfigs, this.log); - return mainlineBranchFinder.FindMainlineBranches(commit); + if (referenceMatchFound) continue; + foreach (var item in branchGrouping) + { + if (returnedBranches.Add(item)) yield return item; + } + } } - /// /// Find the commit where the given branch was branched from another branch. /// If there are multiple such commits and branches, tries to guess based on commit histories. /// - public BranchCommit FindCommitBranchWasBranchedFrom(IBranch? branch, Config configuration, params IBranch[] excludedBranches) + public BranchCommit FindCommitBranchBranchedFrom(IBranch? branch, IGitVersionConfiguration configuration, + params IBranch[] excludedBranches) { branch = branch.NotNull(); @@ -202,100 +191,87 @@ public BranchCommit FindCommitBranchWasBranchedFrom(IBranch? branch, Config conf if (possibleBranches.Count <= 1) return possibleBranches.SingleOrDefault(); - var first = possibleBranches.First(); - this.log.Info($"Multiple source branches have been found, picking the first one ({first.Branch}).{System.Environment.NewLine}" + - $"This may result in incorrect commit counting.{System.Environment.NewLine}Options were:{System.Environment.NewLine}" + + var first = possibleBranches[0]; + this.log.Info($"Multiple source branches have been found, picking the first one ({first.Branch}).{FileSystemHelper.Path.NewLine}" + + $"This may result in incorrect commit counting.{FileSystemHelper.Path.NewLine}Options were:{FileSystemHelper.Path.NewLine}" + string.Join(", ", possibleBranches.Select(b => b.Branch.ToString()))); return first; } } - public SemanticVersion GetCurrentCommitTaggedVersion(ICommit? commit, string? tagPrefix, bool handleDetachedBranch) - => this.repository.Tags - .SelectMany(t => GetCurrentCommitSemanticVersions(commit, tagPrefix, t, handleDetachedBranch)) - .Max(); + public IEnumerable FindCommitBranchesBranchedFrom( + IBranch branch, IGitVersionConfiguration configuration, params IBranch[] excludedBranches) + => FindCommitBranchesBranchedFrom(branch, configuration, (IEnumerable)excludedBranches); - public IEnumerable GetVersionTagsOnBranch(IBranch branch, string? tagPrefixRegex) + public IReadOnlyList GetCommitLog(ICommit? baseVersionSource, ICommit currentCommit, IIgnoreConfiguration ignore) { - branch = branch.NotNull(); - - if (this.semanticVersionTagsOnBranchCache.ContainsKey(branch)) - { - this.log.Debug($"Cache hit for version tags on branch '{branch.Name.Canonical}"); - return this.semanticVersionTagsOnBranchCache[branch]; - } + currentCommit.NotNull(); + ignore.NotNull(); - using (this.log.IndentLog($"Getting version tags from branch '{branch.Name.Canonical}'.")) + var filter = new CommitFilter { - var tags = GetValidVersionTags(tagPrefixRegex); - var tagsBySha = tags.Where(t => t.Tag.TargetSha != null).ToLookup(t => t.Tag.TargetSha, t => t); - - var versionTags = (branch.Commits?.SelectMany(c => tagsBySha[c.Sha].Select(t => t.Semver)) ?? Enumerable.Empty()).ToList(); + IncludeReachableFrom = currentCommit, + ExcludeReachableFrom = baseVersionSource, + SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Time + }; - this.semanticVersionTagsOnBranchCache.Add(branch, versionTags); - return versionTags; - } + var commits = FilterCommits(filter).ToArray(); + return [.. ignore.Filter(commits)]; } - public IEnumerable<(ITag Tag, SemanticVersion Semver, ICommit Commit)> GetValidVersionTags(string? tagPrefixRegex, DateTimeOffset? olderThan = null) + public IReadOnlyList GetCommitsReacheableFromHead(ICommit? headCommit, IIgnoreConfiguration ignore) { - var tags = new List<(ITag, SemanticVersion, ICommit)>(); - - foreach (var tag in this.repository.Tags) + var filter = new CommitFilter { - if (!SemanticVersion.TryParse(tag.Name.Friendly, tagPrefixRegex, out var semver)) - continue; - - var commit = tag.PeeledTargetCommit(); + IncludeReachableFrom = headCommit, + SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Reverse + }; - if (commit == null) - continue; - - if (olderThan.HasValue && commit.When > olderThan.Value) - continue; + var commits = FilterCommits(filter).ToArray(); + return [.. ignore.Filter(commits)]; + } - tags.Add((tag, semver, commit)); - } + public IReadOnlyList GetCommitsReacheableFrom(ICommit commit, IBranch branch) + { + var filter = new CommitFilter { IncludeReachableFrom = branch }; - return tags; + var commits = FilterCommits(filter); + return [.. commits.Where(c => c.Sha == commit.Sha)]; } - public IEnumerable GetCommitLog(ICommit? baseVersionSource, ICommit? currentCommit) + public ICommit? GetForwardMerge(ICommit? commitToFindCommonBase, ICommit? findMergeBase) { - var filter = new CommitFilter { IncludeReachableFrom = currentCommit, ExcludeReachableFrom = baseVersionSource, SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Time }; + var filter = new CommitFilter + { + IncludeReachableFrom = commitToFindCommonBase, + ExcludeReachableFrom = findMergeBase + }; - return this.repository.Commits.QueryBy(filter); + var commits = FilterCommits(filter); + return commits.FirstOrDefault(c => c.Parents.Contains(findMergeBase)); } public bool IsCommitOnBranch(ICommit? baseVersionSource, IBranch branch, ICommit firstMatchingCommit) { var filter = new CommitFilter { IncludeReachableFrom = branch, ExcludeReachableFrom = baseVersionSource, FirstParentOnly = true }; - var commitCollection = this.repository.Commits.QueryBy(filter); - return commitCollection.Contains(firstMatchingCommit); + var commits = FilterCommits(filter); + return commits.Contains(firstMatchingCommit); } - public ICommit? FindMergeBase(ICommit commit, ICommit mainlineTip) => this.repository.FindMergeBase(commit, mainlineTip); + private IEnumerable FilterCommits(CommitFilter filter) => this.repository.Commits.QueryBy(filter); - public int GetNumberOfUncommittedChanges() => this.repository.GetNumberOfUncommittedChanges(); + public ICommit? FindMergeBase(ICommit commit, ICommit mainlineTip) => this.repository.FindMergeBase(commit, mainlineTip); - private static bool IsReleaseBranch(INamedReference branch, IEnumerable> releaseBranchConfig) - => releaseBranchConfig.Any(c => c.Value?.Regex != null && Regex.IsMatch(branch.Name.Friendly, c.Value.Regex)); + private IBranch? FindBranch(string branchName) => this.repository.Branches.FirstOrDefault(x => x.Name.EquivalentTo(branchName)); - private IEnumerable GetCurrentCommitSemanticVersions(ICommit? commit, string? tagPrefix, ITag tag, bool handleDetachedBranch) + private List FindCommitBranchesBranchedFrom( + IBranch branch, IGitVersionConfiguration configuration, IEnumerable excludedBranches) { - if (commit == null) - return Array.Empty(); - - var targetCommit = tag.PeeledTargetCommit(); - if (targetCommit == null) - return Array.Empty(); - - var commitToCompare = handleDetachedBranch ? FindMergeBase(commit, targetCommit) : commit; - - var tagName = tag.Name.Friendly; - - return Equals(targetCommit, commitToCompare) && SemanticVersion.TryParse(tagName, tagPrefix, out var version) - ? new[] { version } - : Array.Empty(); + using (this.log.IndentLog($"Finding branches source of '{branch}'")) + { + if (branch.Tip != null) return [.. new MergeCommitFinder(this, configuration, excludedBranches, this.log).FindMergeCommitsFor(branch)]; + this.log.Warning($"{branch} has no tip."); + return []; + } } } diff --git a/src/GitVersion.Core/Core/SourceBranchFinder.cs b/src/GitVersion.Core/Core/SourceBranchFinder.cs index d462b38c40..5d8b4095d3 100644 --- a/src/GitVersion.Core/Core/SourceBranchFinder.cs +++ b/src/GitVersion.Core/Core/SourceBranchFinder.cs @@ -1,20 +1,15 @@ using System.Text.RegularExpressions; using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; namespace GitVersion; -internal class SourceBranchFinder +internal class SourceBranchFinder(IEnumerable excludedBranches, IGitVersionConfiguration configuration) { - private readonly Config configuration; - private readonly IEnumerable excludedBranches; - - public SourceBranchFinder(IEnumerable excludedBranches, Config configuration) - { - this.excludedBranches = excludedBranches.NotNull(); - this.configuration = configuration.NotNull(); - } + private readonly IGitVersionConfiguration configuration = configuration.NotNull(); + private readonly IEnumerable excludedBranches = excludedBranches.NotNull(); public IEnumerable FindSourceBranchesOf(IBranch branch) { @@ -22,43 +17,35 @@ public IEnumerable FindSourceBranchesOf(IBranch branch) return this.excludedBranches.Where(predicate.IsSourceBranch); } - private class SourceBranchPredicate + private class SourceBranchPredicate(IBranch branch, IGitVersionConfiguration configuration) { - private readonly IBranch branch; - private readonly IEnumerable sourceBranchRegexes; - - public SourceBranchPredicate(IBranch branch, Config configuration) - { - this.branch = branch; - this.sourceBranchRegexes = GetSourceBranchRegexes(branch, configuration); - } + private readonly IEnumerable sourceBranchRegexes = GetSourceBranchRegexes(branch, configuration); public bool IsSourceBranch(INamedReference sourceBranchCandidate) { - if (Equals(sourceBranchCandidate, this.branch)) + if (Equals(sourceBranchCandidate, branch)) return false; - var branchName = sourceBranchCandidate.Name.Friendly; + var branchName = sourceBranchCandidate.Name.WithoutOrigin; - return this.sourceBranchRegexes - .Any(regex => Regex.IsMatch(branchName, regex)); + return this.sourceBranchRegexes.Any(regex => regex.IsMatch(branchName)); } - private static IEnumerable GetSourceBranchRegexes(INamedReference branch, Config configuration) + private static IEnumerable GetSourceBranchRegexes(INamedReference branch, IGitVersionConfiguration configuration) { - var branchName = branch.Name.WithoutRemote; - var currentBranchConfig = configuration.GetBranchConfiguration(branchName); - if (currentBranchConfig.SourceBranches == null) + var currentBranchConfig = configuration.GetBranchConfiguration(branch.Name); + if (currentBranchConfig is { SourceBranches: null }) { - yield return ".*"; + yield return RegexPatterns.Cache.GetOrAdd(".*"); } else { + var branches = configuration.Branches; foreach (var sourceBranch in currentBranchConfig.SourceBranches) { - var regex = configuration.Branches[sourceBranch]?.Regex; + var regex = branches[sourceBranch].RegularExpression; if (regex != null) - yield return regex; + yield return RegexPatterns.Cache.GetOrAdd(regex); } } } diff --git a/src/GitVersion.Core/Core/TaggedSemanticVersionRepository.cs b/src/GitVersion.Core/Core/TaggedSemanticVersionRepository.cs new file mode 100644 index 0000000000..60bf291f6b --- /dev/null +++ b/src/GitVersion.Core/Core/TaggedSemanticVersionRepository.cs @@ -0,0 +1,136 @@ +using System.Collections.Concurrent; +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.Core; + +internal sealed class TaggedSemanticVersionRepository(ILog log, IRepositoryStore repositoryStore) : ITaggedSemanticVersionRepository +{ + private readonly ConcurrentDictionary<(IBranch, string, SemanticVersionFormat), IReadOnlyList> + taggedSemanticVersionsOfBranchCache = new(); + private readonly ConcurrentDictionary<(IBranch, string, SemanticVersionFormat), IReadOnlyList<(ICommit Key, SemanticVersionWithTag Value)>> + taggedSemanticVersionsOfMergeTargetCache = new(); + private readonly ConcurrentDictionary<(string, SemanticVersionFormat), IReadOnlyList> + taggedSemanticVersionsCache = new(); + private readonly ILog log = log.NotNull(); + + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + + public ILookup GetTaggedSemanticVersionsOfBranch( + IBranch branch, string? tagPrefix, SemanticVersionFormat format, IIgnoreConfiguration ignore) + { + branch.NotNull(); + tagPrefix ??= string.Empty; + + var isCached = true; + var result = taggedSemanticVersionsOfBranchCache.GetOrAdd(new(branch, tagPrefix, format), _ => + { + isCached = false; + return [.. GetElements().Distinct().OrderByDescending(element => element.Tag.Commit.When)]; + }); + + if (isCached) + { + this.log.Debug( + $"Returning cached tagged semantic versions on branch '{branch.Name.Canonical}'. " + + $"TagPrefix: {tagPrefix} and Format: {format}" + ); + } + + return result.ToLookup(element => element.Tag.Commit, element => element); + + IEnumerable GetElements() + { + using (this.log.IndentLog($"Getting tagged semantic versions on branch '{branch.Name.Canonical}'. " + + $"TagPrefix: {tagPrefix} and Format: {format}")) + { + var semanticVersions = GetTaggedSemanticVersions(tagPrefix, format, ignore); + + foreach (var commit in ignore.Filter(branch.Commits.ToArray())) + { + foreach (var semanticVersion in semanticVersions[commit]) + { + yield return semanticVersion; + } + } + } + } + } + + public ILookup GetTaggedSemanticVersionsOfMergeTarget( + IBranch branch, string? tagPrefix, SemanticVersionFormat format, IIgnoreConfiguration ignore) + { + branch.NotNull(); + tagPrefix ??= string.Empty; + + var isCached = true; + var result = taggedSemanticVersionsOfMergeTargetCache.GetOrAdd(new(branch, tagPrefix, format), _ => + { + isCached = false; + return [.. GetElements().Distinct().OrderByDescending(element => element.Key.When)]; + }); + + if (isCached) + { + this.log.Debug( + $"Returning cached tagged semantic versions by track merge target '{branch.Name.Canonical}'. " + + $"TagPrefix: {tagPrefix} and Format: {format}" + ); + } + + return result.ToLookup(element => element.Key, element => element.Value); + + IEnumerable<(ICommit Key, SemanticVersionWithTag Value)> GetElements() + { + using (this.log.IndentLog($"Getting tagged semantic versions by track merge target '{branch.Name.Canonical}'. " + + $"TagPrefix: {tagPrefix} and Format: {format}")) + { + var shaHashSet = new HashSet(ignore.Filter(branch.Commits.ToArray()).Select(element => element.Id.Sha)); + + foreach (var semanticVersion in GetTaggedSemanticVersions(tagPrefix, format, ignore).SelectMany(v => v)) + { + foreach (var commit in semanticVersion.Tag.Commit.Parents.Where(element => shaHashSet.Contains(element.Id.Sha))) + { + yield return new(commit, semanticVersion); + } + } + } + } + } + + public ILookup GetTaggedSemanticVersions( + string? tagPrefix, SemanticVersionFormat format, IIgnoreConfiguration ignore) + { + tagPrefix ??= string.Empty; + + var isCached = true; + var result = taggedSemanticVersionsCache.GetOrAdd(new(tagPrefix, format), _ => + { + isCached = false; + return [.. GetElements().OrderByDescending(element => element.Tag.Commit.When)]; + }); + + if (isCached) + { + this.log.Debug($"Returning cached tagged semantic versions. TagPrefix: {tagPrefix} and Format: {format}"); + } + + return result.ToLookup(element => element.Tag.Commit, element => element); + + IEnumerable GetElements() + { + this.log.Info($"Getting tagged semantic versions. TagPrefix: {tagPrefix} and Format: {format}"); + + foreach (var tag in ignore.Filter(this.repositoryStore.Tags.ToArray())) + { + if (SemanticVersion.TryParse(tag.Name.Friendly, tagPrefix, out var semanticVersion, format)) + { + yield return new(semanticVersion, tag); + } + } + } + } +} diff --git a/src/GitVersion.Core/Core/TaggedSemanticVersionService.cs b/src/GitVersion.Core/Core/TaggedSemanticVersionService.cs new file mode 100644 index 0000000000..37a65a1930 --- /dev/null +++ b/src/GitVersion.Core/Core/TaggedSemanticVersionService.cs @@ -0,0 +1,249 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +using CommitSemanticVersion = (GitVersion.Git.ICommit Commit, GitVersion.SemanticVersionWithTag SemanticVersion); + +namespace GitVersion.Core; + +internal sealed class TaggedSemanticVersionService( + ITaggedSemanticVersionRepository repository, IBranchRepository branchRepository) + : ITaggedSemanticVersionService +{ + private readonly ITaggedSemanticVersionRepository repository = repository.NotNull(); + + private readonly IBranchRepository branchRepository = branchRepository.NotNull(); + + public ILookup GetTaggedSemanticVersions( + IBranch branch, + IGitVersionConfiguration configuration, + string? label, + DateTimeOffset? notOlderThan, + TaggedSemanticVersions taggedSemanticVersion) + { + return GetElements().SelectMany(elements => elements).Distinct() + .OrderByDescending(element => element.Commit.When) + .ToLookup(element => element.Commit, element => element.SemanticVersion); + + IEnumerable> GetElements() + { + if (taggedSemanticVersion.HasFlag(TaggedSemanticVersions.OfBranch)) + { + yield return GetTaggedSemanticVersionsOfBranchInternal( + branch: branch, + tagPrefix: configuration.TagPrefixPattern, + format: configuration.SemanticVersionFormat, + ignore: configuration.Ignore, + label: label, + notOlderThan: notOlderThan + ); + } + + if (taggedSemanticVersion.HasFlag(TaggedSemanticVersions.OfMergeTargets)) + { + yield return GetTaggedSemanticVersionsOfMergeTargetInternal( + branch: branch, + tagPrefix: configuration.TagPrefixPattern, + format: configuration.SemanticVersionFormat, + ignore: configuration.Ignore, + label: label, + notOlderThan: notOlderThan + ); + } + + if (taggedSemanticVersion.HasFlag(TaggedSemanticVersions.OfMainBranches)) + { + yield return GetTaggedSemanticVersionsOfMainBranchesInternal( + configuration: configuration, + notOlderThan: notOlderThan, + label: label, + excludeBranches: branch + ); + } + + if (taggedSemanticVersion.HasFlag(TaggedSemanticVersions.OfReleaseBranches)) + { + yield return GetTaggedSemanticVersionsOfReleaseBranchesInternal( + configuration: configuration, + notOlderThan: notOlderThan, + label: label, + excludeBranches: branch + ); + } + } + } + + public ILookup GetTaggedSemanticVersionsOfBranch( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label, + DateTimeOffset? notOlderThan) + { + var result = GetTaggedSemanticVersionsOfBranchInternal( + branch: branch, + tagPrefix: tagPrefix, + format: format, + ignore: ignore, + label: label, + notOlderThan: notOlderThan); + + return result.Distinct().OrderByDescending(element => element.Commit.When) + .ToLookup(element => element.Commit, element => element.SemanticVersion); + } + + private IEnumerable GetTaggedSemanticVersionsOfBranchInternal( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label, + DateTimeOffset? notOlderThan) + { + var semanticVersionsOfBranch = this.repository.GetTaggedSemanticVersionsOfBranch( + branch: branch, tagPrefix: tagPrefix, format: format, ignore: ignore + ); + foreach (var grouping in semanticVersionsOfBranch) + { + if (grouping.Key.When > notOlderThan) continue; + + foreach (var semanticVersion in grouping) + { + if (semanticVersion.Value.IsMatchForBranchSpecificLabel(label)) + { + yield return (grouping.Key, semanticVersion); + } + } + } + } + + public ILookup GetTaggedSemanticVersionsOfMergeTarget( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label, + DateTimeOffset? notOlderThan) + { + var result = GetTaggedSemanticVersionsOfMergeTargetInternal( + branch: branch, + tagPrefix: tagPrefix, + format: format, + ignore: ignore, + label: label, + notOlderThan: notOlderThan); + + return result.Distinct() + .OrderByDescending(element => element.Commit.When) + .ToLookup(element => element.Commit, element => element.SemanticVersion); + } + + private IEnumerable GetTaggedSemanticVersionsOfMergeTargetInternal( + IBranch branch, + string? tagPrefix, + SemanticVersionFormat format, + IIgnoreConfiguration ignore, + string? label, + DateTimeOffset? notOlderThan) + { + var semanticVersionsOfMergeTarget = this.repository.GetTaggedSemanticVersionsOfMergeTarget( + branch: branch, + tagPrefix: tagPrefix, + format: format, + ignore: ignore + ); + foreach (var grouping in semanticVersionsOfMergeTarget) + { + if (grouping.Key.When > notOlderThan) continue; + + foreach (var semanticVersion in grouping) + { + if (semanticVersion.Value.IsMatchForBranchSpecificLabel(label)) + { + yield return new(grouping.Key, semanticVersion); + } + } + } + } + + public ILookup GetTaggedSemanticVersionsOfMainBranches( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan, + string? label, + params IBranch[] excludeBranches) + { + var result = GetTaggedSemanticVersionsOfMainBranchesInternal( + configuration: configuration, + notOlderThan: notOlderThan, + label: label, + excludeBranches: excludeBranches); + + return result.Distinct() + .OrderByDescending(element => element.Commit.When) + .ToLookup(element => element.Commit, element => element.SemanticVersion); + } + + private IEnumerable GetTaggedSemanticVersionsOfMainBranchesInternal( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan, + string? label, + params IBranch[] excludeBranches) + { + foreach (var releaseBranch in this.branchRepository.GetMainBranches(configuration, excludeBranches)) + { + var taggedSemanticVersions = GetTaggedSemanticVersionsOfBranchInternal( + branch: releaseBranch, + tagPrefix: configuration.TagPrefixPattern, + format: configuration.SemanticVersionFormat, + ignore: configuration.Ignore, + label: label, + notOlderThan: notOlderThan); + + foreach (var semanticVersion in taggedSemanticVersions) + { + yield return semanticVersion; + } + } + } + + public ILookup GetTaggedSemanticVersionsOfReleaseBranches( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan, + string? label, + params IBranch[] excludeBranches) + { + var result = GetTaggedSemanticVersionsOfReleaseBranchesInternal( + configuration: configuration, + notOlderThan: notOlderThan, + label: label, + excludeBranches: excludeBranches); + + return result.Distinct() + .OrderByDescending(element => element.Commit.When) + .ToLookup(element => element.Commit, element => element.SemanticVersion); + } + + private IEnumerable GetTaggedSemanticVersionsOfReleaseBranchesInternal( + IGitVersionConfiguration configuration, + DateTimeOffset? notOlderThan, + string? label, + params IBranch[] excludeBranches) + { + foreach (var releaseBranch in this.branchRepository.GetReleaseBranches(configuration, excludeBranches)) + { + var taggedSemanticVersions = GetTaggedSemanticVersionsOfBranchInternal( + branch: releaseBranch, + tagPrefix: configuration.TagPrefixPattern, + format: configuration.SemanticVersionFormat, + ignore: configuration.Ignore, + label: label, + notOlderThan: notOlderThan); + + foreach (var semanticVersion in taggedSemanticVersions) + { + yield return semanticVersion; + } + } + } +} diff --git a/src/GitVersion.Core/Core/TaggedSemanticVersions.cs b/src/GitVersion.Core/Core/TaggedSemanticVersions.cs new file mode 100644 index 0000000000..898a70bd79 --- /dev/null +++ b/src/GitVersion.Core/Core/TaggedSemanticVersions.cs @@ -0,0 +1,17 @@ +namespace GitVersion.Core; + +[Flags] +internal enum TaggedSemanticVersions +{ + None = 0, + + OfBranch = 1, + + OfMergeTargets = 2, + + OfMainBranches = 4, + + OfReleaseBranches = 8, + + All = OfBranch | OfMergeTargets | OfMainBranches | OfReleaseBranches +} diff --git a/src/GitVersion.Core/Extensions/AssemblyInfo.cs b/src/GitVersion.Core/Extensions/AssemblyInfo.cs deleted file mode 100644 index a45791ac7e..0000000000 --- a/src/GitVersion.Core/Extensions/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("GitVersion.Core.Tests")] -[assembly: InternalsVisibleTo("GitVersion.App.Tests")] -[assembly: InternalsVisibleTo("GitVersion.MsBuild.Tests")] diff --git a/src/GitVersion.Core/Extensions/AssemblyVersionsGeneratorExtensions.cs b/src/GitVersion.Core/Extensions/AssemblyVersionsGeneratorExtensions.cs index d92d63d559..d4465c8eac 100644 --- a/src/GitVersion.Core/Extensions/AssemblyVersionsGeneratorExtensions.cs +++ b/src/GitVersion.Core/Extensions/AssemblyVersionsGeneratorExtensions.cs @@ -1,22 +1,6 @@ -namespace GitVersion.Extensions; - -public enum AssemblyFileVersioningScheme -{ - MajorMinorPatchTag, - MajorMinorPatch, - MajorMinor, - Major, - None -} +using GitVersion.Configuration; -public enum AssemblyVersioningScheme -{ - MajorMinorPatchTag, - MajorMinorPatch, - MajorMinor, - Major, - None -} +namespace GitVersion.Extensions; public static class AssemblyVersionsGeneratorExtensions { @@ -26,7 +10,7 @@ public static class AssemblyVersionsGeneratorExtensions AssemblyVersioningScheme.Major => $"{sv.Major}.0.0.0", AssemblyVersioningScheme.MajorMinor => $"{sv.Major}.{sv.Minor}.0.0", AssemblyVersioningScheme.MajorMinorPatch => $"{sv.Major}.{sv.Minor}.{sv.Patch}.0", - AssemblyVersioningScheme.MajorMinorPatchTag => $"{sv.Major}.{sv.Minor}.{sv.Patch}.{sv.PreReleaseTag?.Number ?? 0}", + AssemblyVersioningScheme.MajorMinorPatchTag => $"{sv.Major}.{sv.Minor}.{sv.Patch}.{sv.PreReleaseTag.Number ?? 0}", AssemblyVersioningScheme.None => null, _ => throw new ArgumentException($"Unexpected value ({scheme}).", nameof(scheme)) }; @@ -37,7 +21,7 @@ public static class AssemblyVersionsGeneratorExtensions AssemblyFileVersioningScheme.Major => $"{sv.Major}.0.0.0", AssemblyFileVersioningScheme.MajorMinor => $"{sv.Major}.{sv.Minor}.0.0", AssemblyFileVersioningScheme.MajorMinorPatch => $"{sv.Major}.{sv.Minor}.{sv.Patch}.0", - AssemblyFileVersioningScheme.MajorMinorPatchTag => $"{sv.Major}.{sv.Minor}.{sv.Patch}.{sv.PreReleaseTag?.Number ?? 0}", + AssemblyFileVersioningScheme.MajorMinorPatchTag => $"{sv.Major}.{sv.Minor}.{sv.Patch}.{sv.PreReleaseTag.Number ?? 0}", AssemblyFileVersioningScheme.None => null, _ => throw new ArgumentException($"Unexpected value ({scheme}).", nameof(scheme)) }; diff --git a/src/GitVersion.Core/Extensions/CallerArgumentExpressionAttribute.cs b/src/GitVersion.Core/Extensions/CallerArgumentExpressionAttribute.cs deleted file mode 100644 index f2eecbc3a7..0000000000 --- a/src/GitVersion.Core/Extensions/CallerArgumentExpressionAttribute.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace System.Runtime.CompilerServices; - -#if !NET5_0 && !NET6_0 - -/// -/// Allows capturing of the expressions passed to a method. -/// -[AttributeUsage(AttributeTargets.Parameter)] -public sealed class CallerArgumentExpressionAttribute : Attribute -{ - /// - /// Initializes a new instance of the class. - /// - /// The name of the targeted parameter. - public CallerArgumentExpressionAttribute(string parameterName) => this.ParameterName = parameterName; - - /// - /// Gets the target parameter name of the CallerArgumentExpression. - /// - /// - /// The name of the targeted parameter of the CallerArgumentExpression. - /// - public string ParameterName { get; } -} -#endif diff --git a/src/GitVersion.Core/Extensions/CommonExtensions.cs b/src/GitVersion.Core/Extensions/CommonExtensions.cs index 5cd5018df9..bcb368cb5a 100644 --- a/src/GitVersion.Core/Extensions/CommonExtensions.cs +++ b/src/GitVersion.Core/Extensions/CommonExtensions.cs @@ -5,30 +5,26 @@ namespace GitVersion.Extensions; public static class CommonExtensions { - public static T NotNull([NotNull] this T? value, [CallerArgumentExpression("value")] string name = "") + public static T NotNull([NotNull] this T? value, [CallerArgumentExpression(nameof(value))] string name = "") where T : class => value ?? throw new ArgumentNullException(name); - public static string NotNullOrEmpty([NotNull] this string? value, [CallerArgumentExpression("value")] string name = "") + public static string NotNullOrEmpty([NotNull] this string? value, [CallerArgumentExpression(nameof(value))] string name = "") { if (string.IsNullOrEmpty(value)) { throw new ArgumentException("The parameter is null or empty.", name); } -#pragma warning disable CS8777 // Parameter must have a non-null value when exiting. - return value!; -#pragma warning restore CS8777 // Parameter must have a non-null value when exiting. + return value; } - public static string NotNullOrWhitespace([NotNull] this string? value, [CallerArgumentExpression("value")] string name = "") + public static string NotNullOrWhitespace([NotNull] this string? value, [CallerArgumentExpression(nameof(value))] string name = "") { if (string.IsNullOrWhiteSpace(value)) { throw new ArgumentException("The parameter is null or empty or contains only white space.", name); } -#pragma warning disable CS8777 // Parameter must have a non-null value when exiting. - return value!; -#pragma warning restore CS8777 // Parameter must have a non-null value when exiting. + return value; } } diff --git a/src/GitVersion.Core/Extensions/ConfigurationExtensions.cs b/src/GitVersion.Core/Extensions/ConfigurationExtensions.cs new file mode 100644 index 0000000000..20d51dbdcc --- /dev/null +++ b/src/GitVersion.Core/Extensions/ConfigurationExtensions.cs @@ -0,0 +1,156 @@ +using System.IO.Abstractions; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; +using GitVersion.VersionCalculation; + +namespace GitVersion.Configuration; + +internal static class ConfigurationExtensions +{ + public static EffectiveBranchConfiguration GetEffectiveBranchConfiguration( + this IGitVersionConfiguration configuration, IBranch branch, EffectiveConfiguration? parentConfiguration = null) + { + var effectiveConfiguration = GetEffectiveConfiguration(configuration, branch.Name, parentConfiguration); + return new EffectiveBranchConfiguration(effectiveConfiguration, branch); + } + + public static EffectiveConfiguration GetEffectiveConfiguration( + this IGitVersionConfiguration configuration, ReferenceName branchName, EffectiveConfiguration? parentConfiguration = null) + { + var branchConfiguration = configuration.GetBranchConfiguration(branchName); + EffectiveConfiguration? fallbackConfiguration = null; + if (branchConfiguration.Increment == IncrementStrategy.Inherit) + { + fallbackConfiguration = parentConfiguration; + } + return new EffectiveConfiguration(configuration, branchConfiguration, fallbackConfiguration); + } + + public static IBranchConfiguration GetBranchConfiguration(this IGitVersionConfiguration configuration, IBranch branch) + => GetBranchConfiguration(configuration, branch.NotNull().Name); + + public static IBranchConfiguration GetBranchConfiguration(this IGitVersionConfiguration configuration, ReferenceName branchName) + { + var branchConfiguration = GetBranchConfigurations(configuration, branchName.WithoutOrigin).FirstOrDefault(); + branchConfiguration ??= configuration.GetEmptyBranchConfiguration(); + return branchConfiguration; + } + + public static IEnumerable ToFilters(this IIgnoreConfiguration source) + { + source.NotNull(); + + if (source.Shas.Count != 0) yield return new ShaVersionFilter(source.Shas); + if (source.Before.HasValue) yield return new MinDateVersionFilter(source.Before.Value); + if (source.Paths.Count != 0) yield return new PathFilter(source.Paths.ToList()); + } + + private static IEnumerable GetBranchConfigurations(IGitVersionConfiguration configuration, string branchName) + { + IBranchConfiguration? unknownBranchConfiguration = null; + foreach (var (key, branchConfiguration) in configuration.Branches) + { + if (!branchConfiguration.IsMatch(branchName)) continue; + if (key == "unknown") + { + unknownBranchConfiguration = branchConfiguration; + } + else + { + yield return branchConfiguration; + } + } + + if (unknownBranchConfiguration != null) yield return unknownBranchConfiguration; + } + + public static IBranchConfiguration GetFallbackBranchConfiguration(this IGitVersionConfiguration configuration) => configuration; + + public static bool IsReleaseBranch(this IGitVersionConfiguration configuration, IBranch branch) + => IsReleaseBranch(configuration, branch.NotNull().Name); + + public static bool IsReleaseBranch(this IGitVersionConfiguration configuration, ReferenceName branchName) + => configuration.GetBranchConfiguration(branchName).IsReleaseBranch ?? false; + + public static string? GetBranchSpecificLabel( + this EffectiveConfiguration configuration, ReferenceName branchName, string? branchNameOverride) + => GetBranchSpecificLabel(configuration, branchName.WithoutOrigin, branchNameOverride); + + public static string? GetBranchSpecificLabel( + this EffectiveConfiguration configuration, string? branchName, string? branchNameOverride) + { + configuration.NotNull(); + + var label = configuration.Label; + if (label is null) + { + return label; + } + + var effectiveBranchName = branchNameOverride ?? branchName; + if (configuration.RegularExpression.IsNullOrWhiteSpace() || effectiveBranchName.IsNullOrEmpty()) return label; + var regex = RegexPatterns.Cache.GetOrAdd(configuration.RegularExpression); + var match = regex.Match(effectiveBranchName); + if (!match.Success) return label; + foreach (var groupName in regex.GetGroupNames()) + { + var groupValue = match.Groups[groupName].Value; + Lazy escapedGroupValueLazy = new(() => EscapeInvalidCharacters(groupValue)); + var placeholder = $"{{{groupName}}}"; + int index, startIndex = 0; + while ((index = label.IndexOf(placeholder, startIndex, StringComparison.InvariantCulture)) >= 0) + { + var escapedGroupValue = escapedGroupValueLazy.Value; + label = label.Remove(index, placeholder.Length).Insert(index, escapedGroupValue); + startIndex = index + escapedGroupValue.Length; + } + } + return label; + } + + private static string EscapeInvalidCharacters(string groupValue) => groupValue.RegexReplace(RegexPatterns.Common.SanitizeNameRegexPattern, "-"); + + public static (string GitDirectory, string WorkingTreeDirectory)? FindGitDir(this IFileSystem fileSystem, string? path) + { + var startingDir = path; + while (startingDir is not null) + { + var dirOrFilePath = FileSystemHelper.Path.Combine(startingDir, ".git"); + if (fileSystem.Directory.Exists(dirOrFilePath)) + { + return (dirOrFilePath, FileSystemHelper.Path.GetDirectoryName(dirOrFilePath)); + } + + if (fileSystem.File.Exists(dirOrFilePath)) + { + var relativeGitDirPath = ReadGitDirFromFile(fileSystem, dirOrFilePath); + if (!string.IsNullOrWhiteSpace(relativeGitDirPath)) + { + var fullGitDirPath = FileSystemHelper.Path.GetFullPath(FileSystemHelper.Path.Combine(startingDir, relativeGitDirPath)); + if (fileSystem.Directory.Exists(fullGitDirPath)) + { + return (fullGitDirPath, FileSystemHelper.Path.GetDirectoryName(dirOrFilePath)); + } + } + } + + startingDir = FileSystemHelper.Path.GetDirectoryName(startingDir); + } + + return null; + } + + private static string? ReadGitDirFromFile(IFileSystem fileSystem, string fileName) + { + const string expectedPrefix = "gitdir: "; + var firstLineOfFile = fileSystem.File.ReadLines(fileName).FirstOrDefault(); + if (firstLineOfFile?.StartsWith(expectedPrefix) ?? false) + { + return firstLineOfFile[expectedPrefix.Length..]; // strip off the prefix, leaving just the path + } + + return null; + } +} diff --git a/src/GitVersion.Core/Extensions/DictionaryExtensions.cs b/src/GitVersion.Core/Extensions/DictionaryExtensions.cs index ade4ffb7c6..02f0f28a66 100644 --- a/src/GitVersion.Core/Extensions/DictionaryExtensions.cs +++ b/src/GitVersion.Core/Extensions/DictionaryExtensions.cs @@ -1,16 +1,15 @@ namespace GitVersion.Extensions; -public static class DictionaryExtensions +internal static class DictionaryExtensions { - public static TValue GetOrAdd(this IDictionary dict, TKey key, Func getValue) + internal static TValue GetOrAdd(this Dictionary dict, TKey key, Func getValue) where TKey : notnull { - if (dict is null) throw new ArgumentNullException(nameof(dict)); - if (getValue is null) throw new ArgumentNullException(nameof(getValue)); - if (!dict.TryGetValue(key, out TValue value)) - { - value = getValue(); - dict.Add(key, value); - } + ArgumentNullException.ThrowIfNull(dict); + ArgumentNullException.ThrowIfNull(getValue); + + if (dict.TryGetValue(key, out var value)) return value; + value = getValue(); + dict.Add(key, value); return value; } } diff --git a/src/GitVersion.Core/Extensions/EnumerableExtensions.cs b/src/GitVersion.Core/Extensions/EnumerableExtensions.cs index 33abab23d1..764fb89008 100644 --- a/src/GitVersion.Core/Extensions/EnumerableExtensions.cs +++ b/src/GitVersion.Core/Extensions/EnumerableExtensions.cs @@ -4,12 +4,11 @@ public static class EnumerableExtensions { public static T? OnlyOrDefault(this IEnumerable source) { - switch (source) + ArgumentNullException.ThrowIfNull(source); + + if (source is IList { Count: 1 } list) { - case null: - throw new ArgumentNullException(nameof(source)); - case IList { Count: 1 } list: - return list[0]; + return list[0]; } using var e = source.GetEnumerator(); @@ -18,4 +17,21 @@ public static class EnumerableExtensions var current = e.Current; return !e.MoveNext() ? current : default; } + + public static T SingleOfType(this IEnumerable source) + { + ArgumentNullException.ThrowIfNull(source); + + return source.OfType().Single(); + } + + public static void AddRange(this ICollection source, IEnumerable items) + { + source.NotNull(); + + foreach (var item in items.NotNull()) + { + source.Add(item); + } + } } diff --git a/src/GitVersion.Core/Extensions/FileSystemExtensions.cs b/src/GitVersion.Core/Extensions/FileSystemExtensions.cs new file mode 100644 index 0000000000..213eea6a76 --- /dev/null +++ b/src/GitVersion.Core/Extensions/FileSystemExtensions.cs @@ -0,0 +1,13 @@ +using System.IO.Abstractions; + +namespace GitVersion.Extensions; + +public static class FileSystemExtensions +{ + public static long GetLastDirectoryWrite(this IFileSystem fileSystem, string path) => fileSystem.DirectoryInfo.New(path) + .GetDirectories("*.*", SearchOption.AllDirectories) + .Select(d => d.LastWriteTimeUtc) + .DefaultIfEmpty() + .Max() + .Ticks; +} diff --git a/src/GitVersion.Core/Extensions/GitExtensions.cs b/src/GitVersion.Core/Extensions/GitExtensions.cs index e17bee2207..104fa9d3ee 100644 --- a/src/GitVersion.Core/Extensions/GitExtensions.cs +++ b/src/GitVersion.Core/Extensions/GitExtensions.cs @@ -1,33 +1,11 @@ -using GitVersion.Helpers; - namespace GitVersion.Extensions; public static class GitExtensions { - public static void DumpGraph(string workingDirectory, Action? writer = null, int? maxCommits = null) + public static void DumpGraphLog(Action? writer = null, int? maxCommits = null) { var output = new StringBuilder(); - try - { - ProcessHelper.Run( - o => output.AppendLine(o), - e => output.AppendLineFormat("ERROR: {0}", e), - null, - "git", - CreateGitLogArgs(maxCommits), - workingDirectory); - } - catch (FileNotFoundException exception) - { - if (exception.FileName != "git") - { - throw; - } - - output.AppendLine("Could not execute 'git log' due to the following error:"); - output.AppendLine(exception.ToString()); - } - + output.AppendLine($"Please run `git {CreateGitLogArgs(maxCommits)}` to see the git graph. This can help you troubleshoot any issues."); if (writer != null) { writer(output.ToString()); @@ -41,6 +19,6 @@ public static void DumpGraph(string workingDirectory, Action? writer = n public static string CreateGitLogArgs(int? maxCommits) { var commits = maxCommits != null ? $" -n {maxCommits}" : null; - return $@"log --graph --format=""%h %cr %d"" --decorate --date=relative --all --remotes=*{commits}"; + return $"""log --graph --format="%h %cr %d" --decorate --date=relative --all --remotes=*{commits}"""; } } diff --git a/src/GitVersion.Core/Extensions/IncrementStrategyExtensions.cs b/src/GitVersion.Core/Extensions/IncrementStrategyExtensions.cs new file mode 100644 index 0000000000..eb84a57dce --- /dev/null +++ b/src/GitVersion.Core/Extensions/IncrementStrategyExtensions.cs @@ -0,0 +1,13 @@ +namespace GitVersion.Extensions; + +public static class IncrementStrategyExtensions +{ + public static VersionField ToVersionField(this IncrementStrategy strategy) => strategy switch + { + IncrementStrategy.None => VersionField.None, + IncrementStrategy.Major => VersionField.Major, + IncrementStrategy.Minor => VersionField.Minor, + IncrementStrategy.Patch => VersionField.Patch, + _ => throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null) + }; +} diff --git a/src/GitVersion.Core/Extensions/NullableAttributes.cs b/src/GitVersion.Core/Extensions/NullableAttributes.cs deleted file mode 100644 index 65c7bebbb1..0000000000 --- a/src/GitVersion.Core/Extensions/NullableAttributes.cs +++ /dev/null @@ -1,147 +0,0 @@ -// This was copied from https://github.com/dotnet/coreclr/blob/60f1e6265bd1039f023a82e0643b524d6aaf7845/src/System.Private.CoreLib/shared/System/Diagnostics/CodeAnalysis/NullableAttributes.cs -// and updated to have the scope of the attributes be internal. - -#pragma warning disable CA1019 // Define accessors for attribute arguments - -namespace System.Diagnostics.CodeAnalysis; -#if !NETCOREAPP - -/// Specifies that null is allowed as an input even if the corresponding type disallows it. -[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] -internal sealed class AllowNullAttribute : Attribute { } - -/// Specifies that null is disallowed as an input even if the corresponding type allows it. -[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] -internal sealed class DisallowNullAttribute : Attribute { } - -/// Specifies that an output may be null even if the corresponding type disallows it. -[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] -internal sealed class MaybeNullAttribute : Attribute { } - -/// Specifies that an output will not be null even if the corresponding type allows it. -[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] -internal sealed class NotNullAttribute : Attribute { } - -/// Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. -[AttributeUsage(AttributeTargets.Parameter)] -internal sealed class MaybeNullWhenAttribute : Attribute -{ - /// Initializes the attribute with the specified return value condition. - /// - /// The return value condition. If the method returns this value, the associated parameter may be null. - /// - public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; - - /// Gets the return value condition. - public bool ReturnValue { get; } -} - -/// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. -[AttributeUsage(AttributeTargets.Parameter)] -internal sealed class NotNullWhenAttribute : Attribute -{ - /// Initializes the attribute with the specified return value condition. - /// - /// The return value condition. If the method returns this value, the associated parameter will not be null. - /// - public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; - - /// Gets the return value condition. - public bool ReturnValue { get; } -} - -/// Specifies that the output will be non-null if the named parameter is non-null. -[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)] -internal sealed class NotNullIfNotNullAttribute : Attribute -{ - /// Initializes the attribute with the associated parameter name. - /// - /// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null. - /// - public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName; - - /// Gets the associated parameter name. - public string ParameterName { get; } -} - -/// Applied to a method that will never return under any circumstance. -[AttributeUsage(AttributeTargets.Method, Inherited = false)] -internal sealed class DoesNotReturnAttribute : Attribute { } - -/// Specifies that the method will not return if the associated Boolean parameter is passed the specified value. -[AttributeUsage(AttributeTargets.Parameter)] -internal sealed class DoesNotReturnIfAttribute : Attribute -{ - /// Initializes the attribute with the specified parameter value. - /// - /// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to - /// the associated parameter matches this value. - /// - public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue; - - /// Gets the condition parameter value. - public bool ParameterValue { get; } -} - -#endif - -#if !NETCOREAPP || NETCOREAPP3_1 - -/// Specifies that the method or property will ensure that the listed field and property members have not-null values. -[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] -internal sealed class MemberNotNullAttribute : Attribute -{ - /// Initializes the attribute with a field or property member. - /// - /// The field or property member that is promised to be not-null. - /// - public MemberNotNullAttribute(string member) => Members = new[] { member }; - - /// Initializes the attribute with the list of field and property members. - /// - /// The list of field and property members that are promised to be not-null. - /// - public MemberNotNullAttribute(params string[] members) => Members = members; - - /// Gets field or property member names. - public string[] Members { get; } -} - -/// Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. -[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] -internal sealed class MemberNotNullWhenAttribute : Attribute -{ - /// Initializes the attribute with the specified return value condition and a field or property member. - /// - /// The return value condition. If the method returns this value, the associated parameter will not be null. - /// - /// - /// The field or property member that is promised to be not-null. - /// - public MemberNotNullWhenAttribute(bool returnValue, string member) - { - ReturnValue = returnValue; - Members = new[] { member }; - } - - /// Initializes the attribute with the specified return value condition and list of field and property members. - /// - /// The return value condition. If the method returns this value, the associated parameter will not be null. - /// - /// - /// The list of field and property members that are promised to be not-null. - /// - public MemberNotNullWhenAttribute(bool returnValue, params string[] members) - { - ReturnValue = returnValue; - Members = members; - } - - /// Gets the return value condition. - public bool ReturnValue { get; } - - /// Gets field or property member names. - public string[] Members { get; } -} - -#endif diff --git a/src/GitVersion.Core/Extensions/ObjectExtensions.cs b/src/GitVersion.Core/Extensions/ObjectExtensions.cs deleted file mode 100644 index 85857a6ef0..0000000000 --- a/src/GitVersion.Core/Extensions/ObjectExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace GitVersion.Extensions; - -public static class ObjectExtensions -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] - internal sealed class ReflectionIgnoreAttribute : Attribute - { - } - - public static void Deconstruct( - this KeyValuePair kvp, - out TKey key, - out TValue value) - { - key = kvp.Key; - value = kvp.Value; - } - - public static IEnumerable> GetProperties(this object obj) - { - var type = typeof(string); - return obj.GetType().GetProperties() - .Where(p => p.PropertyType == type && !p.GetIndexParameters().Any() && !p.GetCustomAttributes(typeof(ReflectionIgnoreAttribute), false).Any()) - .Select(p => new KeyValuePair(p.Name, (string)p.GetValue(obj, null))); - } -} diff --git a/src/GitVersion.Core/Extensions/ReadEmbeddedResourceExtensions.cs b/src/GitVersion.Core/Extensions/ReadEmbeddedResourceExtensions.cs index 3659c7e427..95391be84d 100644 --- a/src/GitVersion.Core/Extensions/ReadEmbeddedResourceExtensions.cs +++ b/src/GitVersion.Core/Extensions/ReadEmbeddedResourceExtensions.cs @@ -2,23 +2,21 @@ namespace GitVersion.Extensions; public static class ReadEmbeddedResourceExtensions { - /// - /// - /// - /// - /// Should include Namespace separated path to resource in assembly referenced by - /// public static string ReadAsStringFromEmbeddedResource(this string resourceName) + => ReadAsStringFromEmbeddedResource(resourceName, typeof(T).Assembly); + + public static string ReadAsStringFromEmbeddedResource(this string resourceName, Assembly assembly) { - using var stream = resourceName.ReadFromEmbeddedResource(); - using var rdr = new StreamReader(stream); - return rdr.ReadToEnd(); + using var stream = resourceName.ReadFromEmbeddedResource(assembly); + using var streamReader = new StreamReader(stream); + return streamReader.ReadToEnd(); } - private static Stream ReadFromEmbeddedResource(this string resourceName) + private static Stream ReadFromEmbeddedResource(this string resourceName, Assembly assembly) { - var assembly = typeof(T).Assembly; + assembly.NotNull(); - return assembly?.GetManifestResourceStream(resourceName) ?? throw new InvalidOperationException($"Could not find embedded resource {resourceName}"); + return assembly.GetManifestResourceStream(resourceName) + ?? throw new InvalidOperationException($"Could not find embedded resource {resourceName}"); } } diff --git a/src/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs b/src/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs index d4d6467f3d..153bf20e53 100644 --- a/src/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs +++ b/src/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs @@ -11,5 +11,5 @@ public static IServiceCollection AddModule(this IServiceCollection serviceCollec } public static TService GetServiceForType(this IServiceProvider serviceProvider) => - serviceProvider.GetServices().SingleOrDefault(t => t?.GetType() == typeof(TType)); + serviceProvider.GetServices().Single(t => t?.GetType() == typeof(TType)); } diff --git a/src/GitVersion.Core/Extensions/StringExtensions.cs b/src/GitVersion.Core/Extensions/StringExtensions.cs index a8a19a7a4e..cb36b0833f 100644 --- a/src/GitVersion.Core/Extensions/StringExtensions.cs +++ b/src/GitVersion.Core/Extensions/StringExtensions.cs @@ -1,98 +1,22 @@ using System.Diagnostics.CodeAnalysis; -using System.Text.RegularExpressions; -using GitVersion.Helpers; +using System.Globalization; +using GitVersion.Core; namespace GitVersion.Extensions; public static class StringExtensions { - private static readonly string[] Trues = { "1", "true" }; - private static readonly string[] Falses = { "0", "false" }; - - public static bool IsTrue(this string? value) => Trues.Contains(value, StringComparer.OrdinalIgnoreCase); - - public static bool IsFalse(this string? value) => Falses.Contains(value, StringComparer.OrdinalIgnoreCase); - - public static bool IsValidPath(this string? path) - { - if (path == null) - return false; - - try - { - _ = Path.GetFullPath(path); - } - catch - { - path = PathHelper.Combine(System.Environment.CurrentDirectory, path); - - try - { - _ = Path.GetFullPath(path); - } - catch - { - return false; - } - } - - return Directory.Exists(path); - } - - public static bool IsSwitchArgument(this string? value) => value != null - && (value.StartsWith("-") || value.StartsWith("/")) - && !Regex.Match(value, @"/\w+:").Success; //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names. - - public static bool IsSwitch(this string? value, string switchName) - { - if (value == null) - return false; - - if (value.StartsWith("-")) - { - value = value.Substring(1); - } - - if (value.StartsWith("/")) - { - value = value.Substring(1); - } - - return string.Equals(switchName, value, StringComparison.OrdinalIgnoreCase); - } - - public static bool IsInit(this string singleArgument) => singleArgument.Equals("init", StringComparison.OrdinalIgnoreCase); - - public static bool IsHelp(this string singleArgument) => (singleArgument == "?") || singleArgument.IsSwitch("h") || singleArgument.IsSwitch("help") || singleArgument.IsSwitch("?"); - - public static bool ArgumentRequiresValue(this string argument, int argumentIndex) - { - var booleanArguments = new[] - { - "init", - "updateassemblyinfo", - "ensureassemblyinfo", - "nofetch", - "nonormalize", - "nocache" - }; - - var argumentMightRequireValue = !booleanArguments.Contains(argument.Substring(1), StringComparer.OrdinalIgnoreCase); - - // If this is the first argument that might be a target path, the argument starts with slash and we're on an OS that supports paths with slashes, the argument does not require a value. - if (argumentMightRequireValue && argumentIndex == 0 && argument.StartsWith("/") && Path.DirectorySeparatorChar == '/' && argument.IsValidPath()) - return false; - - return argumentMightRequireValue; - } - public static void AppendLineFormat(this StringBuilder stringBuilder, string format, params object[] args) { stringBuilder.AppendFormat(format, args); stringBuilder.AppendLine(); } - public static string RegexReplace(this string input, string pattern, string replace, RegexOptions options = RegexOptions.None) => Regex.Replace(input, pattern, replace, options); + public static string RegexReplace(this string input, string pattern, string replace) + { + var regex = RegexPatterns.Cache.GetOrAdd(pattern); + return regex.Replace(input, replace); + } public static bool IsEquivalentTo(this string self, string? other) => string.Equals(self, other, StringComparison.OrdinalIgnoreCase); @@ -104,4 +28,32 @@ public static bool IsEquivalentTo(this string self, string? other) => public static bool IsNullOrWhiteSpace([NotNullWhen(false)] this string? value) => string.IsNullOrWhiteSpace(value); public static bool IsEmpty([NotNullWhen(false)] this string? value) => string.Empty.Equals(value); + + public static string WithPrefixIfNotNullOrEmpty(this string value, string prefix) + => string.IsNullOrEmpty(value) ? value : prefix + value; + + internal static string ToPascalCase(this TextInfo textInfo, string input) + { + if (string.IsNullOrEmpty(input)) + { + return input; + } + + var sb = new StringBuilder(input.Length); + var capitalizeNext = true; + + foreach (var c in input) + { + if (!char.IsLetterOrDigit(c)) + { + capitalizeNext = true; + continue; + } + + sb.Append(capitalizeNext ? textInfo.ToUpper(c) : textInfo.ToLower(c)); + capitalizeNext = false; + } + + return sb.ToString(); + } } diff --git a/src/GitVersion.Core/Extensions/VersionFieldExtensions.cs b/src/GitVersion.Core/Extensions/VersionFieldExtensions.cs new file mode 100644 index 0000000000..2f00e143b7 --- /dev/null +++ b/src/GitVersion.Core/Extensions/VersionFieldExtensions.cs @@ -0,0 +1,14 @@ +namespace GitVersion.Extensions; + +internal static class VersionFieldExtensions +{ + public static VersionField Consolidate(this VersionField source, VersionField? item, params VersionField?[] items) + { + var result = source; + foreach (var increment in new[] { item }.Concat(items)) + { + if (result < increment) result = increment.Value; + } + return result; + } +} diff --git a/src/GitVersion.Core/Formatting/DateFormatter.cs b/src/GitVersion.Core/Formatting/DateFormatter.cs new file mode 100644 index 0000000000..c401d9a2fa --- /dev/null +++ b/src/GitVersion.Core/Formatting/DateFormatter.cs @@ -0,0 +1,27 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal class DateFormatter : InvariantFormatter, IValueFormatter +{ + public int Priority => 2; + + public override bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result) + { + result = string.Empty; + + if (value is DateTime dt) + { + result = dt.ToString(format, cultureInfo); + return true; + } + + if (value is string dateStr && DateTime.TryParse(dateStr, cultureInfo, out var parsedDate)) + { + result = parsedDate.ToString(format, cultureInfo); + return true; + } + + return false; + } +} diff --git a/src/GitVersion.Core/Formatting/ExpressionCompiler.cs b/src/GitVersion.Core/Formatting/ExpressionCompiler.cs new file mode 100644 index 0000000000..3425cca04f --- /dev/null +++ b/src/GitVersion.Core/Formatting/ExpressionCompiler.cs @@ -0,0 +1,20 @@ +using System.Linq.Expressions; + +namespace GitVersion.Formatting; + +internal class ExpressionCompiler : IExpressionCompiler +{ + public Func CompileGetter(Type type, MemberInfo[] memberPath) + { + var param = Expression.Parameter(typeof(object)); + Expression body = Expression.Convert(param, type); + + foreach (var member in memberPath) + { + body = Expression.PropertyOrField(body, member.Name); + } + + body = Expression.Convert(body, typeof(object)); + return Expression.Lambda>(body, param).Compile(); + } +} diff --git a/src/GitVersion.Core/Formatting/FormattableFormatter.cs b/src/GitVersion.Core/Formatting/FormattableFormatter.cs new file mode 100644 index 0000000000..2ec2089ac3 --- /dev/null +++ b/src/GitVersion.Core/Formatting/FormattableFormatter.cs @@ -0,0 +1,32 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal class FormattableFormatter : InvariantFormatter, IValueFormatter +{ + public int Priority => 2; + + public override bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result) + { + result = string.Empty; + + if (string.IsNullOrWhiteSpace(format)) + return false; + + if (value is IFormattable formattable) + { + try + { + result = formattable.ToString(format, cultureInfo); + return true; + } + catch (FormatException) + { + result = $"Format '{format}' is not supported in {nameof(FormattableFormatter)}"; + return false; + } + } + + return false; + } +} diff --git a/src/GitVersion.Core/Formatting/IExpressionCompiler.cs b/src/GitVersion.Core/Formatting/IExpressionCompiler.cs new file mode 100644 index 0000000000..82be9811e9 --- /dev/null +++ b/src/GitVersion.Core/Formatting/IExpressionCompiler.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Formatting +{ + internal interface IExpressionCompiler + { + Func CompileGetter(Type type, MemberInfo[] memberPath); + } +} diff --git a/src/GitVersion.Core/Formatting/IInputSanitizer.cs b/src/GitVersion.Core/Formatting/IInputSanitizer.cs new file mode 100644 index 0000000000..ead3dcedcc --- /dev/null +++ b/src/GitVersion.Core/Formatting/IInputSanitizer.cs @@ -0,0 +1,11 @@ +namespace GitVersion.Formatting +{ + internal interface IInputSanitizer + { + string SanitizeEnvVarName(string name); + + string SanitizeFormat(string format); + + string SanitizeMemberName(string memberName); + } +} diff --git a/src/GitVersion.Core/Formatting/IMemberResolver.cs b/src/GitVersion.Core/Formatting/IMemberResolver.cs new file mode 100644 index 0000000000..67ee347c83 --- /dev/null +++ b/src/GitVersion.Core/Formatting/IMemberResolver.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Formatting; + +internal interface IMemberResolver +{ + MemberInfo[] ResolveMemberPath(Type type, string memberExpression); +} diff --git a/src/GitVersion.Core/Formatting/IValueFormatter.cs b/src/GitVersion.Core/Formatting/IValueFormatter.cs new file mode 100644 index 0000000000..45b93f77a7 --- /dev/null +++ b/src/GitVersion.Core/Formatting/IValueFormatter.cs @@ -0,0 +1,15 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal interface IValueFormatter +{ + bool TryFormat(object? value, string format, out string result); + + bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result); + + /// + /// Lower number = higher priority + /// + int Priority { get; } +} diff --git a/src/GitVersion.Core/Formatting/IValueFormatterCombiner.cs b/src/GitVersion.Core/Formatting/IValueFormatterCombiner.cs new file mode 100644 index 0000000000..b3a9c32921 --- /dev/null +++ b/src/GitVersion.Core/Formatting/IValueFormatterCombiner.cs @@ -0,0 +1,8 @@ +namespace GitVersion.Formatting; + +internal interface IValueFormatterCombiner : IValueFormatter +{ + void RegisterFormatter(IValueFormatter formatter); + + void RemoveFormatter() where T : IValueFormatter; +} diff --git a/src/GitVersion.Core/Formatting/InputSanitizer.cs b/src/GitVersion.Core/Formatting/InputSanitizer.cs new file mode 100644 index 0000000000..a676ec5540 --- /dev/null +++ b/src/GitVersion.Core/Formatting/InputSanitizer.cs @@ -0,0 +1,48 @@ +using GitVersion.Core; + +namespace GitVersion.Formatting; + +internal class InputSanitizer : IInputSanitizer +{ + public string SanitizeFormat(string format) + { + if (string.IsNullOrWhiteSpace(format)) + throw new FormatException("Format string cannot be empty."); + + if (format.Length > 50) + throw new FormatException($"Format string too long: '{format[..20]}...'"); + + if (format.Any(c => char.IsControl(c) && c != '\t')) + throw new FormatException("Format string contains invalid control characters"); + + return format; + } + + public string SanitizeEnvVarName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + throw new ArgumentException("Environment variable name cannot be null or empty."); + + if (name.Length > 200) + throw new ArgumentException($"Environment variable name too long: '{name[..20]}...'"); + + if (!RegexPatterns.Cache.GetOrAdd(RegexPatterns.Common.SanitizeEnvVarNameRegexPattern).IsMatch(name)) + throw new ArgumentException($"Environment variable name contains disallowed characters: '{name}'"); + + return name; + } + + public string SanitizeMemberName(string memberName) + { + if (string.IsNullOrWhiteSpace(memberName)) + throw new ArgumentException("Member name cannot be empty."); + + if (memberName.Length > 100) + throw new ArgumentException($"Member name too long: '{memberName[..20]}...'"); + + if (!RegexPatterns.Cache.GetOrAdd(RegexPatterns.Common.SanitizeMemberNameRegexPattern).IsMatch(memberName)) + throw new ArgumentException($"Member name contains disallowed characters: '{memberName}'"); + + return memberName; + } +} diff --git a/src/GitVersion.Core/Formatting/InvariantFormatter.cs b/src/GitVersion.Core/Formatting/InvariantFormatter.cs new file mode 100644 index 0000000000..2d953d55ed --- /dev/null +++ b/src/GitVersion.Core/Formatting/InvariantFormatter.cs @@ -0,0 +1,11 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal abstract class InvariantFormatter +{ + public bool TryFormat(object? value, string format, out string result) + => TryFormat(value, format, CultureInfo.InvariantCulture, out result); + + public abstract bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result); +} diff --git a/src/GitVersion.Core/Formatting/MemberResolver.cs b/src/GitVersion.Core/Formatting/MemberResolver.cs new file mode 100644 index 0000000000..f1fde1bc55 --- /dev/null +++ b/src/GitVersion.Core/Formatting/MemberResolver.cs @@ -0,0 +1,70 @@ +namespace GitVersion.Formatting; + +internal class MemberResolver : IMemberResolver +{ + public MemberInfo[] ResolveMemberPath(Type type, string memberExpression) + { + var memberNames = memberExpression.Split('.'); + var path = new List(); + var currentType = type; + + foreach (var memberName in memberNames) + { + var member = FindDirectMember(currentType, memberName); + if (member == null) + { + var recursivePath = FindMemberRecursive(type, memberName, []); + return recursivePath == null + ? throw new ArgumentException($"'{memberName}' is not a property or field on type '{type.Name}'") + : [.. recursivePath]; + } + + path.Add(member); + currentType = GetMemberType(member); + } + + return [.. path]; + } + + public static List? FindMemberRecursive(Type type, string memberName, HashSet visited) + { + if (!visited.Add(type)) + return null; + + var member = FindDirectMember(type, memberName); + if (member != null) + return [member]; + + foreach (var prop in type.GetProperties()) + { + var nestedPath = FindMemberRecursive(prop.PropertyType, memberName, visited); + if (nestedPath != null) + { + nestedPath.Insert(0, prop); + return nestedPath; + } + } + + foreach (var field in type.GetFields()) + { + var nestedPath = FindMemberRecursive(field.FieldType, memberName, visited); + if (nestedPath != null) + { + nestedPath.Insert(0, field); + return nestedPath; + } + } + + return null; + } + + private static MemberInfo? FindDirectMember(Type type, string memberName) + => type.GetProperty(memberName) ?? (MemberInfo?)type.GetField(memberName); + + private static Type GetMemberType(MemberInfo member) => member switch + { + PropertyInfo p => p.PropertyType, + FieldInfo f => f.FieldType, + _ => throw new ArgumentException($"Unsupported member type: {member.GetType()}") + }; +} diff --git a/src/GitVersion.Core/Formatting/NumericFormatter.cs b/src/GitVersion.Core/Formatting/NumericFormatter.cs new file mode 100644 index 0000000000..14b1f791a3 --- /dev/null +++ b/src/GitVersion.Core/Formatting/NumericFormatter.cs @@ -0,0 +1,46 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal class NumericFormatter : InvariantFormatter, IValueFormatter +{ + public int Priority => 1; + + public override bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result) + { + result = string.Empty; + + if (value is not string s) + return false; + + // Integer formatting + if (format.All(char.IsDigit) && int.TryParse(s, NumberStyles.Integer, cultureInfo, out var i)) + { + result = i.ToString(format, cultureInfo); + return true; + } + + // Hexadecimal formatting + if (format.StartsWith("X", StringComparison.OrdinalIgnoreCase) && int.TryParse(s, NumberStyles.Integer, cultureInfo, out var hex)) + { + result = hex.ToString(format, cultureInfo); + return true; + } + + // Floating point formatting + if ("FEGNCP".Contains(char.ToUpperInvariant(format[0])) && double.TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, cultureInfo, out var d)) + { + result = d.ToString(format, cultureInfo); + return true; + } + + // Decimal formatting + if (decimal.TryParse(s, NumberStyles.Any, cultureInfo, out var dec)) + { + result = dec.ToString(format, cultureInfo); + return true; + } + + return false; + } +} diff --git a/src/GitVersion.Core/Formatting/StringFormatWithExtension.cs b/src/GitVersion.Core/Formatting/StringFormatWithExtension.cs new file mode 100644 index 0000000000..0f061c4f0b --- /dev/null +++ b/src/GitVersion.Core/Formatting/StringFormatWithExtension.cs @@ -0,0 +1,100 @@ +using System.Text.RegularExpressions; +using GitVersion.Core; + +namespace GitVersion.Formatting; + +internal static class StringFormatWithExtension +{ + private static readonly IExpressionCompiler ExpressionCompiler = new ExpressionCompiler(); + + private static readonly IInputSanitizer InputSanitizer = new InputSanitizer(); + + private static readonly IMemberResolver MemberResolver = new MemberResolver(); + + /// + /// Formats the , replacing each expression wrapped in curly braces + /// with the corresponding property from the or . + /// + /// The source template, which may contain expressions to be replaced, e.g '{Foo.Bar.CurrencySymbol} foo {Foo.Bar.Price}' + /// The source object to apply to the + /// + /// The is null. + /// An environment variable was null and no fallback was provided. + /// + /// An expression containing "." is treated as a property or field access on the . + /// An expression starting with "env:" is replaced with the value of the corresponding variable from the . + /// Each expression may specify a single hardcoded fallback value using the {Prop ?? "fallback"} syntax, which applies if the expression evaluates to null. + /// + /// + /// // replace an expression with a property value + /// "Hello {Name}".FormatWith(new { Name = "Fred" }, env); + /// "Hello {Name ?? \"Fred\"}".FormatWith(new { Name = GetNameOrNull() }, env); + /// // replace an expression with an environment variable + /// "{env:BUILD_NUMBER}".FormatWith(new { }, env); + /// "{env:BUILD_NUMBER ?? \"0\"}".FormatWith(new { }, env); + /// + public static string FormatWith(this string template, T? source, IEnvironment environment) + { + ArgumentNullException.ThrowIfNull(template); + ArgumentNullException.ThrowIfNull(source); + + var result = new StringBuilder(); + var lastIndex = 0; + + foreach (var match in RegexPatterns.Common.ExpandTokensRegex().Matches(template).Cast()) + { + var replacement = EvaluateMatch(match, source, environment); + result.Append(template, lastIndex, match.Index - lastIndex); + result.Append(replacement); + lastIndex = match.Index + match.Length; + } + + result.Append(template, lastIndex, template.Length - lastIndex); + return result.ToString(); + } + + private static string EvaluateMatch(Match match, T source, IEnvironment environment) + { + var fallback = match.Groups["fallback"].Success ? match.Groups["fallback"].Value : null; + + if (match.Groups["envvar"].Success) + return EvaluateEnvVar(match.Groups["envvar"].Value, fallback, environment); + + if (match.Groups["member"].Success) + { + var format = match.Groups["format"].Success ? match.Groups["format"].Value : null; + return EvaluateMember(source, match.Groups["member"].Value, format, fallback); + } + + throw new ArgumentException($"Invalid token format: '{match.Value}'"); + } + + private static string EvaluateEnvVar(string name, string? fallback, IEnvironment env) + { + var safeName = InputSanitizer.SanitizeEnvVarName(name); + return env.GetEnvironmentVariable(safeName) + ?? fallback + ?? throw new ArgumentException($"Environment variable {safeName} not found and no fallback provided"); + } + + private static string EvaluateMember(T source, string member, string? format, string? fallback) + { + var safeMember = InputSanitizer.SanitizeMemberName(member); + var memberPath = MemberResolver.ResolveMemberPath(source!.GetType(), safeMember); + var getter = ExpressionCompiler.CompileGetter(source.GetType(), memberPath); + var value = getter(source); + + if (value is null) + return fallback ?? string.Empty; + + if (format is not null && ValueFormatter.Default.TryFormat( + value, + InputSanitizer.SanitizeFormat(format), + out var formatted)) + { + return formatted; + } + + return value.ToString() ?? fallback ?? string.Empty; + } +} diff --git a/src/GitVersion.Core/Formatting/StringFormatter.cs b/src/GitVersion.Core/Formatting/StringFormatter.cs new file mode 100644 index 0000000000..e2877ef573 --- /dev/null +++ b/src/GitVersion.Core/Formatting/StringFormatter.cs @@ -0,0 +1,48 @@ +using System.Globalization; +using GitVersion.Extensions; + +namespace GitVersion.Formatting; + +internal class StringFormatter : InvariantFormatter, IValueFormatter +{ + public int Priority => 2; + + public override bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result) + { + if (value is not string stringValue) + { + result = string.Empty; + return false; + } + + if (string.IsNullOrWhiteSpace(stringValue)) + { + result = string.Empty; + return true; + } + + switch (format) + { + case "u": + result = cultureInfo.TextInfo.ToUpper(stringValue); + return true; + case "l": + result = cultureInfo.TextInfo.ToLower(stringValue); + return true; + case "t": + result = cultureInfo.TextInfo.ToTitleCase(cultureInfo.TextInfo.ToLower(stringValue)); + return true; + case "s": + result = stringValue.Length == 1 + ? cultureInfo.TextInfo.ToUpper(stringValue) + : cultureInfo.TextInfo.ToUpper(stringValue[0]) + cultureInfo.TextInfo.ToLower(stringValue[1..]); + return true; + case "c": + result = cultureInfo.TextInfo.ToPascalCase(stringValue); + return true; + default: + result = string.Empty; + return false; + } + } +} diff --git a/src/GitVersion.Core/Formatting/ValueFormatter.cs b/src/GitVersion.Core/Formatting/ValueFormatter.cs new file mode 100644 index 0000000000..0e0be49645 --- /dev/null +++ b/src/GitVersion.Core/Formatting/ValueFormatter.cs @@ -0,0 +1,42 @@ +using System.Globalization; + +namespace GitVersion.Formatting; + +internal class ValueFormatter : InvariantFormatter, IValueFormatterCombiner +{ + private readonly List formatters; + + internal static IValueFormatter Default { get; } = new ValueFormatter(); + + public int Priority => 0; + + internal ValueFormatter() + => formatters = + [ + new StringFormatter(), + new FormattableFormatter(), + new NumericFormatter(), + new DateFormatter() + ]; + + public override bool TryFormat(object? value, string format, CultureInfo cultureInfo, out string result) + { + result = string.Empty; + if (value is null) + { + return false; + } + + foreach (var formatter in formatters.OrderBy(f => f.Priority)) + { + if (formatter.TryFormat(value, format, out result)) + return true; + } + + return false; + } + + void IValueFormatterCombiner.RegisterFormatter(IValueFormatter formatter) => formatters.Add(formatter); + + void IValueFormatterCombiner.RemoveFormatter() => formatters.RemoveAll(f => f is T); +} diff --git a/src/GitVersion.Core/Model/AuthenticationInfo.cs b/src/GitVersion.Core/Git/AuthenticationInfo.cs similarity index 68% rename from src/GitVersion.Core/Model/AuthenticationInfo.cs rename to src/GitVersion.Core/Git/AuthenticationInfo.cs index 46cca8efd5..24d6798735 100644 --- a/src/GitVersion.Core/Model/AuthenticationInfo.cs +++ b/src/GitVersion.Core/Git/AuthenticationInfo.cs @@ -1,6 +1,6 @@ -namespace GitVersion; +namespace GitVersion.Git; -public class AuthenticationInfo +public record AuthenticationInfo { public string? Username { get; set; } public string? Password { get; set; } diff --git a/src/GitVersion.Core/Model/BranchCommit.cs b/src/GitVersion.Core/Git/BranchCommit.cs similarity index 64% rename from src/GitVersion.Core/Model/BranchCommit.cs rename to src/GitVersion.Core/Git/BranchCommit.cs index 84e533a122..ccc926033a 100644 --- a/src/GitVersion.Core/Model/BranchCommit.cs +++ b/src/GitVersion.Core/Git/BranchCommit.cs @@ -1,22 +1,17 @@ using GitVersion.Extensions; -namespace GitVersion; +namespace GitVersion.Git; /// /// A commit, together with the branch to which the commit belongs. /// -public readonly struct BranchCommit : IEquatable +[DebuggerDisplay("{Branch} {Commit}")] +public readonly struct BranchCommit(ICommit commit, IBranch branch) : IEquatable { public static readonly BranchCommit Empty = new(); - public BranchCommit(ICommit commit, IBranch branch) : this() - { - Branch = branch.NotNull(); - Commit = commit.NotNull(); - } - - public IBranch Branch { get; } - public ICommit Commit { get; } + public IBranch Branch { get; } = branch.NotNull(); + public ICommit Commit { get; } = commit.NotNull(); public bool Equals(BranchCommit? other) { @@ -32,7 +27,7 @@ public override int GetHashCode() { unchecked { - return ((Branch != null ? Branch.GetHashCode() : 0) * 397) ^ (Commit != null ? Commit.GetHashCode() : 0); + return ((Branch?.GetHashCode()) ?? 0) * 397 ^ ((Commit?.GetHashCode()) ?? 0); } } diff --git a/src/GitVersion.Core/Git/CommitExtensions.cs b/src/GitVersion.Core/Git/CommitExtensions.cs new file mode 100644 index 0000000000..9b8971ac54 --- /dev/null +++ b/src/GitVersion.Core/Git/CommitExtensions.cs @@ -0,0 +1,8 @@ +using GitVersion.Extensions; + +namespace GitVersion.Git; + +public static class CommitExtensions +{ + public static bool IsMergeCommit(this ICommit source) => source.NotNull().Parents.Count >= 2; +} diff --git a/src/GitVersion.Core/Git/CommitFilter.cs b/src/GitVersion.Core/Git/CommitFilter.cs index cb1972d8f4..074f7d67d4 100644 --- a/src/GitVersion.Core/Git/CommitFilter.cs +++ b/src/GitVersion.Core/Git/CommitFilter.cs @@ -1,12 +1,11 @@ -namespace GitVersion; +namespace GitVersion.Git; -public class CommitFilter +public record CommitFilter { - - public bool FirstParentOnly { get; set; } - public object? IncludeReachableFrom { get; set; } - public object? ExcludeReachableFrom { get; set; } - public CommitSortStrategies SortBy { get; set; } + public bool FirstParentOnly { get; init; } + public object? IncludeReachableFrom { get; init; } + public object? ExcludeReachableFrom { get; init; } + public CommitSortStrategies SortBy { get; init; } } [Flags] diff --git a/src/GitVersion.Core/Git/IBranch.cs b/src/GitVersion.Core/Git/IBranch.cs index cb7f0f2f87..4c78171180 100644 --- a/src/GitVersion.Core/Git/IBranch.cs +++ b/src/GitVersion.Core/Git/IBranch.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IBranch : IEquatable, IComparable, INamedReference { @@ -6,5 +6,5 @@ public interface IBranch : IEquatable, IComparable, INamedRef bool IsRemote { get; } bool IsTracking { get; } bool IsDetachedHead { get; } - ICommitCollection? Commits { get; } + ICommitCollection Commits { get; } } diff --git a/src/GitVersion.Core/Git/IBranchCollection.cs b/src/GitVersion.Core/Git/IBranchCollection.cs index ffb86439ad..5943bdf7d8 100644 --- a/src/GitVersion.Core/Git/IBranchCollection.cs +++ b/src/GitVersion.Core/Git/IBranchCollection.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IBranchCollection : IEnumerable { diff --git a/src/GitVersion.Core/Git/ICommit.cs b/src/GitVersion.Core/Git/ICommit.cs index d9f27390fe..7c6900c1bb 100644 --- a/src/GitVersion.Core/Git/ICommit.cs +++ b/src/GitVersion.Core/Git/ICommit.cs @@ -1,8 +1,16 @@ -namespace GitVersion; +namespace GitVersion.Git; -public interface ICommit : IEquatable, IComparable, IGitObject +public interface ICommit : IEquatable, IComparable { - IEnumerable Parents { get; } + IReadOnlyList Parents { get; } + + IObjectId Id { get; } + + string Sha { get; } + DateTimeOffset When { get; } + string Message { get; } + + IReadOnlyList DiffPaths { get; } } diff --git a/src/GitVersion.Core/Git/ICommitCollection.cs b/src/GitVersion.Core/Git/ICommitCollection.cs index 10d9723156..8bf6267f37 100644 --- a/src/GitVersion.Core/Git/ICommitCollection.cs +++ b/src/GitVersion.Core/Git/ICommitCollection.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface ICommitCollection : IEnumerable { diff --git a/src/GitVersion.Core/Git/IGitObject.cs b/src/GitVersion.Core/Git/IGitObject.cs deleted file mode 100644 index d125066ad7..0000000000 --- a/src/GitVersion.Core/Git/IGitObject.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace GitVersion; - -public interface IGitObject : IEquatable, IComparable -{ - IObjectId Id { get; } - string Sha { get; } -} diff --git a/src/GitVersion.Core/Git/IGitRepository.cs b/src/GitVersion.Core/Git/IGitRepository.cs index 5b2a1aa8fd..7653744b77 100644 --- a/src/GitVersion.Core/Git/IGitRepository.cs +++ b/src/GitVersion.Core/Git/IGitRepository.cs @@ -1,17 +1,21 @@ -namespace GitVersion; +namespace GitVersion.Git; -public interface IGitRepository +public interface IGitRepository : IDisposable { string Path { get; } string WorkingDirectory { get; } bool IsHeadDetached { get; } + bool IsShallow { get; } + IBranch Head { get; } + ITagCollection Tags { get; } - IReferenceCollection Refs { get; } + IReferenceCollection References { get; } IBranchCollection Branches { get; } ICommitCollection Commits { get; } IRemoteCollection Remotes { get; } ICommit? FindMergeBase(ICommit commit, ICommit otherCommit); - int GetNumberOfUncommittedChanges(); + int UncommittedChangesCount(); + void DiscoverRepository(string? gitDirectory); } diff --git a/src/GitVersion.Core/Git/IGitRepositoryInfo.cs b/src/GitVersion.Core/Git/IGitRepositoryInfo.cs index 4e39080ee1..4aff8edd97 100644 --- a/src/GitVersion.Core/Git/IGitRepositoryInfo.cs +++ b/src/GitVersion.Core/Git/IGitRepositoryInfo.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IGitRepositoryInfo { diff --git a/src/GitVersion.Core/Git/IMutatingGitRepository.cs b/src/GitVersion.Core/Git/IMutatingGitRepository.cs index 3924c4326e..b7dc7bf811 100644 --- a/src/GitVersion.Core/Git/IMutatingGitRepository.cs +++ b/src/GitVersion.Core/Git/IMutatingGitRepository.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IMutatingGitRepository : IGitRepository { diff --git a/src/GitVersion.Core/Git/INamedReference.cs b/src/GitVersion.Core/Git/INamedReference.cs index a138984514..2c41175783 100644 --- a/src/GitVersion.Core/Git/INamedReference.cs +++ b/src/GitVersion.Core/Git/INamedReference.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface INamedReference { diff --git a/src/GitVersion.Core/Git/IObjectId.cs b/src/GitVersion.Core/Git/IObjectId.cs index 1140e04f1f..b303cc953d 100644 --- a/src/GitVersion.Core/Git/IObjectId.cs +++ b/src/GitVersion.Core/Git/IObjectId.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IObjectId : IEquatable, IComparable { diff --git a/src/GitVersion.Core/Git/IRefSpec.cs b/src/GitVersion.Core/Git/IRefSpec.cs index d21969e32a..777641c1b4 100644 --- a/src/GitVersion.Core/Git/IRefSpec.cs +++ b/src/GitVersion.Core/Git/IRefSpec.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IRefSpec : IEquatable, IComparable { diff --git a/src/GitVersion.Core/Git/IRefSpecCollection.cs b/src/GitVersion.Core/Git/IRefSpecCollection.cs index 3ff492c0a3..d007874d8c 100644 --- a/src/GitVersion.Core/Git/IRefSpecCollection.cs +++ b/src/GitVersion.Core/Git/IRefSpecCollection.cs @@ -1,5 +1,3 @@ -namespace GitVersion; +namespace GitVersion.Git; -public interface IRefSpecCollection : IEnumerable -{ -} +public interface IRefSpecCollection : IEnumerable; diff --git a/src/GitVersion.Core/Git/IReference.cs b/src/GitVersion.Core/Git/IReference.cs index 7cb6132d1d..6b560af39b 100644 --- a/src/GitVersion.Core/Git/IReference.cs +++ b/src/GitVersion.Core/Git/IReference.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IReference : IEquatable, IComparable, INamedReference { diff --git a/src/GitVersion.Core/Git/IReferenceCollection.cs b/src/GitVersion.Core/Git/IReferenceCollection.cs index e3aafe1d50..6b4f639386 100644 --- a/src/GitVersion.Core/Git/IReferenceCollection.cs +++ b/src/GitVersion.Core/Git/IReferenceCollection.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IReferenceCollection : IEnumerable { diff --git a/src/GitVersion.Core/Git/IRemote.cs b/src/GitVersion.Core/Git/IRemote.cs index 896b3edfda..43faeac942 100644 --- a/src/GitVersion.Core/Git/IRemote.cs +++ b/src/GitVersion.Core/Git/IRemote.cs @@ -1,11 +1,10 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IRemote : IEquatable, IComparable { string Name { get; } string Url { get; } - IEnumerable RefSpecs { get; } IEnumerable FetchRefSpecs { get; } IEnumerable PushRefSpecs { get; } } diff --git a/src/GitVersion.Core/Git/IRemoteCollection.cs b/src/GitVersion.Core/Git/IRemoteCollection.cs index 614177ac81..531eee8546 100644 --- a/src/GitVersion.Core/Git/IRemoteCollection.cs +++ b/src/GitVersion.Core/Git/IRemoteCollection.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface IRemoteCollection : IEnumerable { diff --git a/src/GitVersion.Core/Git/ITag.cs b/src/GitVersion.Core/Git/ITag.cs index adf08a549f..c37dec97f4 100644 --- a/src/GitVersion.Core/Git/ITag.cs +++ b/src/GitVersion.Core/Git/ITag.cs @@ -1,7 +1,8 @@ -namespace GitVersion; +namespace GitVersion.Git; public interface ITag : IEquatable, IComparable, INamedReference { - string? TargetSha { get; } - ICommit? PeeledTargetCommit(); + string TargetSha { get; } + + ICommit Commit { get; } } diff --git a/src/GitVersion.Core/Git/ITagCollection.cs b/src/GitVersion.Core/Git/ITagCollection.cs index c5e189c6b5..3065430e39 100644 --- a/src/GitVersion.Core/Git/ITagCollection.cs +++ b/src/GitVersion.Core/Git/ITagCollection.cs @@ -1,5 +1,3 @@ -namespace GitVersion; +namespace GitVersion.Git; -public interface ITagCollection : IEnumerable -{ -} +public interface ITagCollection : IEnumerable; diff --git a/src/GitVersion.Core/Git/ITreeChanges.cs b/src/GitVersion.Core/Git/ITreeChanges.cs new file mode 100644 index 0000000000..28a4600d68 --- /dev/null +++ b/src/GitVersion.Core/Git/ITreeChanges.cs @@ -0,0 +1,6 @@ +namespace GitVersion.Git; + +public interface ITreeChanges +{ + IReadOnlyList Paths { get; } +} diff --git a/src/GitVersion.Core/Git/RefSpecDirection.cs b/src/GitVersion.Core/Git/RefSpecDirection.cs index 9cca4404f6..97070104f8 100644 --- a/src/GitVersion.Core/Git/RefSpecDirection.cs +++ b/src/GitVersion.Core/Git/RefSpecDirection.cs @@ -1,4 +1,4 @@ -namespace GitVersion; +namespace GitVersion.Git; public enum RefSpecDirection { diff --git a/src/GitVersion.Core/Git/ReferenceName.cs b/src/GitVersion.Core/Git/ReferenceName.cs index 6787705285..9686a0a22a 100644 --- a/src/GitVersion.Core/Git/ReferenceName.cs +++ b/src/GitVersion.Core/Git/ReferenceName.cs @@ -1,96 +1,125 @@ +using System.Diagnostics.CodeAnalysis; using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; public class ReferenceName : IEquatable, IComparable { private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Canonical); private static readonly LambdaKeyComparer comparerHelper = new(x => x.Canonical); - private const string LocalBranchPrefix = "refs/heads/"; - private const string RemoteTrackingBranchPrefix = "refs/remotes/"; + public const string LocalBranchPrefix = "refs/heads/"; + public const string RemoteTrackingBranchPrefix = "refs/remotes/"; private const string TagPrefix = "refs/tags/"; + private const string OriginPrefix = "origin/"; + private static readonly string[] PullRequestPrefixes = - { + [ "refs/pull/", "refs/pull-requests/", "refs/remotes/pull/", "refs/remotes/pull-requests/" - }; + ]; public ReferenceName(string canonical) { Canonical = canonical.NotNull(); - IsBranch = IsPrefixedBy(Canonical, LocalBranchPrefix); + IsLocalBranch = IsPrefixedBy(Canonical, LocalBranchPrefix); IsRemoteBranch = IsPrefixedBy(Canonical, RemoteTrackingBranchPrefix); IsTag = IsPrefixedBy(Canonical, TagPrefix); IsPullRequest = IsPrefixedBy(Canonical, PullRequestPrefixes); Friendly = Shorten(); - WithoutRemote = RemoveRemote(); + WithoutOrigin = RemoveOrigin(); } public static ReferenceName Parse(string canonicalName) { - if (IsPrefixedBy(canonicalName, LocalBranchPrefix) - || IsPrefixedBy(canonicalName, RemoteTrackingBranchPrefix) - || IsPrefixedBy(canonicalName, TagPrefix) - || IsPrefixedBy(canonicalName, PullRequestPrefixes)) - { - return new ReferenceName(canonicalName); - } - + if (TryParse(out var value, canonicalName)) return value; throw new ArgumentException($"The {nameof(canonicalName)} is not a Canonical name"); } - public static ReferenceName FromBranchName(string branchName) => Parse(LocalBranchPrefix + branchName); + public static ReferenceName FromBranchName(string branchName) + => TryParse(out var value, branchName) + ? value + : Parse(LocalBranchPrefix + branchName); public string Canonical { get; } + public string Friendly { get; } - public string WithoutRemote { get; } - public bool IsBranch { get; } + + public string WithoutOrigin { get; } + + public bool IsLocalBranch { get; } + public bool IsRemoteBranch { get; } + public bool IsTag { get; } + public bool IsPullRequest { get; } public bool Equals(ReferenceName? other) => equalityHelper.Equals(this, other); - public int CompareTo(ReferenceName other) => comparerHelper.Compare(this, other); - public override bool Equals(object obj) => Equals((obj as ReferenceName)); + + public int CompareTo(ReferenceName? other) => comparerHelper.Compare(this, other); + + public override bool Equals(object? obj) => Equals(obj as ReferenceName); + public override int GetHashCode() => equalityHelper.GetHashCode(this); + public override string ToString() => Friendly; + public static bool operator ==(ReferenceName? left, ReferenceName? right) + { + if (ReferenceEquals(left, right)) return true; + if (left is null || right is null) return false; + return left.Equals(right); + } + + public static bool operator !=(ReferenceName? left, ReferenceName? right) => !(left == right); + public bool EquivalentTo(string? name) => Canonical.Equals(name, StringComparison.OrdinalIgnoreCase) || Friendly.Equals(name, StringComparison.OrdinalIgnoreCase) - || WithoutRemote.Equals(name, StringComparison.OrdinalIgnoreCase); + || WithoutOrigin.Equals(name, StringComparison.OrdinalIgnoreCase); private string Shorten() { - if (IsBranch) - return Canonical.Substring(LocalBranchPrefix.Length); + if (IsLocalBranch) + return Canonical[LocalBranchPrefix.Length..]; if (IsRemoteBranch) - return Canonical.Substring(RemoteTrackingBranchPrefix.Length); + return Canonical[RemoteTrackingBranchPrefix.Length..]; - if (IsTag) - return Canonical.Substring(TagPrefix.Length); - - return Canonical; + return IsTag ? Canonical[TagPrefix.Length..] : Canonical; } - private string RemoveRemote() + private string RemoveOrigin() { - if (IsRemoteBranch) + if (IsRemoteBranch && !IsPullRequest && Friendly.StartsWith(OriginPrefix, StringComparison.Ordinal)) { - if (!IsPullRequest) - return Friendly.Substring(Friendly.IndexOf("/", StringComparison.Ordinal) + 1); + return Friendly[OriginPrefix.Length..]; } return Friendly; } + private static bool TryParse([NotNullWhen(true)] out ReferenceName? value, string canonicalName) + { + value = null; + + if (IsPrefixedBy(canonicalName, LocalBranchPrefix) + || IsPrefixedBy(canonicalName, RemoteTrackingBranchPrefix) + || IsPrefixedBy(canonicalName, TagPrefix) + || IsPrefixedBy(canonicalName, PullRequestPrefixes)) + { + value = new(canonicalName); + } + + return value is not null; + } + private static bool IsPrefixedBy(string input, string prefix) => input.StartsWith(prefix, StringComparison.Ordinal); private static bool IsPrefixedBy(string input, string[] prefixes) => prefixes.Any(prefix => IsPrefixedBy(input, prefix)); diff --git a/src/GitVersion.Core/GitVersion.Core.csproj b/src/GitVersion.Core/GitVersion.Core.csproj index 45819f607e..0843eba8da 100644 --- a/src/GitVersion.Core/GitVersion.Core.csproj +++ b/src/GitVersion.Core/GitVersion.Core.csproj @@ -1,7 +1,6 @@ - netstandard2.0 GitVersion bin\$(Configuration)\GitVersionCore.xml @@ -13,29 +12,29 @@ - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + + + - - + + + + + + + + + + + + + + + + diff --git a/src/GitVersion.Core/GitVersion.Core.csproj.DotSettings b/src/GitVersion.Core/GitVersion.Core.csproj.DotSettings deleted file mode 100644 index 77449f83fe..0000000000 --- a/src/GitVersion.Core/GitVersion.Core.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - True \ No newline at end of file diff --git a/src/GitVersion.Core/GitVersionCommonModule.cs b/src/GitVersion.Core/GitVersionCommonModule.cs new file mode 100644 index 0000000000..767b780e52 --- /dev/null +++ b/src/GitVersion.Core/GitVersionCommonModule.cs @@ -0,0 +1,21 @@ +using System.IO.Abstractions; +using GitVersion.Agents; +using GitVersion.Logging; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion; + +public class GitVersionCommonModule : IGitVersionModule +{ + public void RegisterTypes(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(sp => sp.GetRequiredService().Resolve()); + } +} diff --git a/src/GitVersion.Core/GitVersionContext.cs b/src/GitVersion.Core/GitVersionContext.cs new file mode 100644 index 0000000000..7264abe4c5 --- /dev/null +++ b/src/GitVersion.Core/GitVersionContext.cs @@ -0,0 +1,31 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion; + +/// +/// Contextual information about where GitVersion is being run +/// +public class GitVersionContext( + IBranch currentBranch, + ICommit currentCommit, + IGitVersionConfiguration configuration, + bool isCurrentCommitTagged, + int numberOfUncommittedChanges) +{ + /// + /// Contains the raw configuration, use Configuration for specific configuration based on the current GitVersion context. + /// + public IGitVersionConfiguration Configuration { get; } = configuration.NotNull(); + + public IBranch CurrentBranch { get; } = currentBranch.NotNull(); + + public IEnumerable CurrentBranchCommits => CurrentBranch.Commits.GetCommitsPriorTo(CurrentCommit.When); + + public ICommit CurrentCommit { get; } = currentCommit.NotNull(); + + public bool IsCurrentCommitTagged { get; } = isCurrentCommitTagged; + + public int NumberOfUncommittedChanges { get; } = numberOfUncommittedChanges; +} diff --git a/src/GitVersion.Core/GitVersionCoreModule.cs b/src/GitVersion.Core/GitVersionCoreModule.cs index e7594cf1a0..f059927193 100644 --- a/src/GitVersion.Core/GitVersionCoreModule.cs +++ b/src/GitVersion.Core/GitVersionCoreModule.cs @@ -1,13 +1,9 @@ -using GitVersion.BuildAgents; using GitVersion.Common; -using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; -using GitVersion.Logging; using GitVersion.VersionCalculation; -using GitVersion.VersionCalculation.Cache; -using GitVersion.VersionConverters; +using GitVersion.VersionCalculation.Caching; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; namespace GitVersion; @@ -15,31 +11,24 @@ public class GitVersionCoreModule : IGitVersionModule { public void RegisterTypes(IServiceCollection services) { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(sp => { - var options = sp.GetRequiredService>(); var contextFactory = sp.GetRequiredService(); - return new Lazy(() => contextFactory.Create(options.Value)); + return new Lazy(() => contextFactory.Create()); }); - services.AddModule(new BuildServerModule()); - services.AddModule(new ConfigurationModule()); + services.AddModule(new GitVersionCommonModule()); services.AddModule(new VersionCalculationModule()); - services.AddModule(new VersionConvertersModule()); } } diff --git a/src/GitVersion.Core/Helpers/Disposable.cs b/src/GitVersion.Core/Helpers/Disposable.cs new file mode 100644 index 0000000000..f253bef4ef --- /dev/null +++ b/src/GitVersion.Core/Helpers/Disposable.cs @@ -0,0 +1,39 @@ +using GitVersion.Extensions; + +namespace GitVersion.Helpers; + +public static class Disposable +{ + public static IDisposable Create(Action disposer) => new AnonymousDisposable(disposer); + public static IDisposable Create(T value, Action disposer) => new AnonymousDisposable(value, disposer); + + public static readonly IDisposable Empty = Create(() => { }); + + private sealed class AnonymousDisposable(Action disposer) : IDisposable + { + public void Dispose() + { + this.disposer?.Invoke(); + this.disposer = null; + } + + private Action? disposer = disposer.NotNull(); + } + + private sealed class AnonymousDisposable(T value, Action disposer) : IDisposable + { + public void Dispose() + { + this.disposer?.Invoke(); + this.disposer = null; + } + + private Action? disposer = disposer.NotNull(); + public T Value => value; + } +} + +public interface IDisposable : IDisposable +{ + T Value { get; } +} diff --git a/src/GitVersion.Core/Helpers/EncodingHelper.cs b/src/GitVersion.Core/Helpers/EncodingHelper.cs deleted file mode 100644 index af71c1f660..0000000000 --- a/src/GitVersion.Core/Helpers/EncodingHelper.cs +++ /dev/null @@ -1,95 +0,0 @@ -namespace GitVersion.Helpers; - -public static class EncodingHelper -{ - private static IList? encodingsWithPreambles; - - private static int maxPreambleLength; - - /// - /// Detects the encoding of a file if and only if it includes a preamble . - /// - /// The file name to check the encoding of. - /// The encoding of the file if it has a preamble otherwise null. - public static Encoding? DetectEncoding(string? filename) - { - if (string.IsNullOrEmpty(filename) || !File.Exists(filename)) - { - return null; - } - - if (encodingsWithPreambles == null) - { - ScanEncodings(); - } - - using var stream = File.OpenRead(filename); - // No bytes? No encoding! - if (stream.Length == 0) - { - return null; - } - - // Read the minimum amount necessary. - var length = stream.Length > maxPreambleLength ? maxPreambleLength : stream.Length; - - var bytes = new byte[length]; - stream.Read(bytes, 0, (int)length); - return DetectEncoding(bytes); - } - - /// - /// Returns the first encoding where all the preamble bytes match exactly. - /// - /// The bytes to check for a matching preamble. - /// The encoding that has a matching preamble or null if one was not found. - public static Encoding? DetectEncoding(IList bytes) - { - if (bytes.Count == 0) - { - return null; - } - - if (encodingsWithPreambles == null) - { - ScanEncodings(); - } - - return encodingsWithPreambles?.FirstOrDefault(encoding => PreambleMatches(encoding, bytes)); - } - - /// - /// Returns an ordered list of encodings that have preambles ordered by the length of the - /// preamble longest to shortest. This prevents a short preamble masking a longer one - /// later in the list. - /// - /// An ordered list of encodings and corresponding preambles. - private static void ScanEncodings() - { - var encodings = (Encoding.GetEncodings()); - encodingsWithPreambles = (from info in encodings - let encoding = info.GetEncoding() - let preamble = encoding.GetPreamble() - where preamble.Length > 0 - orderby preamble.Length descending - select encoding).ToList(); - - var encodingWithLongestPreamble = encodingsWithPreambles.FirstOrDefault(); - maxPreambleLength = encodingWithLongestPreamble?.GetPreamble().Length ?? 0; - } - - /// - /// Verifies that all bytes of an encoding's preamble are present at the beginning of some sample data. - /// - /// The encoding to check against. - /// The data to test. - /// A boolean indicating if a preamble match was found. - private static bool PreambleMatches(Encoding encoding, IList data) - { - var preamble = encoding.GetPreamble(); - if (preamble.Length > data.Count) - return false; - - return !preamble.Where((preambleByte, index) => data[index] != preambleByte).Any(); - } -} diff --git a/src/GitVersion.Core/Helpers/FileSystemHelper.cs b/src/GitVersion.Core/Helpers/FileSystemHelper.cs new file mode 100644 index 0000000000..4b331170d0 --- /dev/null +++ b/src/GitVersion.Core/Helpers/FileSystemHelper.cs @@ -0,0 +1,153 @@ +using System.IO.Abstractions; + +namespace GitVersion.Helpers; + +internal static class FileSystemHelper +{ + private static readonly FileSystem fileSystem = new(); + + internal static class File + { + public static bool Exists(string path) => fileSystem.File.Exists(path); + public static void Delete(string path) => fileSystem.File.Delete(path); + public static string ReadAllText(string path) => fileSystem.File.ReadAllText(path); + public static void WriteAllText(string path, string? contents) => fileSystem.File.WriteAllText(path, contents); + } + + internal static class Directory + { + public static bool Exists(string directoryPath) => fileSystem.Directory.Exists(directoryPath); + + public static void DeleteDirectory(string directoryPath) + { + // From http://stackoverflow.com/questions/329355/cannot-delete-directory-with-directory-deletepath-true/329502#329502 + + if (!fileSystem.Directory.Exists(directoryPath)) + { + Trace.WriteLine($"Directory '{directoryPath}' is missing and can't be removed."); + + return; + } + + var files = fileSystem.Directory.GetFiles(directoryPath); + var dirs = fileSystem.Directory.GetDirectories(directoryPath); + + foreach (var file in files) + { + fileSystem.File.SetAttributes(file, FileAttributes.Normal); + fileSystem.File.Delete(file); + } + + foreach (var dir in dirs) + { + DeleteDirectory(dir); + } + + fileSystem.File.SetAttributes(directoryPath, FileAttributes.Normal); + try + { + fileSystem.Directory.Delete(directoryPath, false); + } + catch (IOException) + { + Trace.WriteLine(string.Format("{0}The directory '{1}' could not be deleted!" + + "{0}Most of the time, this is due to an external process accessing the files in the temporary repositories created during the test runs, and keeping a handle on the directory, thus preventing the deletion of those files." + + "{0}Known and common causes include:" + + "{0}- Windows Search Indexer (go to the Indexing Options, in the Windows Control Panel, and exclude the bin folder of LibGit2Sharp.Tests)" + + "{0}- Antivirus (exclude the bin folder of LibGit2Sharp.Tests from the paths scanned by your real-time antivirus){0}", + Path.NewLine, fileSystem.Path.GetFullPath(directoryPath))); + } + } + } + + internal static class Path + { + public static string NewLine => SysEnv.NewLine; + public static char DirectorySeparatorChar => fileSystem.Path.DirectorySeparatorChar; + + private static readonly StringComparison OsDependentComparison = + OperatingSystem.IsLinux() + ? StringComparison.Ordinal + : StringComparison.OrdinalIgnoreCase; + + public static string GetCurrentDirectory() => AppContext.BaseDirectory ?? throw new InvalidOperationException(); + + public static string GetTempPathLegacy() => fileSystem.Path.GetTempPath().TrimEnd(DirectorySeparatorChar); + public static string GetTempPath() + { + var tempPath = GetCurrentDirectory(); + if (!string.IsNullOrWhiteSpace(SysEnv.GetEnvironmentVariable("RUNNER_TEMP"))) + { + tempPath = SysEnv.GetEnvironmentVariable("RUNNER_TEMP"); + } + + return tempPath!; + } + + public static string GetRepositoryTempPath() => Combine(GetTempPath(), "TestRepositories", Guid.NewGuid().ToString()); + + public static string GetDirectoryName(string? path) + { + ArgumentNullException.ThrowIfNull(path); + + return fileSystem.Path.GetDirectoryName(path)!; + } + + public static string GetFileName(string? path) + { + ArgumentNullException.ThrowIfNull(path); + + return fileSystem.Path.GetFileName(path); + } + + public static string? GetFileNameWithoutExtension(string? path) => fileSystem.Path.GetFileNameWithoutExtension(path); + + public static string? GetExtension(string? path) => fileSystem.Path.GetExtension(path); + + public static string GetFullPath(string? path) => fileSystem.Path.GetFullPath(path!); + + public static string Combine(string? path1, string? path2) + { + ArgumentException.ThrowIfNullOrWhiteSpace(path1); + ArgumentException.ThrowIfNullOrWhiteSpace(path2); + + return fileSystem.Path.Combine(path1, path2); + } + + public static string Combine(string? path1) + { + ArgumentNullException.ThrowIfNull(path1); + + return fileSystem.Path.Combine(path1); + } + + public static string Combine(string? path1, string? path2, string? path3) + { + ArgumentException.ThrowIfNullOrWhiteSpace(path1); + ArgumentException.ThrowIfNullOrWhiteSpace(path2); + ArgumentException.ThrowIfNullOrWhiteSpace(path3); + + return fileSystem.Path.Combine(path1, path2, path3); + } + + public static string Combine(string? path1, string? path2, string? path3, string? path4) + { + ArgumentException.ThrowIfNullOrWhiteSpace(path1); + ArgumentException.ThrowIfNullOrWhiteSpace(path2); + ArgumentException.ThrowIfNullOrWhiteSpace(path3); + ArgumentException.ThrowIfNullOrWhiteSpace(path4); + + return fileSystem.Path.Combine(path1, path2, path3, path4); + } + + public static bool Equal(string? path, string? otherPath) => + string.Equals( + GetFullPath(path).TrimEnd('\\').TrimEnd('/'), + GetFullPath(otherPath).TrimEnd('\\').TrimEnd('/'), + OsDependentComparison); + + public static string GetRandomFileName() => fileSystem.Path.GetRandomFileName(); + + public static bool IsPathRooted(string? path) => fileSystem.Path.IsPathRooted(path); + } +} diff --git a/src/GitVersion.Core/Helpers/LambdaEqualityHelper.cs b/src/GitVersion.Core/Helpers/LambdaEqualityHelper.cs index d8066f6095..15d1b7ad9a 100644 --- a/src/GitVersion.Core/Helpers/LambdaEqualityHelper.cs +++ b/src/GitVersion.Core/Helpers/LambdaEqualityHelper.cs @@ -3,13 +3,8 @@ namespace GitVersion.Helpers; // From the LibGit2Sharp project (libgit2sharp.com) // MIT License - Copyright (c) 2011-2014 LibGit2Sharp contributors // see https://github.com/libgit2/libgit2sharp/blob/7af5c60f22f9bd6064204f84467cfa62bedd1147/LibGit2Sharp/Core/LambdaEqualityHelper.cs -public class LambdaEqualityHelper +public class LambdaEqualityHelper(params Func[] equalityContributorAccessors) { - private readonly Func[] equalityContributorAccessors; - - public LambdaEqualityHelper(params Func[] equalityContributorAccessors) => - this.equalityContributorAccessors = equalityContributorAccessors; - public bool Equals(T? instance, T? other) { if (instance is null || other is null) @@ -22,20 +17,7 @@ public bool Equals(T? instance, T? other) return true; } - if (instance.GetType() != other.GetType()) - { - return false; - } - - foreach (var accessor in this.equalityContributorAccessors) - { - if (!Equals(accessor(instance), accessor(other))) - { - return false; - } - } - - return true; + return instance.GetType() == other.GetType() && equalityContributorAccessors.All(accessor => Equals(accessor(instance), accessor(other))); } public int GetHashCode(T instance) @@ -44,10 +26,10 @@ public int GetHashCode(T instance) unchecked { - foreach (var accessor in this.equalityContributorAccessors) + foreach (var accessor in equalityContributorAccessors) { var item = accessor(instance); - hashCode = (hashCode * 397) ^ (item != null ? item.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ ((item?.GetHashCode()) ?? 0); } } diff --git a/src/GitVersion.Core/Helpers/LambdaKeyComparer.cs b/src/GitVersion.Core/Helpers/LambdaKeyComparer.cs index a3b2bdf7a8..e5ff678e55 100644 --- a/src/GitVersion.Core/Helpers/LambdaKeyComparer.cs +++ b/src/GitVersion.Core/Helpers/LambdaKeyComparer.cs @@ -1,17 +1,12 @@ namespace GitVersion.Helpers; -public class LambdaKeyComparer : Comparer where TSource : class +public class LambdaKeyComparer( + Func keySelector, + IComparer? innerComparer = null) + : Comparer + where TSource : class { - private readonly Func keySelector; - private readonly IComparer innerComparer; - - public LambdaKeyComparer( - Func keySelector, - IComparer? innerComparer = null) - { - this.keySelector = keySelector; - this.innerComparer = innerComparer ?? Comparer.Default; - } + private readonly IComparer innerComparer = innerComparer ?? Comparer.Default; public override int Compare(TSource? x, TSource? y) { @@ -22,8 +17,8 @@ public override int Compare(TSource? x, TSource? y) if (y == null) return 1; - var xKey = this.keySelector(x); - var yKey = this.keySelector(y); + var xKey = keySelector(x); + var yKey = keySelector(y); return this.innerComparer.Compare(xKey, yKey); } } diff --git a/src/GitVersion.Core/Helpers/PathHelper.cs b/src/GitVersion.Core/Helpers/PathHelper.cs deleted file mode 100644 index 4bd92f52f6..0000000000 --- a/src/GitVersion.Core/Helpers/PathHelper.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace GitVersion.Helpers; - -public class PathHelper -{ - public static string GetFullPath(string? path) - { - if (path == null) - throw new ArgumentNullException(nameof(path)); - - return Path.GetFullPath(path); - } - public static string Combine(string? path1, string? path2) - { - if (path1 == null || path2 == null) - throw new ArgumentNullException((path1 == null) ? nameof(path1) : nameof(path2)); - - return Path.Combine(path1, path2); - } - - public static string Combine(string? path1) - { - if (path1 == null) - throw new ArgumentNullException(nameof(path1)); - - return Path.Combine(path1); - } - - public static string Combine(string? path1, string? path2, string? path3) - { - if (path1 == null || path2 == null || path3 == null) - throw new ArgumentNullException((path1 == null) ? nameof(path1) : (path2 == null) ? nameof(path2) : nameof(path3)); - - return Path.Combine(path1, path2, path3); - } - - public static string Combine(string? path1, string? path2, string? path3, string? path4) - { - if (path1 == null || path2 == null || path3 == null || path4 == null) - throw new ArgumentNullException((path1 == null) ? nameof(path1) : (path2 == null) ? nameof(path2) : (path3 == null) ? nameof(path3) : nameof(path4)); - - return Path.Combine(path1, path2, path3, path4); - } -} diff --git a/src/GitVersion.Core/Helpers/RetryAction.cs b/src/GitVersion.Core/Helpers/RetryAction.cs index d8ba5f7784..0365fb8061 100644 --- a/src/GitVersion.Core/Helpers/RetryAction.cs +++ b/src/GitVersion.Core/Helpers/RetryAction.cs @@ -3,14 +3,9 @@ namespace GitVersion.Helpers; -public class RetryAction - : RetryAction where T : Exception +public class RetryAction(int maxRetries = 5) : RetryAction(maxRetries) + where T : Exception { - public RetryAction(int maxRetries = 5) - : base(maxRetries) - { - } - public void Execute(Action operation) => base.Execute(() => { operation(); @@ -23,8 +18,7 @@ public class RetryAction where T : Exception public RetryAction(int maxRetries = 5) { - if (maxRetries < 0) - throw new ArgumentOutOfRangeException(nameof(maxRetries)); + ArgumentOutOfRangeException.ThrowIfNegative(maxRetries); var linearBackoff = LinearBackoff(TimeSpan.FromMilliseconds(100), maxRetries); this.retryPolicy = Policy @@ -44,15 +38,15 @@ private static IEnumerable LinearBackoff(TimeSpan initialDelay, int re static IEnumerable Enumerate(TimeSpan initial, int retry, bool fast, double f) { - int i = 0; + var i = 0; if (fast) { i++; yield return TimeSpan.Zero; } - double ms = initial.TotalMilliseconds; - double ad = f * ms; + var ms = initial.TotalMilliseconds; + var ad = f * ms; for (; i < retry; i++, ms += ad) { diff --git a/src/GitVersion.Core/Helpers/StringComparerUtils.cs b/src/GitVersion.Core/Helpers/StringComparerUtils.cs deleted file mode 100644 index 850ee9c894..0000000000 --- a/src/GitVersion.Core/Helpers/StringComparerUtils.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace GitVersion.Helpers; - -public static class StringComparerUtils -{ - public static readonly StringComparer IgnoreCaseComparer = StringComparer.InvariantCultureIgnoreCase; - public static readonly StringComparison OsDependentComparison = System.Environment.OSVersion.Platform == PlatformID.Unix ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; - public static readonly StringComparer OsDependentComparer = System.Environment.OSVersion.Platform == PlatformID.Unix ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase; -} diff --git a/src/GitVersion.Core/Helpers/StringFormatWith.cs b/src/GitVersion.Core/Helpers/StringFormatWith.cs deleted file mode 100644 index 0cf27c838f..0000000000 --- a/src/GitVersion.Core/Helpers/StringFormatWith.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.Linq.Expressions; -using System.Text.RegularExpressions; - -namespace GitVersion.Helpers; - -internal static class StringFormatWithExtension -{ - // This regex matches an expression to replace. - // - env:ENV name OR a member name - // - optional fallback value after " ?? " - // - the fallback value should be a quoted string, but simple unquoted text is allowed for back compat - private static readonly Regex TokensRegex = new(@"{((env:(?\w+))|(?\w+))(\s+(\?\?)??\s+((?\w+)|""(?.*)""))??}", RegexOptions.Compiled); - - /// - /// Formats the , replacing each expression wrapped in curly braces - /// with the corresponding property from the or . - /// - /// The source template, which may contain expressions to be replaced, e.g '{Foo.Bar.CurrencySymbol} foo {Foo.Bar.Price}' - /// The source object to apply to the - /// - /// The is null. - /// An environment variable was null and no fallback was provided. - /// - /// An expression containing "." is treated as a property or field access on the . - /// An expression starting with "env:" is replaced with the value of the corresponding variable from the . - /// Each expression may specify a single hardcoded fallback value using the {Prop ?? "fallback"} syntax, which applies if the expression evaluates to null. - /// - /// - /// // replace an expression with a property value - /// "Hello {Name}".FormatWith(new { Name = "Fred" }, env); - /// "Hello {Name ?? \"Fred\"}".FormatWith(new { Name = GetNameOrNull() }, env); - /// // replace an expression with an environment variable - /// "{env:BUILD_NUMBER}".FormatWith(new { }, env); - /// "{env:BUILD_NUMBER ?? \"0\"}".FormatWith(new { }, env); - /// - public static string FormatWith(this string template, T? source, IEnvironment environment) - { - if (template is null) - { - throw new ArgumentNullException(nameof(template)); - } - - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } - - foreach (Match match in TokensRegex.Matches(template)) - { - string propertyValue; - string? fallback = match.Groups["fallback"].Success ? match.Groups["fallback"].Value : null; - - if (match.Groups["envvar"].Success) - { - string envVar = match.Groups["envvar"].Value; - propertyValue = environment.GetEnvironmentVariable(envVar) ?? fallback - ?? throw new ArgumentException($"Environment variable {envVar} not found and no fallback string provided"); - } - else - { - var objType = source.GetType(); - string memberAccessExpression = match.Groups["member"].Value; - var expression = CompileDataBinder(objType, memberAccessExpression); - // It would be better to throw if the expression and fallback produce null, but provide an empty string for back compat. - propertyValue = expression(source)?.ToString() ?? fallback ?? ""; - } - - template = template.Replace(match.Value, propertyValue); - } - - return template; - } - - private static Func CompileDataBinder(Type type, string expr) - { - ParameterExpression param = Expression.Parameter(typeof(object)); - Expression body = Expression.Convert(param, type); - body = expr.Split('.').Aggregate(body, Expression.PropertyOrField); - body = Expression.Convert(body, typeof(object)); // Convert result in case the body produces a Nullable value type. - return Expression.Lambda>(body, param).Compile(); - } -} diff --git a/src/GitVersion.Core/Logging/Abstractions/IConsole.cs b/src/GitVersion.Core/Logging/Abstractions/IConsole.cs index 0104326cdd..fcd934d0b8 100644 --- a/src/GitVersion.Core/Logging/Abstractions/IConsole.cs +++ b/src/GitVersion.Core/Logging/Abstractions/IConsole.cs @@ -3,7 +3,6 @@ namespace GitVersion.Logging; public interface IConsole { void WriteLine(string? msg); - void WriteLine(); void Write(string? msg); string? ReadLine(); IDisposable UseColor(ConsoleColor consoleColor); diff --git a/src/GitVersion.Core/Logging/Abstractions/ILog.cs b/src/GitVersion.Core/Logging/Abstractions/ILog.cs index 52ae0573cc..0277f8e333 100644 --- a/src/GitVersion.Core/Logging/Abstractions/ILog.cs +++ b/src/GitVersion.Core/Logging/Abstractions/ILog.cs @@ -6,4 +6,5 @@ public interface ILog void Write(Verbosity verbosity, LogLevel level, string format, params object[] args); IDisposable IndentLog(string operationDescription); void AddLogAppender(ILogAppender logAppender); + void Separator(); } diff --git a/src/GitVersion.Core/Logging/ConsoleAdapter.cs b/src/GitVersion.Core/Logging/ConsoleAdapter.cs index 18df5a066c..f004387120 100644 --- a/src/GitVersion.Core/Logging/ConsoleAdapter.cs +++ b/src/GitVersion.Core/Logging/ConsoleAdapter.cs @@ -1,11 +1,11 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; -public class ConsoleAdapter : IConsole +internal class ConsoleAdapter : IConsole { public void WriteLine(string? msg) => Console.WriteLine(msg); - public void WriteLine() => Console.WriteLine(); - public void Write(string? msg) => Console.Write(msg); public string? ReadLine() => Console.ReadLine(); diff --git a/src/GitVersion.Core/Logging/ConsoleAppender.cs b/src/GitVersion.Core/Logging/ConsoleAppender.cs index d75e9b1be8..847026e5d4 100644 --- a/src/GitVersion.Core/Logging/ConsoleAppender.cs +++ b/src/GitVersion.Core/Logging/ConsoleAppender.cs @@ -1,14 +1,10 @@ namespace GitVersion.Logging; -public class ConsoleAppender : ILogAppender +internal class ConsoleAppender : ILogAppender { - private readonly object locker; - private readonly IDictionary palettes; - public ConsoleAppender() - { - this.locker = new object(); - this.palettes = CreatePalette(); - } + private readonly object locker = new(); + private readonly Dictionary palettes = CreatePalette(); + public void WriteTo(LogLevel level, string message) { lock (this.locker) @@ -44,7 +40,7 @@ public void WriteTo(LogLevel level, string message) } } - private static IDictionary CreatePalette() + private static Dictionary CreatePalette() { var background = Console.BackgroundColor; var palette = new Dictionary diff --git a/src/GitVersion.Core/Logging/Disposable.cs b/src/GitVersion.Core/Logging/Disposable.cs deleted file mode 100644 index 1075e5fdaf..0000000000 --- a/src/GitVersion.Core/Logging/Disposable.cs +++ /dev/null @@ -1,23 +0,0 @@ -using GitVersion.Extensions; - -namespace GitVersion.Logging; - -public static class Disposable -{ - public static IDisposable Create(Action disposer) => new AnonymousDisposable(disposer); - - public static readonly IDisposable Empty = Create(() => { }); - - private sealed class AnonymousDisposable : IDisposable - { - public AnonymousDisposable(Action disposer) => this.disposer = disposer.NotNull(); - - public void Dispose() - { - this.disposer?.Invoke(); - this.disposer = null; - } - - private Action? disposer; - } -} diff --git a/src/GitVersion.Core/Logging/FileAppender.cs b/src/GitVersion.Core/Logging/FileAppender.cs deleted file mode 100644 index 37c1657780..0000000000 --- a/src/GitVersion.Core/Logging/FileAppender.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace GitVersion.Logging; - -public class FileAppender : ILogAppender -{ - private readonly string filePath; - - public FileAppender(string filePath) - { - this.filePath = filePath; - - var logFile = new FileInfo(Path.GetFullPath(filePath)); - - // NOTE: logFile.Directory will be null if the path is i.e. C:\logfile.log. @asbjornu - logFile.Directory?.Create(); - if (logFile.Exists) return; - - using (logFile.CreateText()) { } - } - - public void WriteTo(LogLevel level, string message) - { - try - { - WriteLogEntry(this.filePath, message); - } - catch (Exception) - { - // - } - } - - private static void WriteLogEntry(string logFilePath, string str) - { - var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{System.Environment.NewLine}"; - File.AppendAllText(logFilePath, contents); - } -} diff --git a/src/GitVersion.Core/Logging/Log.cs b/src/GitVersion.Core/Logging/Log.cs index 3b3093d6c6..23459c4b1c 100644 --- a/src/GitVersion.Core/Logging/Log.cs +++ b/src/GitVersion.Core/Logging/Log.cs @@ -1,27 +1,21 @@ using System.Globalization; -using System.Text.RegularExpressions; +using GitVersion.Core; +using GitVersion.Helpers; namespace GitVersion.Logging; -public sealed class Log : ILog +internal sealed class Log(params ILogAppender[] appenders) : ILog { - private IEnumerable appenders; - private readonly Regex obscurePasswordRegex = new("(https?://)(.+)(:.+@)", RegexOptions.Compiled); - private readonly StringBuilder sb; - private string indent = string.Empty; + private IEnumerable appenders = appenders; + private readonly StringBuilder sb = new(); + private string currentIndentation = string.Empty; + private const string Indentation = " "; - public Log() : this(Array.Empty()) + public Log() : this([]) { } - public Log(params ILogAppender[] appenders) - { - this.appenders = appenders; - this.sb = new StringBuilder(); - Verbosity = Verbosity.Normal; - } - - public Verbosity Verbosity { get; set; } + public Verbosity Verbosity { get; set; } = Verbosity.Normal; public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args) { @@ -30,7 +24,7 @@ public void Write(Verbosity verbosity, LogLevel level, string format, params obj return; } - var message = args.Any() ? string.Format(format, args) : format; + var message = args.Length != 0 ? string.Format(format, args) : format; var formattedString = FormatMessage(message, level.ToString().ToUpperInvariant()); foreach (var appender in this.appenders) { @@ -42,25 +36,30 @@ public void Write(Verbosity verbosity, LogLevel level, string format, params obj public IDisposable IndentLog(string operationDescription) { - var start = DateTime.Now; - Write(Verbosity.Normal, LogLevel.Info, $"Begin: {operationDescription}"); - this.indent += " "; + var start = TimeProvider.System.GetTimestamp(); + Write(Verbosity.Normal, LogLevel.Info, $"-< Begin: {operationDescription} >-"); + this.currentIndentation += Indentation; return Disposable.Create(() => { - var length = this.indent.Length - 2; - this.indent = length > 0 ? this.indent.Substring(0, length) : this.indent; - Write(Verbosity.Normal, LogLevel.Info, string.Format(CultureInfo.InvariantCulture, "End: {0} (Took: {1:N}ms)", operationDescription, DateTime.Now.Subtract(start).TotalMilliseconds)); + var length = this.currentIndentation.Length - Indentation.Length; + this.currentIndentation = length > 0 ? this.currentIndentation[..length] : ""; + var end = TimeProvider.System.GetTimestamp(); + var duration = TimeProvider.System.GetElapsedTime(start, end).TotalMilliseconds; + Write(Verbosity.Normal, LogLevel.Info, string.Format(CultureInfo.InvariantCulture, "-< End: {0} (Took: {1:N}ms) >-", operationDescription, duration)); }); } - public void AddLogAppender(ILogAppender logAppender) => this.appenders = this.appenders.Concat(new[] { logAppender }); + public void Separator() => Write(Verbosity.Normal, LogLevel.Info, "-------------------------------------------------------"); + + public void AddLogAppender(ILogAppender logAppender) => this.appenders = this.appenders.Concat([logAppender]); public override string ToString() => this.sb.ToString(); private string FormatMessage(string message, string level) { - var obscuredMessage = this.obscurePasswordRegex.Replace(message, "$1$2:*******@"); - return string.Format(CultureInfo.InvariantCulture, "{0}{1} [{2:MM/dd/yy H:mm:ss:ff}] {3}", this.indent, level, DateTime.Now, obscuredMessage); + var obscuredMessage = RegexPatterns.Common.ObscurePasswordRegex().Replace(message, "$1$2:*******@"); + var timestamp = $"{DateTime.Now:yy-MM-dd H:mm:ss:ff}"; + return string.Format(CultureInfo.InvariantCulture, "{0}{1} [{2}] {3}", this.currentIndentation, level, timestamp, obscuredMessage); } } diff --git a/src/GitVersion.Core/Logging/LogExtensions.cs b/src/GitVersion.Core/Logging/LogExtensions.cs index 945f89332e..4781502246 100644 --- a/src/GitVersion.Core/Logging/LogExtensions.cs +++ b/src/GitVersion.Core/Logging/LogExtensions.cs @@ -1,3 +1,5 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; public static class LogExtensions @@ -42,7 +44,7 @@ public static class LogExtensions public static void Error(this ILog log, Verbosity verbosity, LogAction logAction) => log.Write(verbosity, LogLevel.Error, logAction); - public static void Write(this ILog log, LogLevel level, string format, params object[] args) + private static void Write(this ILog log, LogLevel level, string format, params object[] args) { var verbosity = GetVerbosityForLevel(level); if (verbosity > log.Verbosity) @@ -63,8 +65,10 @@ private static void Write(this ILog log, Verbosity verbosity, LogLevel level, Lo return; } - void ActionEntry(string format, object[] args) => log.Write(verbosity, level, format, args); logAction(ActionEntry); + return; + + void ActionEntry(string format, object[] args) => log.Write(verbosity, level, format, args); } private static void Write(this ILog log, LogLevel level, LogAction? logAction) @@ -78,8 +82,10 @@ private static void Write(this ILog log, LogLevel level, LogAction? logAction) return; } - void ActionEntry(string format, object[] args) => log.Write(verbosity, level, format, args); logAction(ActionEntry); + return; + + void ActionEntry(string format, object[] args) => log.Write(verbosity, level, format, args); } public static IDisposable QuietVerbosity(this ILog log) => log.WithVerbosity(Verbosity.Quiet); @@ -94,18 +100,15 @@ private static void Write(this ILog log, LogLevel level, LogAction? logAction) private static IDisposable WithVerbosity(this ILog log, Verbosity verbosity) { - if (log == null) - { - throw new ArgumentNullException(nameof(log)); - } + ArgumentNullException.ThrowIfNull(log); var lastVerbosity = log.Verbosity; log.Verbosity = verbosity; return Disposable.Create(() => log.Verbosity = lastVerbosity); } - public static Verbosity GetVerbosityForLevel(LogLevel level) => VerbosityMaps[level]; + private static Verbosity GetVerbosityForLevel(LogLevel level) => VerbosityMaps[level]; - private static readonly IDictionary VerbosityMaps = new Dictionary + private static readonly Dictionary VerbosityMaps = new() { { LogLevel.Verbose, Verbosity.Verbose }, { LogLevel.Debug, Verbosity.Diagnostic }, diff --git a/src/GitVersion.Core/Logging/NullLog.cs b/src/GitVersion.Core/Logging/NullLog.cs index fb9ced94da..8a311f8cc2 100644 --- a/src/GitVersion.Core/Logging/NullLog.cs +++ b/src/GitVersion.Core/Logging/NullLog.cs @@ -1,6 +1,8 @@ +using GitVersion.Helpers; + namespace GitVersion.Logging; -public sealed class NullLog : ILog +internal sealed class NullLog : ILog { public Verbosity Verbosity { get; set; } @@ -14,5 +16,9 @@ public void AddLogAppender(ILogAppender logAppender) { } + public void Separator() + { + } + public string? Indent { get; set; } } diff --git a/src/GitVersion.Core/MergeMessage.cs b/src/GitVersion.Core/MergeMessage.cs new file mode 100644 index 0000000000..345a9b1c8b --- /dev/null +++ b/src/GitVersion.Core/MergeMessage.cs @@ -0,0 +1,98 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.RegularExpressions; +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion; + +public class MergeMessage +{ + private static readonly IList<(string Name, Regex Pattern)> DefaultFormats = + [ + new("Default", RegexPatterns.MergeMessage.DefaultMergeMessageRegex()), + new("SmartGit", RegexPatterns.MergeMessage.SmartGitMergeMessageRegex()), + new("BitBucketPull", RegexPatterns.MergeMessage.BitBucketPullMergeMessageRegex()), + new("BitBucketPullv7", RegexPatterns.MergeMessage.BitBucketPullv7MergeMessageRegex()), + new("BitBucketCloudPull", RegexPatterns.MergeMessage.BitBucketCloudPullMergeMessageRegex()), + new("GitHubPull", RegexPatterns.MergeMessage.GitHubPullMergeMessageRegex()), + new("RemoteTracking", RegexPatterns.MergeMessage.RemoteTrackingMergeMessageRegex()), + new("AzureDevOpsPull", RegexPatterns.MergeMessage.AzureDevOpsPullMergeMessageRegex()) + ]; + + public MergeMessage(string mergeMessage, IGitVersionConfiguration configuration) + { + mergeMessage.NotNull(); + + if (mergeMessage.Length == 0) return; + + // Concatenate configuration formats with the defaults. + // Ensure configurations are processed first. + var allFormats = configuration.MergeMessageFormats + .Select(x => (Name: x.Key, Pattern: RegexPatterns.Cache.GetOrAdd(x.Value))) + .Concat(DefaultFormats); + + foreach (var (Name, Pattern) in allFormats) + { + var match = Pattern.Match(mergeMessage); + if (!match.Success) + continue; + + FormatName = Name; + var sourceBranch = match.Groups["SourceBranch"].Value; + MergedBranch = GetMergedBranchName(sourceBranch); + + if (match.Groups["TargetBranch"].Success) + { + TargetBranch = match.Groups["TargetBranch"].Value; + } + + if (int.TryParse(match.Groups["PullRequestNumber"].Value, out var pullNumber)) + { + PullRequestNumber = pullNumber; + } + + Version = MergedBranch?.TryGetSemanticVersion(out var result, configuration) == true ? result.Value : null; + + break; + } + } + + public string? FormatName { get; } + public string? TargetBranch { get; } + public ReferenceName? MergedBranch { get; } + + public bool IsMergedPullRequest => PullRequestNumber != null; + public int? PullRequestNumber { get; } + public SemanticVersion? Version { get; } + + private ReferenceName GetMergedBranchName(string mergedBranch) + { + if (FormatName == "RemoteTracking" && !mergedBranch.StartsWith(ReferenceName.RemoteTrackingBranchPrefix)) + { + mergedBranch = $"{ReferenceName.RemoteTrackingBranchPrefix}{mergedBranch}"; + } + return ReferenceName.FromBranchName(mergedBranch); + } + + public static bool TryParse( + ICommit mergeCommit, IGitVersionConfiguration configuration, [NotNullWhen(true)] out MergeMessage? mergeMessage) + { + mergeCommit.NotNull(); + configuration.NotNull(); + + mergeMessage = null; + + var mergedBranch = new MergeMessage(mergeCommit.Message, configuration).MergedBranch; + var isReleaseBranch = mergedBranch is not null && configuration.IsReleaseBranch(mergedBranch); + var isValidMergeCommit = mergeCommit.IsMergeCommit() || isReleaseBranch; + + if (isValidMergeCommit) + { + mergeMessage = new MergeMessage(mergeCommit.Message, configuration); + } + + return isValidMergeCommit; + } +} diff --git a/src/GitVersion.Core/Model/ConfigInfo.cs b/src/GitVersion.Core/Model/ConfigInfo.cs deleted file mode 100644 index 822a0ba25d..0000000000 --- a/src/GitVersion.Core/Model/ConfigInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion; - -public class ConfigInfo -{ - public string? ConfigFile; - public Config? OverrideConfig; - public bool ShowConfig; -} diff --git a/src/GitVersion.Core/Model/Configuration/BranchConfig.cs b/src/GitVersion.Core/Model/Configuration/BranchConfig.cs deleted file mode 100644 index 46e60ed892..0000000000 --- a/src/GitVersion.Core/Model/Configuration/BranchConfig.cs +++ /dev/null @@ -1,123 +0,0 @@ -using GitVersion.VersionCalculation; -using YamlDotNet.Serialization; - -namespace GitVersion.Model.Configuration; - -public class BranchConfig -{ - public BranchConfig() - { - } - - /// - /// Creates a clone of the given . - /// - public BranchConfig(BranchConfig branchConfiguration) - { - VersioningMode = branchConfiguration.VersioningMode; - Tag = branchConfiguration.Tag; - Increment = branchConfiguration.Increment; - PreventIncrementOfMergedBranchVersion = branchConfiguration.PreventIncrementOfMergedBranchVersion; - TagNumberPattern = branchConfiguration.TagNumberPattern; - TrackMergeTarget = branchConfiguration.TrackMergeTarget; - CommitMessageIncrementing = branchConfiguration.CommitMessageIncrementing; - TracksReleaseBranches = branchConfiguration.TracksReleaseBranches; - Regex = branchConfiguration.Regex; - IsReleaseBranch = branchConfiguration.IsReleaseBranch; - IsMainline = branchConfiguration.IsMainline; - Name = branchConfiguration.Name; - SourceBranches = branchConfiguration.SourceBranches; - IsSourceBranchFor = branchConfiguration.IsSourceBranchFor; - PreReleaseWeight = branchConfiguration.PreReleaseWeight; - } - - [YamlMember(Alias = "mode")] - public VersioningMode? VersioningMode { get; set; } - - /// - /// Special value 'useBranchName' will extract the tag from the branch name - /// - [YamlMember(Alias = "tag")] - public string? Tag { get; set; } - - [YamlMember(Alias = "increment")] - public IncrementStrategy? Increment { get; set; } - - [YamlMember(Alias = "prevent-increment-of-merged-branch-version")] - public bool? PreventIncrementOfMergedBranchVersion { get; set; } - - [YamlMember(Alias = "tag-number-pattern")] - public string? TagNumberPattern { get; set; } - - [YamlMember(Alias = "track-merge-target")] - public bool? TrackMergeTarget { get; set; } - - [YamlMember(Alias = "commit-message-incrementing")] - public CommitMessageIncrementMode? CommitMessageIncrementing { get; set; } - - [YamlMember(Alias = "regex")] - public string? Regex { get; set; } - - [YamlMember(Alias = "source-branches")] - public HashSet? SourceBranches { get; set; } - - [YamlMember(Alias = "is-source-branch-for")] - public HashSet? IsSourceBranchFor { get; set; } - - [YamlMember(Alias = "tracks-release-branches")] - public bool? TracksReleaseBranches { get; set; } - - [YamlMember(Alias = "is-release-branch")] - public bool? IsReleaseBranch { get; set; } - - [YamlMember(Alias = "is-mainline")] - public bool? IsMainline { get; set; } - - [YamlMember(Alias = "pre-release-weight")] - public int? PreReleaseWeight { get; set; } - - /// - /// The name given to this configuration in the config file. - /// - [YamlIgnore] - public string Name { get; set; } - - public void MergeTo(BranchConfig targetConfig) - { - if (targetConfig == null) throw new ArgumentNullException(nameof(targetConfig)); - - targetConfig.VersioningMode = this.VersioningMode ?? targetConfig.VersioningMode; - targetConfig.Tag = this.Tag ?? targetConfig.Tag; - targetConfig.Increment = this.Increment ?? targetConfig.Increment; - targetConfig.PreventIncrementOfMergedBranchVersion = this.PreventIncrementOfMergedBranchVersion ?? targetConfig.PreventIncrementOfMergedBranchVersion; - targetConfig.TagNumberPattern = this.TagNumberPattern ?? targetConfig.TagNumberPattern; - targetConfig.TrackMergeTarget = this.TrackMergeTarget ?? targetConfig.TrackMergeTarget; - targetConfig.CommitMessageIncrementing = this.CommitMessageIncrementing ?? targetConfig.CommitMessageIncrementing; - targetConfig.Regex = this.Regex ?? targetConfig.Regex; - targetConfig.SourceBranches = this.SourceBranches ?? targetConfig.SourceBranches; - targetConfig.IsSourceBranchFor = this.IsSourceBranchFor ?? targetConfig.IsSourceBranchFor; - targetConfig.TracksReleaseBranches = this.TracksReleaseBranches ?? targetConfig.TracksReleaseBranches; - targetConfig.IsReleaseBranch = this.IsReleaseBranch ?? targetConfig.IsReleaseBranch; - targetConfig.IsMainline = this.IsMainline ?? targetConfig.IsMainline; - targetConfig.PreReleaseWeight = this.PreReleaseWeight ?? targetConfig.PreReleaseWeight; - } - - public BranchConfig Apply(BranchConfig overrides) - { - if (overrides == null) throw new ArgumentNullException(nameof(overrides)); - - overrides.MergeTo(this); - return this; - } - - public static BranchConfig CreateDefaultBranchConfig(string name) => new() - { - Name = name, - Tag = "useBranchName", - PreventIncrementOfMergedBranchVersion = false, - TrackMergeTarget = false, - TracksReleaseBranches = false, - IsReleaseBranch = false, - IsMainline = false - }; -} diff --git a/src/GitVersion.Core/Model/Configuration/Config.cs b/src/GitVersion.Core/Model/Configuration/Config.cs deleted file mode 100644 index f655cec39b..0000000000 --- a/src/GitVersion.Core/Model/Configuration/Config.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.Globalization; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.VersionCalculation; -using YamlDotNet.Serialization; - -namespace GitVersion.Model.Configuration; - -public class Config -{ - private string? nextVersion; - - public Config() - { - Branches = new Dictionary(); - Ignore = new IgnoreConfig(); - } - - [YamlMember(Alias = "assembly-versioning-scheme")] - public AssemblyVersioningScheme? AssemblyVersioningScheme { get; set; } - - [YamlMember(Alias = "assembly-file-versioning-scheme")] - public AssemblyFileVersioningScheme? AssemblyFileVersioningScheme { get; set; } - - [YamlMember(Alias = "assembly-informational-format")] - public string? AssemblyInformationalFormat { get; set; } - - [YamlMember(Alias = "assembly-versioning-format")] - public string? AssemblyVersioningFormat { get; set; } - - [YamlMember(Alias = "assembly-file-versioning-format")] - public string? AssemblyFileVersioningFormat { get; set; } - - [YamlMember(Alias = "mode")] - public VersioningMode? VersioningMode { get; set; } - - [YamlMember(Alias = "tag-prefix")] - public string? TagPrefix { get; set; } - - [YamlMember(Alias = "continuous-delivery-fallback-tag")] - public string? ContinuousDeploymentFallbackTag { get; set; } - - [YamlMember(Alias = "next-version")] - public string? NextVersion - { - get => this.nextVersion; - set => - this.nextVersion = int.TryParse(value, NumberStyles.Any, NumberFormatInfo.InvariantInfo, out var major) - ? $"{major}.0" - : value; - } - - [YamlMember(Alias = "major-version-bump-message")] - public string? MajorVersionBumpMessage { get; set; } - - [YamlMember(Alias = "minor-version-bump-message")] - public string? MinorVersionBumpMessage { get; set; } - - [YamlMember(Alias = "patch-version-bump-message")] - public string? PatchVersionBumpMessage { get; set; } - - [YamlMember(Alias = "no-bump-message")] - public string? NoBumpMessage { get; set; } - - [YamlMember(Alias = "legacy-semver-padding")] - public int? LegacySemVerPadding { get; set; } - - [YamlMember(Alias = "build-metadata-padding")] - public int? BuildMetaDataPadding { get; set; } - - [YamlMember(Alias = "commits-since-version-source-padding")] - public int? CommitsSinceVersionSourcePadding { get; set; } - - [YamlMember(Alias = "tag-pre-release-weight")] - public int? TagPreReleaseWeight { get; set; } - - [YamlMember(Alias = "commit-message-incrementing")] - public CommitMessageIncrementMode? CommitMessageIncrementing { get; set; } - - [YamlMember(Alias = "branches")] - public Dictionary Branches { get; set; } - - [YamlMember(Alias = "ignore")] - public IgnoreConfig Ignore { get; set; } - - [YamlMember(Alias = "increment")] - public IncrementStrategy? Increment { get; set; } - - [YamlMember(Alias = "commit-date-format")] - public string? CommitDateFormat { get; set; } - - [YamlMember(Alias = "merge-message-formats")] - public Dictionary MergeMessageFormats { get; set; } = new(); - - [YamlMember(Alias = "update-build-number")] - public bool? UpdateBuildNumber { get; set; } - - public override string ToString() - { - var stringBuilder = new StringBuilder(); - using var stream = new StringWriter(stringBuilder); - ConfigSerializer.Write(this, stream); - stream.Flush(); - return stringBuilder.ToString(); - } - - public const string DefaultTagPrefix = "[vV]"; - public const string ReleaseBranchRegex = "^releases?[/-]"; - public const string FeatureBranchRegex = "^features?[/-]"; - public const string PullRequestRegex = @"^(pull|pull\-requests|pr)[/-]"; - public const string HotfixBranchRegex = "^hotfix(es)?[/-]"; - public const string SupportBranchRegex = "^support[/-]"; - public const string DevelopBranchRegex = "^dev(elop)?(ment)?$"; - public const string MainBranchRegex = "^master$|^main$"; - public const string MainBranchKey = "main"; - public const string MasterBranchKey = "master"; - public const string ReleaseBranchKey = "release"; - public const string FeatureBranchKey = "feature"; - public const string PullRequestBranchKey = "pull-request"; - public const string HotfixBranchKey = "hotfix"; - public const string SupportBranchKey = "support"; - public const string DevelopBranchKey = "develop"; -} diff --git a/src/GitVersion.Core/Model/Configuration/EffectiveBranchConfiguration.cs b/src/GitVersion.Core/Model/Configuration/EffectiveBranchConfiguration.cs deleted file mode 100644 index e45d1afa6c..0000000000 --- a/src/GitVersion.Core/Model/Configuration/EffectiveBranchConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.VersionCalculation; - -namespace GitVersion.Model.Configuration; - -public class EffectiveBranchConfiguration -{ - public IBranch Branch { get; } - - public EffectiveConfiguration Value { get; } - - public EffectiveBranchConfiguration(IBranch branch, EffectiveConfiguration value) - { - Branch = branch.NotNull(); - Value = value.NotNull(); - } - - public NextVersion CreateNextVersion(BaseVersion baseVersion, SemanticVersion incrementedVersion) - => new(incrementedVersion.NotNull(), baseVersion.NotNull(), new(Branch, Value)); -} diff --git a/src/GitVersion.Core/Model/Configuration/EffectiveConfiguration.cs b/src/GitVersion.Core/Model/Configuration/EffectiveConfiguration.cs deleted file mode 100644 index f0ba2bef63..0000000000 --- a/src/GitVersion.Core/Model/Configuration/EffectiveConfiguration.cs +++ /dev/null @@ -1,201 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.VersionCalculation; - -namespace GitVersion.Model.Configuration; - -/// -/// Configuration can be applied to different things, effective configuration is the result after applying the -/// appropriate configuration -/// -public class EffectiveConfiguration -{ - public EffectiveConfiguration(Config configuration, BranchConfig currentBranchConfig) - { - configuration.NotNull(); - currentBranchConfig.NotNull(); - - var name = currentBranchConfig.Name; - - if (!currentBranchConfig.VersioningMode.HasValue) - throw new Exception($"Configuration value for 'Versioning mode' for branch {name} has no value. (this should not happen, please report an issue)"); - - if (!currentBranchConfig.Increment.HasValue) - throw new Exception($"Configuration value for 'Increment' for branch {name} has no value. (this should not happen, please report an issue)"); - - if (!configuration.AssemblyVersioningScheme.HasValue) - throw new Exception("Configuration value for 'AssemblyVersioningScheme' has no value. (this should not happen, please report an issue)"); - - if (!configuration.AssemblyFileVersioningScheme.HasValue) - throw new Exception("Configuration value for 'AssemblyFileVersioningScheme' has no value. (this should not happen, please report an issue)"); - - if (!configuration.CommitMessageIncrementing.HasValue) - throw new Exception("Configuration value for 'CommitMessageIncrementing' has no value. (this should not happen, please report an issue)"); - - if (!configuration.LegacySemVerPadding.HasValue) - throw new Exception("Configuration value for 'LegacySemVerPadding' has no value. (this should not happen, please report an issue)"); - - if (!configuration.BuildMetaDataPadding.HasValue) - throw new Exception("Configuration value for 'BuildMetaDataPadding' has no value. (this should not happen, please report an issue)"); - - if (!configuration.CommitsSinceVersionSourcePadding.HasValue) - throw new Exception("Configuration value for 'CommitsSinceVersionSourcePadding' has no value. (this should not happen, please report an issue)"); - - if (!configuration.TagPreReleaseWeight.HasValue) - throw new Exception("Configuration value for 'TagPreReleaseWeight' has no value. (this should not happen, please report an issue)"); - - AssemblyVersioningScheme = configuration.AssemblyVersioningScheme.Value; - AssemblyFileVersioningScheme = configuration.AssemblyFileVersioningScheme.Value; - AssemblyInformationalFormat = configuration.AssemblyInformationalFormat; - AssemblyVersioningFormat = configuration.AssemblyVersioningFormat; - AssemblyFileVersioningFormat = configuration.AssemblyFileVersioningFormat; - VersioningMode = currentBranchConfig.VersioningMode.Value; - TagPrefix = configuration.TagPrefix; - Tag = currentBranchConfig.Tag ?? @"{BranchName}"; - NextVersion = configuration.NextVersion; - Increment = currentBranchConfig.Increment.Value; - BranchPrefixToTrim = currentBranchConfig.Regex; - PreventIncrementOfMergedBranchVersion = currentBranchConfig.PreventIncrementOfMergedBranchVersion ?? false; - TagNumberPattern = currentBranchConfig.TagNumberPattern; - ContinuousDeploymentFallbackTag = configuration.ContinuousDeploymentFallbackTag; - TrackMergeTarget = currentBranchConfig.TrackMergeTarget ?? false; - MajorVersionBumpMessage = configuration.MajorVersionBumpMessage; - MinorVersionBumpMessage = configuration.MinorVersionBumpMessage; - PatchVersionBumpMessage = configuration.PatchVersionBumpMessage; - NoBumpMessage = configuration.NoBumpMessage; - CommitMessageIncrementing = currentBranchConfig.CommitMessageIncrementing ?? configuration.CommitMessageIncrementing.Value; - LegacySemVerPadding = configuration.LegacySemVerPadding.Value; - BuildMetaDataPadding = configuration.BuildMetaDataPadding.Value; - CommitsSinceVersionSourcePadding = configuration.CommitsSinceVersionSourcePadding.Value; - VersionFilters = configuration.Ignore.ToFilters(); - TracksReleaseBranches = currentBranchConfig.TracksReleaseBranches ?? false; - IsReleaseBranch = currentBranchConfig.IsReleaseBranch ?? false; - IsMainline = currentBranchConfig.IsMainline ?? false; - CommitDateFormat = configuration.CommitDateFormat; - UpdateBuildNumber = configuration.UpdateBuildNumber ?? true; - PreReleaseWeight = currentBranchConfig.PreReleaseWeight ?? 0; - TagPreReleaseWeight = configuration.TagPreReleaseWeight.Value; - } - - protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningScheme, - AssemblyFileVersioningScheme assemblyFileVersioningScheme, - string? assemblyInformationalFormat, - string? assemblyVersioningFormat, - string? assemblyFileVersioningFormat, - VersioningMode versioningMode, - string? tagPrefix, - string? tag, - string? nextVersion, - IncrementStrategy increment, - string? branchPrefixToTrim, - bool preventIncrementOfMergedBranchVersion, - string? tagNumberPattern, - string? continuousDeploymentFallbackTag, - bool trackMergeTarget, - string? majorVersionBumpMessage, - string? minorVersionBumpMessage, - string? patchVersionBumpMessage, - string? noBumpMessage, - CommitMessageIncrementMode commitMessageIncrementing, - int legacySemVerPaddding, - int buildMetaDataPadding, - int commitsSinceVersionSourcePadding, - IEnumerable versionFilters, - bool tracksReleaseBranches, - bool isReleaseBranch, - bool isMainline, - string? commitDateFormat, - bool updateBuildNumber, - int preReleaseWeight, - int tagPreReleaseWeight) - { - AssemblyVersioningScheme = assemblyVersioningScheme; - AssemblyFileVersioningScheme = assemblyFileVersioningScheme; - AssemblyInformationalFormat = assemblyInformationalFormat; - AssemblyVersioningFormat = assemblyVersioningFormat; - AssemblyFileVersioningFormat = assemblyFileVersioningFormat; - VersioningMode = versioningMode; - TagPrefix = tagPrefix; - Tag = tag; - NextVersion = nextVersion; - Increment = increment; - BranchPrefixToTrim = branchPrefixToTrim; - PreventIncrementOfMergedBranchVersion = preventIncrementOfMergedBranchVersion; - TagNumberPattern = tagNumberPattern; - ContinuousDeploymentFallbackTag = continuousDeploymentFallbackTag; - TrackMergeTarget = trackMergeTarget; - MajorVersionBumpMessage = majorVersionBumpMessage; - MinorVersionBumpMessage = minorVersionBumpMessage; - PatchVersionBumpMessage = patchVersionBumpMessage; - NoBumpMessage = noBumpMessage; - CommitMessageIncrementing = commitMessageIncrementing; - LegacySemVerPadding = legacySemVerPaddding; - BuildMetaDataPadding = buildMetaDataPadding; - CommitsSinceVersionSourcePadding = commitsSinceVersionSourcePadding; - VersionFilters = versionFilters; - TracksReleaseBranches = tracksReleaseBranches; - IsReleaseBranch = isReleaseBranch; - IsMainline = isMainline; - CommitDateFormat = commitDateFormat; - UpdateBuildNumber = updateBuildNumber; - PreReleaseWeight = preReleaseWeight; - TagPreReleaseWeight = tagPreReleaseWeight; - } - - public bool TracksReleaseBranches { get; } - public bool IsReleaseBranch { get; } - public bool IsMainline { get; } - public VersioningMode VersioningMode { get; } - public AssemblyVersioningScheme AssemblyVersioningScheme { get; } - public AssemblyFileVersioningScheme AssemblyFileVersioningScheme { get; } - public string? AssemblyInformationalFormat { get; } - public string? AssemblyVersioningFormat { get; } - public string? AssemblyFileVersioningFormat { get; } - - /// - /// Git tag prefix - /// - public string? TagPrefix { get; } - - /// - /// Tag to use when calculating SemVer - /// - public string? Tag { get; } - - public string? NextVersion { get; } - - public IncrementStrategy Increment { get; } - - public string? BranchPrefixToTrim { get; } - - public bool PreventIncrementOfMergedBranchVersion { get; } - - public string? TagNumberPattern { get; } - - public string? ContinuousDeploymentFallbackTag { get; } - - public bool TrackMergeTarget { get; } - - public string? MajorVersionBumpMessage { get; } - - public string? MinorVersionBumpMessage { get; } - - public string? PatchVersionBumpMessage { get; } - - public string? NoBumpMessage { get; } - public int LegacySemVerPadding { get; } - public int BuildMetaDataPadding { get; } - - public int CommitsSinceVersionSourcePadding { get; } - - public CommitMessageIncrementMode CommitMessageIncrementing { get; } - - public IEnumerable VersionFilters { get; } - - public string? CommitDateFormat { get; } - - public bool UpdateBuildNumber { get; } - - public int PreReleaseWeight { get; } - - public int TagPreReleaseWeight { get; } -} diff --git a/src/GitVersion.Core/Model/Configuration/IgnoreConfig.cs b/src/GitVersion.Core/Model/Configuration/IgnoreConfig.cs deleted file mode 100644 index 43dc60e288..0000000000 --- a/src/GitVersion.Core/Model/Configuration/IgnoreConfig.cs +++ /dev/null @@ -1,24 +0,0 @@ -using GitVersion.VersionCalculation; -using YamlDotNet.Serialization; - -namespace GitVersion.Model.Configuration; - -public class IgnoreConfig -{ - public IgnoreConfig() => ShAs = Enumerable.Empty(); - - [YamlMember(Alias = "commits-before")] - public DateTimeOffset? Before { get; set; } - - [YamlMember(Alias = "sha")] - public IEnumerable ShAs { get; set; } - - [YamlIgnore] - public virtual bool IsEmpty => Before == null && ShAs.Any() == false; - - public virtual IEnumerable ToFilters() - { - if (ShAs.Any()) yield return new ShaVersionFilter(ShAs); - if (Before.HasValue) yield return new MinDateVersionFilter(Before.Value); - } -} diff --git a/src/GitVersion.Core/Model/Exceptions/BugException.cs b/src/GitVersion.Core/Model/Exceptions/BugException.cs deleted file mode 100644 index 50ab60c127..0000000000 --- a/src/GitVersion.Core/Model/Exceptions/BugException.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace GitVersion; - -public class BugException : Exception -{ - public BugException(string message) : base(message) - { - } -} diff --git a/src/GitVersion.Core/Model/Exceptions/ConfigurationException.cs b/src/GitVersion.Core/Model/Exceptions/ConfigurationException.cs deleted file mode 100644 index 9eb11864f3..0000000000 --- a/src/GitVersion.Core/Model/Exceptions/ConfigurationException.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GitVersion.Configuration; - -[Serializable] -public class ConfigurationException : GitVersionException -{ - public ConfigurationException(string msg) - : base(msg) - { - } -} diff --git a/src/GitVersion.Core/Model/Exceptions/GitToolsException.cs b/src/GitVersion.Core/Model/Exceptions/GitToolsException.cs deleted file mode 100644 index ecbd39cd81..0000000000 --- a/src/GitVersion.Core/Model/Exceptions/GitToolsException.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GitVersion; - -[Serializable] -public class GitToolsException : Exception -{ - public GitToolsException(string messageFormat, params object[] args) - : base(string.Format(messageFormat, args)) - { - } - - public GitToolsException(string message, Exception innerException) - : base(message, innerException) - { - } -} diff --git a/src/GitVersion.Core/Model/Exceptions/InfiniteLoopProtectionException.cs b/src/GitVersion.Core/Model/Exceptions/InfiniteLoopProtectionException.cs deleted file mode 100644 index 0828ae18c1..0000000000 --- a/src/GitVersion.Core/Model/Exceptions/InfiniteLoopProtectionException.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GitVersion.Model.Exceptions -{ - public class InfiniteLoopProtectionException : Exception - { - public InfiniteLoopProtectionException(string messageFormat) - : base(messageFormat) - { - } - } -} diff --git a/src/GitVersion.Core/Model/Exceptions/LockedFileException.cs b/src/GitVersion.Core/Model/Exceptions/LockedFileException.cs deleted file mode 100644 index ac742982b0..0000000000 --- a/src/GitVersion.Core/Model/Exceptions/LockedFileException.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace GitVersion; - -public class LockedFileException : Exception -{ - public LockedFileException(Exception inner) : base(inner.Message, inner) - { - } -} diff --git a/src/GitVersion.Core/Model/FileWriteInfo.cs b/src/GitVersion.Core/Model/FileWriteInfo.cs deleted file mode 100644 index 976dd386c1..0000000000 --- a/src/GitVersion.Core/Model/FileWriteInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GitVersion; - -public sealed class FileWriteInfo -{ - public FileWriteInfo(string workingDirectory, string fileName, string fileExtension) - { - WorkingDirectory = workingDirectory; - FileName = fileName; - FileExtension = fileExtension; - } - - public string WorkingDirectory { get; } - public string FileName { get; } - public string FileExtension { get; } -} diff --git a/src/GitVersion.Core/Model/GitVersionCacheKey.cs b/src/GitVersion.Core/Model/GitVersionCacheKey.cs deleted file mode 100644 index d12e85c9ca..0000000000 --- a/src/GitVersion.Core/Model/GitVersionCacheKey.cs +++ /dev/null @@ -1,18 +0,0 @@ -using GitVersion.Extensions; - -namespace GitVersion.Cache; - -public class GitVersionCacheKey -{ - public GitVersionCacheKey(string value) - { - if (value.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value; - } - - public string Value { get; private set; } -} diff --git a/src/GitVersion.Core/Model/GitVersionContext.cs b/src/GitVersion.Core/Model/GitVersionContext.cs deleted file mode 100644 index 3d303072a6..0000000000 --- a/src/GitVersion.Core/Model/GitVersionContext.cs +++ /dev/null @@ -1,41 +0,0 @@ -using GitVersion.Configuration; -using GitVersion.Model.Configuration; - -namespace GitVersion; - -/// -/// Contextual information about where GitVersion is being run -/// -public class GitVersionContext -{ - /// - /// Contains the raw configuration, use Configuration for specific config based on the current GitVersion context. - /// - public Config FullConfiguration { get; } - - public SemanticVersion? CurrentCommitTaggedVersion { get; } - - public IBranch CurrentBranch { get; } - - public ICommit? CurrentCommit { get; } - - public bool IsCurrentCommitTagged => CurrentCommitTaggedVersion != null; - - public int NumberOfUncommittedChanges { get; } - - public GitVersionContext(IBranch currentBranch, ICommit? currentCommit, - Config configuration, SemanticVersion? currentCommitTaggedVersion, int numberOfUncommittedChanges) - { - CurrentBranch = currentBranch; - CurrentCommit = currentCommit; - FullConfiguration = configuration; - CurrentCommitTaggedVersion = currentCommitTaggedVersion; - NumberOfUncommittedChanges = numberOfUncommittedChanges; - } - - public EffectiveConfiguration GetEffectiveConfiguration(IBranch branch) - { - BranchConfig branchConfiguration = FullConfiguration.GetBranchConfiguration(branch); - return new EffectiveConfiguration(FullConfiguration, branchConfiguration); - } -} diff --git a/src/GitVersion.Core/Model/MergeMessage.cs b/src/GitVersion.Core/Model/MergeMessage.cs deleted file mode 100644 index 97a5c425f0..0000000000 --- a/src/GitVersion.Core/Model/MergeMessage.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Model.Configuration; - -namespace GitVersion; - -public class MergeMessage -{ - private static readonly IList DefaultFormats = new List - { - new("Default", @"^Merge (branch|tag) '(?[^']*)'(?: into (?[^\s]*))*"), - new("SmartGit", @"^Finish (?[^\s]*)(?: into (?[^\s]*))*"), - new("BitBucketPull", @"^Merge pull request #(?\d+) (from|in) (?.*) from (?[^\s]*) to (?[^\s]*)"), - new("BitBucketPullv7", @"^Pull request #(?\d+).*\r?\n\r?\nMerge in (?.*) from (?[^\s]*) to (?[^\s]*)"), - new("GitHubPull", @"^Merge pull request #(?\d+) (from|in) (?:(?[^\s]*))(?: into (?[^\s]*))*"), - new("RemoteTracking", @"^Merge remote-tracking branch '(?[^\s]*)'(?: into (?[^\s]*))*") - }; - - public MergeMessage(string? mergeMessage, Config config) - { - if (mergeMessage == null) - throw new NullReferenceException(); - - // Concat config formats with the defaults. - // Ensure configs are processed first. - var allFormats = config.MergeMessageFormats - .Select(x => new MergeMessageFormat(x.Key, x.Value)) - .Concat(DefaultFormats); - - foreach (var format in allFormats) - { - var match = format.Pattern.Match(mergeMessage); - if (match.Success) - { - FormatName = format.Name; - MergedBranch = match.Groups["SourceBranch"].Value; - - if (match.Groups["TargetBranch"].Success) - { - TargetBranch = match.Groups["TargetBranch"].Value; - } - - if (int.TryParse(match.Groups["PullRequestNumber"].Value, out var pullNumber)) - { - PullRequestNumber = pullNumber; - } - - Version = ParseVersion(config.TagPrefix); - - break; - } - } - } - - public string? FormatName { get; } - public string? TargetBranch { get; } - public string MergedBranch { get; } = ""; - public bool IsMergedPullRequest => PullRequestNumber != null; - public int? PullRequestNumber { get; } - public SemanticVersion? Version { get; } - - private SemanticVersion? ParseVersion(string? tagPrefix) - { - if (tagPrefix is null) - return null; - // Remove remotes and branch prefixes like release/ feature/ hotfix/ etc - var toMatch = Regex.Replace(MergedBranch, @"^(\w+[-/])*", "", RegexOptions.IgnoreCase); - toMatch = Regex.Replace(toMatch, $"^{tagPrefix}", ""); - // We don't match if the version is likely an ip (i.e starts with http://) - var versionMatch = new Regex(@"^(?> -{ - public VersionVariables(string major, - string minor, - string patch, - string? buildMetaData, - string? buildMetaDataPadded, - string? fullBuildMetaData, - string? branchName, - string? escapedBranchName, - string? sha, - string? shortSha, - string majorMinorPatch, - string semVer, - string legacySemVer, - string legacySemVerPadded, - string fullSemVer, - string? assemblySemVer, - string? assemblySemFileVer, - string? preReleaseTag, - string? preReleaseTagWithDash, - string? preReleaseLabel, - string? preReleaseLabelWithDash, - string? preReleaseNumber, - string weightedPreReleaseNumber, - string? informationalVersion, - string? commitDate, - string nugetVersion, - string nugetVersionV2, - string? nugetPreReleaseTag, - string? nugetPreReleaseTagV2, - string? versionSourceSha, - string? commitsSinceVersionSource, - string? commitsSinceVersionSourcePadded, - string? uncommittedChanges) - { - Major = major; - Minor = minor; - Patch = patch; - BuildMetaData = buildMetaData; - BuildMetaDataPadded = buildMetaDataPadded; - FullBuildMetaData = fullBuildMetaData; - BranchName = branchName; - EscapedBranchName = escapedBranchName; - Sha = sha; - ShortSha = shortSha; - MajorMinorPatch = majorMinorPatch; - SemVer = semVer; - LegacySemVer = legacySemVer; - LegacySemVerPadded = legacySemVerPadded; - FullSemVer = fullSemVer; - AssemblySemVer = assemblySemVer; - AssemblySemFileVer = assemblySemFileVer; - PreReleaseTag = preReleaseTag; - PreReleaseTagWithDash = preReleaseTagWithDash; - PreReleaseLabel = preReleaseLabel; - PreReleaseLabelWithDash = preReleaseLabelWithDash; - PreReleaseNumber = preReleaseNumber; - WeightedPreReleaseNumber = weightedPreReleaseNumber; - InformationalVersion = informationalVersion; - CommitDate = commitDate; - NuGetVersion = nugetVersion; - NuGetVersionV2 = nugetVersionV2; - NuGetPreReleaseTag = nugetPreReleaseTag; - NuGetPreReleaseTagV2 = nugetPreReleaseTagV2; - VersionSourceSha = versionSourceSha; - CommitsSinceVersionSource = commitsSinceVersionSource; - CommitsSinceVersionSourcePadded = commitsSinceVersionSourcePadded; - UncommittedChanges = uncommittedChanges; - } - - public string Major { get; } - public string Minor { get; } - public string Patch { get; } - public string? PreReleaseTag { get; } - public string? PreReleaseTagWithDash { get; } - public string? PreReleaseLabel { get; } - public string? PreReleaseLabelWithDash { get; } - public string? PreReleaseNumber { get; } - public string WeightedPreReleaseNumber { get; } - public string? BuildMetaData { get; } - public string? BuildMetaDataPadded { get; } - public string? FullBuildMetaData { get; } - public string MajorMinorPatch { get; } - public string SemVer { get; } - public string LegacySemVer { get; } - public string LegacySemVerPadded { get; } - public string? AssemblySemVer { get; } - public string? AssemblySemFileVer { get; } - public string FullSemVer { get; } - public string? InformationalVersion { get; } - public string? BranchName { get; } - public string? EscapedBranchName { get; } - public string? Sha { get; } - public string? ShortSha { get; } - public string NuGetVersionV2 { get; } - public string NuGetVersion { get; } - public string? NuGetPreReleaseTagV2 { get; } - public string? NuGetPreReleaseTag { get; } - public string? VersionSourceSha { get; } - public string? CommitsSinceVersionSource { get; } - public string? CommitsSinceVersionSourcePadded { get; } - public string? UncommittedChanges { get; } - public string? CommitDate { get; set; } - - [ReflectionIgnore] - public static IEnumerable AvailableVariables => typeof(VersionVariables) - .GetProperties() - .Where(p => !p.GetCustomAttributes(typeof(ReflectionIgnoreAttribute), false).Any()) - .Select(p => p.Name) - .OrderBy(a => a, StringComparer.Ordinal); - - [ReflectionIgnore] - public string? FileName { get; set; } - - [ReflectionIgnore] - public string? this[string variable] => typeof(VersionVariables).GetProperty(variable)?.GetValue(this, null) as string; - - public IEnumerator> GetEnumerator() => this.GetProperties().GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - // FIX ME: Shall we return an instance with no ctorArgs or explicitly fail when properties is null? - private static VersionVariables FromDictionary(IEnumerable>? properties) - { - var type = typeof(VersionVariables); - var constructors = type.GetConstructors(); - - var ctor = constructors.Single(); - var ctorArgs = ctor.GetParameters() - .Select(p => properties?.Single(v => string.Equals(v.Key, p.Name, StringComparison.InvariantCultureIgnoreCase)).Value) - .Cast() - .ToArray(); - return (VersionVariables)Activator.CreateInstance(type, ctorArgs); - } - - public static VersionVariables FromJson(string json) - { - var serializeOptions = JsonSerializerOptions(); - var variablePairs = JsonSerializer.Deserialize>(json, serializeOptions); - return FromDictionary(variablePairs); - } - - public static VersionVariables FromFile(string filePath, IFileSystem fileSystem) - { - try - { - var retryAction = new RetryAction(); - return retryAction.Execute(() => FromFileInternal(filePath, fileSystem)); - } - catch (AggregateException ex) - { - var lastException = ex.InnerExceptions.LastOrDefault() ?? ex.InnerException; - if (lastException != null) - { - throw lastException; - } - throw; - } - } - private static VersionVariables FromFileInternal(string filePath, IFileSystem fileSystem) - { - using var stream = fileSystem.OpenRead(filePath); - using var reader = new StreamReader(stream); - var dictionary = new Deserializer().Deserialize>(reader); - var versionVariables = FromDictionary(dictionary); - versionVariables.FileName = filePath; - return versionVariables; - } - - public bool TryGetValue(string variable, out string? variableValue) - { - if (ContainsKey(variable)) - { - variableValue = this[variable]; - return true; - } - - variableValue = null; - return false; - } - - private static bool ContainsKey(string variable) => typeof(VersionVariables).GetProperty(variable) != null; - - public override string ToString() - { - var variablesType = typeof(VersionVariablesJsonModel); - var variables = new VersionVariablesJsonModel(); - - foreach (var (key, value) in this.GetProperties()) - { - variablesType.GetProperty(key)?.SetValue(variables, value); - } - - var serializeOptions = JsonSerializerOptions(); - - return JsonSerializer.Serialize(variables, serializeOptions); - } - - private static JsonSerializerOptions JsonSerializerOptions() - { - var serializeOptions = new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - Converters = { new VersionVariablesJsonStringConverter() } - }; - return serializeOptions; - } -} diff --git a/src/GitVersion.Core/Model/VersionVariablesJsonModel.cs b/src/GitVersion.Core/Model/VersionVariablesJsonModel.cs deleted file mode 100644 index cbb451730b..0000000000 --- a/src/GitVersion.Core/Model/VersionVariablesJsonModel.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Text.Json.Serialization; - -namespace GitVersion.OutputVariables; - -public class VersionVariablesJsonModel -{ - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? Major { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? Minor { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? Patch { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? PreReleaseTag { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? PreReleaseTagWithDash { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? PreReleaseLabel { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? PreReleaseLabelWithDash { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? PreReleaseNumber { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? WeightedPreReleaseNumber { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? BuildMetaData { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? BuildMetaDataPadded { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? FullBuildMetaData { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? MajorMinorPatch { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? SemVer { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? LegacySemVer { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? LegacySemVerPadded { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? AssemblySemVer { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? AssemblySemFileVer { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? FullSemVer { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? InformationalVersion { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? BranchName { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? EscapedBranchName { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? Sha { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? ShortSha { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? NuGetVersionV2 { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? NuGetVersion { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? NuGetPreReleaseTagV2 { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? NuGetPreReleaseTag { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? VersionSourceSha { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? CommitsSinceVersionSource { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? CommitsSinceVersionSourcePadded { get; set; } - [JsonConverter(typeof(VersionVariablesJsonNumberConverter))] - public string? UncommittedChanges { get; set; } - [JsonConverter(typeof(VersionVariablesJsonStringConverter))] - public string? CommitDate { get; set; } -} diff --git a/src/GitVersion.Core/Model/VersionVariablesJsonNumberConverter.cs b/src/GitVersion.Core/Model/VersionVariablesJsonNumberConverter.cs deleted file mode 100644 index 6273f39be9..0000000000 --- a/src/GitVersion.Core/Model/VersionVariablesJsonNumberConverter.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Buffers; -using System.Buffers.Text; -using System.Text.Json; -using System.Text.Json.Serialization; -using GitVersion.Extensions; - -namespace GitVersion.OutputVariables; - -public class VersionVariablesJsonNumberConverter : JsonConverter -{ - public override bool CanConvert(Type typeToConvert) - => typeToConvert == typeof(string); - - public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.Number && typeToConvert == typeof(string)) - return reader.GetString() ?? ""; - - var span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan; - if (Utf8Parser.TryParse(span, out long number, out var bytesConsumed) && span.Length == bytesConsumed) - return number.ToString(); - - var data = reader.GetString(); - - throw new InvalidOperationException($"'{data}' is not a correct expected value!") - { - Source = nameof(VersionVariablesJsonNumberConverter) - }; - } - - public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options) - { - if (value.IsNullOrWhiteSpace()) - { - writer.WriteNullValue(); - } - else if (long.TryParse(value, out var number)) - { - writer.WriteNumberValue(number); - } - else - { - throw new InvalidOperationException($"'{value}' is not a correct expected value!") - { - Source = nameof(VersionVariablesJsonStringConverter) - }; - } - - } - - public override bool HandleNull => true; -} diff --git a/src/GitVersion.Core/Model/WixInfo.cs b/src/GitVersion.Core/Model/WixInfo.cs deleted file mode 100644 index 1ea011b4ed..0000000000 --- a/src/GitVersion.Core/Model/WixInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitVersion; - -public class WixInfo -{ - public bool ShouldUpdate; -} diff --git a/src/GitVersion.Core/Model/AssemblyInfoData.cs b/src/GitVersion.Core/Options/AssemblySettingsInfo.cs similarity index 84% rename from src/GitVersion.Core/Model/AssemblyInfoData.cs rename to src/GitVersion.Core/Options/AssemblySettingsInfo.cs index a3453d10ed..6ebecfc00f 100644 --- a/src/GitVersion.Core/Model/AssemblyInfoData.cs +++ b/src/GitVersion.Core/Options/AssemblySettingsInfo.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public class AssemblyInfoData +public class AssemblySettingsInfo { public bool UpdateAssemblyInfo; public bool UpdateProjectFiles; diff --git a/src/GitVersion.Core/Options/ConfigurationInfo.cs b/src/GitVersion.Core/Options/ConfigurationInfo.cs new file mode 100644 index 0000000000..a7e19756de --- /dev/null +++ b/src/GitVersion.Core/Options/ConfigurationInfo.cs @@ -0,0 +1,8 @@ +namespace GitVersion; + +public record ConfigurationInfo +{ + public string? ConfigurationFile; + public bool ShowConfiguration; + public IReadOnlyDictionary? OverrideConfiguration; +} diff --git a/src/GitVersion.Core/Options/FileWriteInfo.cs b/src/GitVersion.Core/Options/FileWriteInfo.cs new file mode 100644 index 0000000000..7a81b8b411 --- /dev/null +++ b/src/GitVersion.Core/Options/FileWriteInfo.cs @@ -0,0 +1,3 @@ +namespace GitVersion; + +public sealed record FileWriteInfo(string WorkingDirectory, string FileName, string FileExtension); diff --git a/src/GitVersion.Core/Model/GitVersionOptions.cs b/src/GitVersion.Core/Options/GitVersionOptions.cs similarity index 61% rename from src/GitVersion.Core/Model/GitVersionOptions.cs rename to src/GitVersion.Core/Options/GitVersionOptions.cs index b0cba50076..1fc689dbd7 100644 --- a/src/GitVersion.Core/Model/GitVersionOptions.cs +++ b/src/GitVersion.Core/Options/GitVersionOptions.cs @@ -1,26 +1,26 @@ +using GitVersion.Git; using GitVersion.Logging; -using GitVersion.Model; namespace GitVersion; public class GitVersionOptions { - public string WorkingDirectory { get; set; } = System.Environment.CurrentDirectory; + public string WorkingDirectory { get; set; } = SysEnv.CurrentDirectory; + public AssemblySettingsInfo AssemblySettingsInfo { get; } = new(); + public AuthenticationInfo AuthenticationInfo { get; } = new(); - public AssemblyInfoData AssemblyInfo { get; } = new(); - public AuthenticationInfo Authentication { get; } = new(); - public ConfigInfo ConfigInfo { get; } = new(); + public ConfigurationInfo ConfigurationInfo { get; } = new(); public RepositoryInfo RepositoryInfo { get; } = new(); public WixInfo WixInfo { get; } = new(); public Settings Settings { get; } = new(); - public bool Init; public bool Diag; public bool IsVersion; public bool IsHelp; public string? LogFilePath; public string? ShowVariable; + public string? Format; public string? OutputFile; public ISet Output = new HashSet(); public Verbosity Verbosity = Verbosity.Normal; diff --git a/src/GitVersion.Core/Model/OutputType.cs b/src/GitVersion.Core/Options/OutputType.cs similarity index 56% rename from src/GitVersion.Core/Model/OutputType.cs rename to src/GitVersion.Core/Options/OutputType.cs index e7cea06b7d..3ad1b04d94 100644 --- a/src/GitVersion.Core/Model/OutputType.cs +++ b/src/GitVersion.Core/Options/OutputType.cs @@ -1,8 +1,9 @@ -namespace GitVersion.Model; +namespace GitVersion; public enum OutputType { BuildServer, Json, - File + File, + DotEnv } diff --git a/src/GitVersion.Core/Model/RepositoryInfo.cs b/src/GitVersion.Core/Options/RepositoryInfo.cs similarity index 83% rename from src/GitVersion.Core/Model/RepositoryInfo.cs rename to src/GitVersion.Core/Options/RepositoryInfo.cs index bc0991236e..4551ff8e11 100644 --- a/src/GitVersion.Core/Model/RepositoryInfo.cs +++ b/src/GitVersion.Core/Options/RepositoryInfo.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public class RepositoryInfo +public record RepositoryInfo { public string? TargetUrl; public string? TargetBranch; diff --git a/src/GitVersion.Core/Model/Settings.cs b/src/GitVersion.Core/Options/Settings.cs similarity index 71% rename from src/GitVersion.Core/Model/Settings.cs rename to src/GitVersion.Core/Options/Settings.cs index 22b198edc3..cbb9dabc8c 100644 --- a/src/GitVersion.Core/Model/Settings.cs +++ b/src/GitVersion.Core/Options/Settings.cs @@ -1,9 +1,10 @@ namespace GitVersion; -public class Settings +public record Settings { public bool NoFetch; public bool NoCache; public bool NoNormalize; public bool OnlyTrackedBranches = false; + public bool AllowShallow = false; } diff --git a/src/GitVersion.Core/Options/WixInfo.cs b/src/GitVersion.Core/Options/WixInfo.cs new file mode 100644 index 0000000000..8fa95b2851 --- /dev/null +++ b/src/GitVersion.Core/Options/WixInfo.cs @@ -0,0 +1,6 @@ +namespace GitVersion; + +public record WixInfo +{ + public bool UpdateWixVersionFile; +} diff --git a/src/GitVersion.Core/Output/IConverterContext.cs b/src/GitVersion.Core/Output/IConverterContext.cs new file mode 100644 index 0000000000..94283ad5e6 --- /dev/null +++ b/src/GitVersion.Core/Output/IConverterContext.cs @@ -0,0 +1,3 @@ +namespace GitVersion; + +public interface IConverterContext; diff --git a/src/GitVersion.Core/VersionConverters/IVersionConverter.cs b/src/GitVersion.Core/Output/IVersionConverter.cs similarity index 54% rename from src/GitVersion.Core/VersionConverters/IVersionConverter.cs rename to src/GitVersion.Core/Output/IVersionConverter.cs index ff0428d6b8..22fdd9a75d 100644 --- a/src/GitVersion.Core/VersionConverters/IVersionConverter.cs +++ b/src/GitVersion.Core/Output/IVersionConverter.cs @@ -1,8 +1,8 @@ using GitVersion.OutputVariables; -namespace GitVersion.VersionConverters; +namespace GitVersion; public interface IVersionConverter : IDisposable where T : IConverterContext { - public void Execute(VersionVariables variables, T context); + void Execute(GitVersionVariables variables, T context); } diff --git a/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs new file mode 100644 index 0000000000..53a8b55172 --- /dev/null +++ b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs @@ -0,0 +1,97 @@ +namespace GitVersion.OutputVariables; + +public record GitVersionVariables(string Major, + string Minor, + string Patch, + string? BuildMetaData, + string? FullBuildMetaData, + string? BranchName, + string? EscapedBranchName, + string? Sha, + string? ShortSha, + string MajorMinorPatch, + string SemVer, + string FullSemVer, + string? AssemblySemVer, + string? AssemblySemFileVer, + string? PreReleaseTag, + string? PreReleaseTagWithDash, + string? PreReleaseLabel, + string? PreReleaseLabelWithDash, + string? PreReleaseNumber, + string WeightedPreReleaseNumber, + string? InformationalVersion, + string? CommitDate, + string? VersionSourceSha, + string? CommitsSinceVersionSource, + string? UncommittedChanges) : IEnumerable> +{ + internal static readonly List AvailableVariables = + [ + nameof(Major), + nameof(Minor), + nameof(Patch), + nameof(BuildMetaData), + nameof(FullBuildMetaData), + nameof(BranchName), + nameof(EscapedBranchName), + nameof(Sha), + nameof(ShortSha), + nameof(MajorMinorPatch), + nameof(SemVer), + nameof(FullSemVer), + nameof(AssemblySemVer), + nameof(AssemblySemFileVer), + nameof(PreReleaseTag), + nameof(PreReleaseTagWithDash), + nameof(PreReleaseLabel), + nameof(PreReleaseLabelWithDash), + nameof(PreReleaseNumber), + nameof(WeightedPreReleaseNumber), + nameof(InformationalVersion), + nameof(CommitDate), + nameof(VersionSourceSha), + nameof(CommitsSinceVersionSource), + nameof(UncommittedChanges) + ]; + + private Dictionary Instance => new() + { + { nameof(Major), Major }, + { nameof(Minor), Minor }, + { nameof(Patch), Patch }, + { nameof(BuildMetaData), BuildMetaData }, + { nameof(FullBuildMetaData), FullBuildMetaData }, + { nameof(BranchName), BranchName }, + { nameof(EscapedBranchName), EscapedBranchName }, + { nameof(Sha), Sha }, + { nameof(ShortSha), ShortSha }, + { nameof(MajorMinorPatch), MajorMinorPatch }, + { nameof(SemVer), SemVer }, + { nameof(FullSemVer), FullSemVer }, + { nameof(AssemblySemVer), AssemblySemVer }, + { nameof(AssemblySemFileVer), AssemblySemFileVer }, + { nameof(PreReleaseTag), PreReleaseTag }, + { nameof(PreReleaseTagWithDash), PreReleaseTagWithDash }, + { nameof(PreReleaseLabel), PreReleaseLabel }, + { nameof(PreReleaseLabelWithDash), PreReleaseLabelWithDash }, + { nameof(PreReleaseNumber), PreReleaseNumber }, + { nameof(WeightedPreReleaseNumber), WeightedPreReleaseNumber }, + { nameof(InformationalVersion), InformationalVersion }, + { nameof(CommitDate), CommitDate }, + { nameof(VersionSourceSha), VersionSourceSha }, + { nameof(CommitsSinceVersionSource), CommitsSinceVersionSource }, + { nameof(UncommittedChanges), UncommittedChanges } + }; + + public IEnumerator> GetEnumerator() => Instance.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => Instance.GetEnumerator(); + + public bool TryGetValue(string variable, out string? variableValue) + { + if (Instance.TryGetValue(variable, out variableValue)) return true; + variableValue = null; + return false; + } +} diff --git a/src/GitVersion.Core/OutputVariables/IVersionVariableSerializer.cs b/src/GitVersion.Core/OutputVariables/IVersionVariableSerializer.cs new file mode 100644 index 0000000000..2d20579bb9 --- /dev/null +++ b/src/GitVersion.Core/OutputVariables/IVersionVariableSerializer.cs @@ -0,0 +1,8 @@ +namespace GitVersion.OutputVariables; + +public interface IVersionVariableSerializer +{ + string ToJson(GitVersionVariables gitVersionVariables); + GitVersionVariables FromFile(string filePath); + void ToFile(GitVersionVariables gitVersionVariables, string filePath); +} diff --git a/src/GitVersion.Core/PublicAPI.Shipped.txt b/src/GitVersion.Core/PublicAPI.Shipped.txt index 0c9b73897a..dfdedf515b 100644 --- a/src/GitVersion.Core/PublicAPI.Shipped.txt +++ b/src/GitVersion.Core/PublicAPI.Shipped.txt @@ -1,362 +1,335 @@ #nullable enable -abstract GitVersion.BuildAgents.BuildAgentBase.EnvironmentVariable.get -> string! -abstract GitVersion.BuildAgents.BuildAgentBase.GenerateSetParameterMessage(string! name, string! value) -> string![]! -abstract GitVersion.BuildAgents.BuildAgentBase.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.DefaultResult.get -> string? -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -abstract GitVersion.GitVersionModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -abstract GitVersion.VersionCalculation.VersionStrategyBase.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -const GitVersion.BuildAgents.AppVeyor.EnvironmentVariableName = "APPVEYOR" -> string! -const GitVersion.BuildAgents.AzurePipelines.EnvironmentVariableName = "TF_BUILD" -> string! -const GitVersion.BuildAgents.BitBucketPipelines.BranchEnvironmentVariableName = "BITBUCKET_BRANCH" -> string! -const GitVersion.BuildAgents.BitBucketPipelines.EnvironmentVariableName = "BITBUCKET_WORKSPACE" -> string! -const GitVersion.BuildAgents.BitBucketPipelines.PullRequestEnvironmentVariableName = "BITBUCKET_PR_ID" -> string! -const GitVersion.BuildAgents.BitBucketPipelines.TagEnvironmentVariableName = "BITBUCKET_TAG" -> string! -const GitVersion.BuildAgents.BuildKite.EnvironmentVariableName = "BUILDKITE" -> string! -const GitVersion.BuildAgents.CodeBuild.SourceVersionEnvironmentVariableName = "CODEBUILD_SOURCE_VERSION" -> string! -const GitVersion.BuildAgents.CodeBuild.WebHookEnvironmentVariableName = "CODEBUILD_WEBHOOK_HEAD_REF" -> string! -const GitVersion.BuildAgents.ContinuaCi.EnvironmentVariableName = "ContinuaCI.Version" -> string! -const GitVersion.BuildAgents.Drone.EnvironmentVariableName = "DRONE" -> string! -const GitVersion.BuildAgents.EnvRun.EnvironmentVariableName = "ENVRUN_DATABASE" -> string! -const GitVersion.BuildAgents.GitHubActions.EnvironmentVariableName = "GITHUB_ACTIONS" -> string! -const GitVersion.BuildAgents.GitHubActions.GitHubSetEnvTempFileEnvironmentVariableName = "GITHUB_ENV" -> string! -const GitVersion.BuildAgents.GitLabCi.EnvironmentVariableName = "GITLAB_CI" -> string! -const GitVersion.BuildAgents.Jenkins.EnvironmentVariableName = "JENKINS_URL" -> string! -const GitVersion.BuildAgents.MyGet.EnvironmentVariableName = "BuildRunner" -> string! -const GitVersion.BuildAgents.SpaceAutomation.EnvironmentVariableName = "JB_SPACE_PROJECT_KEY" -> string! -const GitVersion.BuildAgents.TeamCity.EnvironmentVariableName = "TEAMCITY_VERSION" -> string! -const GitVersion.BuildAgents.TravisCi.EnvironmentVariableName = "TRAVIS" -> string! -const GitVersion.Configuration.ConfigFileLocator.DefaultFileName = "GitVersion.yml" -> string! -const GitVersion.Model.Configuration.Config.DefaultTagPrefix = "[vV]" -> string! -const GitVersion.Model.Configuration.Config.DevelopBranchKey = "develop" -> string! -const GitVersion.Model.Configuration.Config.DevelopBranchRegex = "^dev(elop)?(ment)?$" -> string! -const GitVersion.Model.Configuration.Config.FeatureBranchKey = "feature" -> string! -const GitVersion.Model.Configuration.Config.FeatureBranchRegex = "^features?[/-]" -> string! -const GitVersion.Model.Configuration.Config.HotfixBranchKey = "hotfix" -> string! -const GitVersion.Model.Configuration.Config.HotfixBranchRegex = "^hotfix(es)?[/-]" -> string! -const GitVersion.Model.Configuration.Config.MainBranchKey = "main" -> string! -const GitVersion.Model.Configuration.Config.MainBranchRegex = "^master$|^main$" -> string! -const GitVersion.Model.Configuration.Config.MasterBranchKey = "master" -> string! -const GitVersion.Model.Configuration.Config.PullRequestBranchKey = "pull-request" -> string! -const GitVersion.Model.Configuration.Config.PullRequestRegex = "^(pull|pull\\-requests|pr)[/-]" -> string! -const GitVersion.Model.Configuration.Config.ReleaseBranchKey = "release" -> string! -const GitVersion.Model.Configuration.Config.ReleaseBranchRegex = "^releases?[/-]" -> string! -const GitVersion.Model.Configuration.Config.SupportBranchKey = "support" -> string! -const GitVersion.Model.Configuration.Config.SupportBranchRegex = "^support[/-]" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultMajorPattern = "\\+semver:\\s?(breaking|major)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultMinorPattern = "\\+semver:\\s?(feature|minor)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultNoBumpPattern = "\\+semver:\\s?(none|skip)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultPatchPattern = "\\+semver:\\s?(fix|patch)" -> string! -const GitVersion.VersionCalculation.MergeMessageVersionStrategy.MergeMessageStrategyPrefix = "Merge message" -> string! -const GitVersion.VersionConverters.WixUpdater.WixVersionFileUpdater.WixVersionFileName = "GitVersion_WixVersion.wxi" -> string! -GitVersion.AssemblyInfoData -GitVersion.AssemblyInfoData.AssemblyInfoData() -> void -GitVersion.AssemblyInfoData.EnsureAssemblyInfo -> bool -GitVersion.AssemblyInfoData.Files -> System.Collections.Generic.ISet! -GitVersion.AssemblyInfoData.UpdateAssemblyInfo -> bool -GitVersion.AssemblyInfoData.UpdateProjectFiles -> bool -GitVersion.AuthenticationInfo -GitVersion.AuthenticationInfo.AuthenticationInfo() -> void -GitVersion.AuthenticationInfo.Password.get -> string? -GitVersion.AuthenticationInfo.Password.set -> void -GitVersion.AuthenticationInfo.Token.get -> string? -GitVersion.AuthenticationInfo.Token.set -> void -GitVersion.AuthenticationInfo.Username.get -> string? -GitVersion.AuthenticationInfo.Username.set -> void -GitVersion.BranchCommit -GitVersion.BranchCommit.Branch.get -> GitVersion.IBranch! -GitVersion.BranchCommit.BranchCommit() -> void -GitVersion.BranchCommit.BranchCommit(GitVersion.ICommit! commit, GitVersion.IBranch! branch) -> void -GitVersion.BranchCommit.Commit.get -> GitVersion.ICommit! -GitVersion.BranchCommit.Equals(GitVersion.BranchCommit? other) -> bool +const GitVersion.Git.ReferenceName.LocalBranchPrefix = "refs/heads/" -> string! +const GitVersion.Git.ReferenceName.RemoteTrackingBranchPrefix = "refs/remotes/" -> string! +GitVersion.Agents.IBuildAgent +GitVersion.Agents.IBuildAgent.CanApplyToCurrentContext() -> bool +GitVersion.Agents.IBuildAgent.GetCurrentBranch(bool usingDynamicRepos) -> string? +GitVersion.Agents.IBuildAgent.IsDefault.get -> bool +GitVersion.Agents.IBuildAgent.PreventFetch() -> bool +GitVersion.Agents.IBuildAgent.ShouldCleanUpRemotes() -> bool +GitVersion.Agents.IBuildAgent.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber = true) -> void +GitVersion.Agents.ICurrentBuildAgent +GitVersion.AssemblySettingsInfo +GitVersion.AssemblySettingsInfo.AssemblySettingsInfo() -> void +GitVersion.AssemblySettingsInfo.EnsureAssemblyInfo -> bool +GitVersion.AssemblySettingsInfo.Files -> System.Collections.Generic.ISet! +GitVersion.AssemblySettingsInfo.UpdateAssemblyInfo -> bool +GitVersion.AssemblySettingsInfo.UpdateProjectFiles -> bool GitVersion.BugException +GitVersion.BugException.BugException() -> void GitVersion.BugException.BugException(string! message) -> void -GitVersion.BuildAgents.AppVeyor -GitVersion.BuildAgents.AppVeyor.AppVeyor(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.AzurePipelines -GitVersion.BuildAgents.AzurePipelines.AzurePipelines(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.BitBucketPipelines -GitVersion.BuildAgents.BitBucketPipelines.BitBucketPipelines(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.BitBucketPipelines.WithPropertyFile(string! propertiesFileName) -> void -GitVersion.BuildAgents.BuildAgentBase -GitVersion.BuildAgents.BuildAgentBase.BuildAgentBase(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.BuildAgentBase.Environment.get -> GitVersion.IEnvironment! -GitVersion.BuildAgents.BuildAgentBase.GenerateBuildLogOutput(GitVersion.OutputVariables.VersionVariables! variables) -> System.Collections.Generic.IEnumerable! -GitVersion.BuildAgents.BuildAgentResolver -GitVersion.BuildAgents.BuildAgentResolver.BuildAgentResolver(System.Collections.Generic.IEnumerable! buildAgents, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.BuildAgentResolver.Resolve() -> GitVersion.BuildAgents.ICurrentBuildAgent! -GitVersion.BuildAgents.BuildKite -GitVersion.BuildAgents.BuildKite.BuildKite(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.BuildServerModule -GitVersion.BuildAgents.BuildServerModule.BuildServerModule() -> void -GitVersion.BuildAgents.CodeBuild -GitVersion.BuildAgents.CodeBuild.CodeBuild(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.CodeBuild.WithPropertyFile(string! propertiesFileName) -> void -GitVersion.BuildAgents.ContinuaCi -GitVersion.BuildAgents.ContinuaCi.ContinuaCi(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.Drone -GitVersion.BuildAgents.Drone.Drone(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.EnvRun -GitVersion.BuildAgents.EnvRun.EnvRun(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.GitHubActions -GitVersion.BuildAgents.GitHubActions.GitHubActions(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.GitLabCi -GitVersion.BuildAgents.GitLabCi.GitLabCi(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.GitLabCi.WithPropertyFile(string! propertiesFileName) -> void -GitVersion.BuildAgents.IBuildAgent -GitVersion.BuildAgents.IBuildAgent.CanApplyToCurrentContext() -> bool -GitVersion.BuildAgents.IBuildAgent.GetCurrentBranch(bool usingDynamicRepos) -> string? -GitVersion.BuildAgents.IBuildAgent.PreventFetch() -> bool -GitVersion.BuildAgents.IBuildAgent.ShouldCleanUpRemotes() -> bool -GitVersion.BuildAgents.IBuildAgent.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -GitVersion.BuildAgents.IBuildAgentResolver -GitVersion.BuildAgents.IBuildAgentResolver.Resolve() -> GitVersion.BuildAgents.ICurrentBuildAgent! -GitVersion.BuildAgents.ICurrentBuildAgent -GitVersion.BuildAgents.Jenkins -GitVersion.BuildAgents.Jenkins.Jenkins(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.Jenkins.WithPropertyFile(string! propertiesFileName) -> void -GitVersion.BuildAgents.LocalBuild -GitVersion.BuildAgents.LocalBuild.LocalBuild(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.MyGet -GitVersion.BuildAgents.MyGet.MyGet(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.SpaceAutomation -GitVersion.BuildAgents.SpaceAutomation.SpaceAutomation(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.TeamCity -GitVersion.BuildAgents.TeamCity.TeamCity(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.BuildAgents.TravisCi -GitVersion.BuildAgents.TravisCi.TravisCi(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void -GitVersion.Cache.GitVersionCacheKey -GitVersion.Cache.GitVersionCacheKey.GitVersionCacheKey(string! value) -> void -GitVersion.Cache.GitVersionCacheKey.Value.get -> string! -GitVersion.CommitFilter -GitVersion.CommitFilter.CommitFilter() -> void -GitVersion.CommitFilter.ExcludeReachableFrom.get -> object? -GitVersion.CommitFilter.ExcludeReachableFrom.set -> void -GitVersion.CommitFilter.FirstParentOnly.get -> bool -GitVersion.CommitFilter.FirstParentOnly.set -> void -GitVersion.CommitFilter.IncludeReachableFrom.get -> object? -GitVersion.CommitFilter.IncludeReachableFrom.set -> void -GitVersion.CommitFilter.SortBy.get -> GitVersion.CommitSortStrategies -GitVersion.CommitFilter.SortBy.set -> void -GitVersion.CommitSortStrategies -GitVersion.CommitSortStrategies.None = 0 -> GitVersion.CommitSortStrategies -GitVersion.CommitSortStrategies.Reverse = 4 -> GitVersion.CommitSortStrategies -GitVersion.CommitSortStrategies.Time = 2 -> GitVersion.CommitSortStrategies -GitVersion.CommitSortStrategies.Topological = 1 -> GitVersion.CommitSortStrategies +GitVersion.BugException.BugException(string? message, System.Exception? innerException) -> void GitVersion.Common.IRepositoryStore -GitVersion.Common.IRepositoryStore.ExcludingBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.FindBranch(string? branchName) -> GitVersion.IBranch? -GitVersion.Common.IRepositoryStore.FindCommitBranchWasBranchedFrom(GitVersion.IBranch? branch, GitVersion.Model.Configuration.Config! configuration, params GitVersion.IBranch![]! excludedBranches) -> GitVersion.BranchCommit -GitVersion.Common.IRepositoryStore.FindMainBranch(GitVersion.Model.Configuration.Config! configuration) -> GitVersion.IBranch? -GitVersion.Common.IRepositoryStore.FindMergeBase(GitVersion.IBranch? branch, GitVersion.IBranch? otherBranch) -> GitVersion.ICommit? -GitVersion.Common.IRepositoryStore.FindMergeBase(GitVersion.ICommit! commit, GitVersion.ICommit! mainlineTip) -> GitVersion.ICommit? -GitVersion.Common.IRepositoryStore.GetBaseVersionSource(GitVersion.ICommit! currentBranchTip) -> GitVersion.ICommit! -GitVersion.Common.IRepositoryStore.GetBranchesContainingCommit(GitVersion.ICommit? commit, System.Collections.Generic.IEnumerable? branches = null, bool onlyTrackedBranches = false) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetBranchesForCommit(GitVersion.ICommit! commit) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetChosenBranch(GitVersion.Model.Configuration.Config! configuration) -> GitVersion.IBranch? -GitVersion.Common.IRepositoryStore.GetCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? currentCommit) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetCurrentCommit(GitVersion.IBranch! currentBranch, string? commitId) -> GitVersion.ICommit? -GitVersion.Common.IRepositoryStore.GetCurrentCommitTaggedVersion(GitVersion.ICommit? commit, string? tagPrefix, bool handleDetachedBranch) -> GitVersion.SemanticVersion! -GitVersion.Common.IRepositoryStore.GetExcludedInheritBranches(GitVersion.Model.Configuration.Config! configuration) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetMainlineBranches(GitVersion.ICommit! commit, GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IEnumerable>? mainlineBranchConfigs) -> System.Collections.Generic.IDictionary!>! -GitVersion.Common.IRepositoryStore.GetMainlineCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? mainlineTip) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetMergeBaseCommits(GitVersion.ICommit? mergeCommit, GitVersion.ICommit? mergedHead, GitVersion.ICommit? findMergeBase) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetNumberOfUncommittedChanges() -> int -GitVersion.Common.IRepositoryStore.GetReleaseBranches(System.Collections.Generic.IEnumerable>! releaseBranchConfig) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.IBranch! -GitVersion.Common.IRepositoryStore.GetValidVersionTags(string? tagPrefixRegex, System.DateTimeOffset? olderThan = null) -> System.Collections.Generic.IEnumerable<(GitVersion.ITag! Tag, GitVersion.SemanticVersion! Semver, GitVersion.ICommit! Commit)>! -GitVersion.Common.IRepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? tagPrefixRegex) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool -GitVersion.ConfigInfo -GitVersion.ConfigInfo.ConfigFile -> string? -GitVersion.ConfigInfo.ConfigInfo() -> void -GitVersion.ConfigInfo.OverrideConfig -> GitVersion.Model.Configuration.Config? -GitVersion.ConfigInfo.ShowConfig -> bool -GitVersion.Configuration.BranchConfigurationCalculator -GitVersion.Configuration.BranchConfigurationCalculator.BranchConfigurationCalculator(GitVersion.Logging.ILog! log, GitVersion.Common.IRepositoryStore! repositoryStore) -> void -GitVersion.Configuration.BranchConfigurationCalculator.GetBranchConfiguration(GitVersion.IBranch! targetBranch, GitVersion.ICommit? currentCommit, GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IList? excludedInheritBranches = null) -> GitVersion.Model.Configuration.BranchConfig! -GitVersion.Configuration.ConfigExtensions -GitVersion.Configuration.ConfigFileLocator -GitVersion.Configuration.ConfigFileLocator.ConfigFileLocator(GitVersion.IFileSystem! fileSystem, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.Configuration.ConfigFileLocator.FilePath.get -> string! -GitVersion.Configuration.ConfigFileLocator.GetConfigFilePath(string? workingDirectory) -> string? -GitVersion.Configuration.ConfigFileLocator.HasConfigFileAt(string! workingDirectory) -> bool -GitVersion.Configuration.ConfigFileLocator.ReadConfig(string! workingDirectory) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.ConfigFileLocator.SelectConfigFilePath(GitVersion.GitVersionOptions! gitVersionOptions, GitVersion.IGitRepositoryInfo! repositoryInfo) -> string? -GitVersion.Configuration.ConfigFileLocator.Verify(GitVersion.GitVersionOptions! gitVersionOptions, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.Configuration.ConfigFileLocator.Verify(string? workingDirectory, string? projectRootDirectory) -> void -GitVersion.Configuration.ConfigProvider -GitVersion.Configuration.ConfigProvider.ConfigProvider(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.IConfigFileLocator! configFileLocator, Microsoft.Extensions.Options.IOptions! options, GitVersion.Configuration.Init.Wizard.IConfigInitWizard! configInitWizard, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.Configuration.ConfigProvider.Init(string! workingDirectory) -> void -GitVersion.Configuration.ConfigProvider.Provide(GitVersion.Model.Configuration.Config? overrideConfig = null) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.ConfigProvider.Provide(string? workingDirectory, GitVersion.Model.Configuration.Config? overrideConfig = null) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.ConfigSerializer -GitVersion.Configuration.ConfigSerializer.ConfigSerializer() -> void -GitVersion.Configuration.ConfigurationBuilder -GitVersion.Configuration.ConfigurationBuilder.Add(GitVersion.Model.Configuration.Config! config) -> GitVersion.Configuration.ConfigurationBuilder! -GitVersion.Configuration.ConfigurationBuilder.Build() -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.ConfigurationBuilder.ConfigurationBuilder() -> void -GitVersion.Configuration.ConfigurationException -GitVersion.Configuration.ConfigurationException.ConfigurationException(string! msg) -> void -GitVersion.Configuration.ConfigurationModule -GitVersion.Configuration.ConfigurationModule.ConfigurationModule() -> void -GitVersion.Configuration.ConfigurationModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.Configuration.IBranchConfigurationCalculator -GitVersion.Configuration.IBranchConfigurationCalculator.GetBranchConfiguration(GitVersion.IBranch! targetBranch, GitVersion.ICommit? currentCommit, GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IList? excludedInheritBranches = null) -> GitVersion.Model.Configuration.BranchConfig! -GitVersion.Configuration.IConfigFileLocator -GitVersion.Configuration.IConfigFileLocator.FilePath.get -> string! -GitVersion.Configuration.IConfigFileLocator.GetConfigFilePath(string! workingDirectory) -> string? -GitVersion.Configuration.IConfigFileLocator.HasConfigFileAt(string! workingDirectory) -> bool -GitVersion.Configuration.IConfigFileLocator.ReadConfig(string! workingDirectory) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.IConfigFileLocator.SelectConfigFilePath(GitVersion.GitVersionOptions! gitVersionOptions, GitVersion.IGitRepositoryInfo! repositoryInfo) -> string? -GitVersion.Configuration.IConfigFileLocator.Verify(GitVersion.GitVersionOptions! gitVersionOptions, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.Configuration.IConfigFileLocator.Verify(string! workingDirectory, string! projectRootDirectory) -> void -GitVersion.Configuration.IConfigProvider -GitVersion.Configuration.IConfigProvider.Init(string! workingDirectory) -> void -GitVersion.Configuration.IConfigProvider.Provide(GitVersion.Model.Configuration.Config? overrideConfig = null) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.IConfigProvider.Provide(string! workingDirectory, GitVersion.Model.Configuration.Config? overrideConfig = null) -> GitVersion.Model.Configuration.Config! -GitVersion.Configuration.Init.EditConfigStep -GitVersion.Configuration.Init.EditConfigStep.EditConfigStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.GitVersionInitModule -GitVersion.Configuration.Init.GitVersionInitModule.GitVersionInitModule() -> void -GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting -GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.AssemblyVersioningSchemeSetting(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.ConfigureBranch -GitVersion.Configuration.Init.SetConfig.ConfigureBranch.ConfigureBranch(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.ConfigureBranch.WithData(string! configName, GitVersion.Model.Configuration.BranchConfig! config) -> GitVersion.Configuration.Init.SetConfig.ConfigureBranch! -GitVersion.Configuration.Init.SetConfig.ConfigureBranches -GitVersion.Configuration.Init.SetConfig.ConfigureBranches.ConfigureBranches(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.GlobalModeSetting(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.WithData(GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep! returnStep, bool isPartOfTheWizard) -> GitVersion.Configuration.Init.SetConfig.GlobalModeSetting! -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.SetBranchIncrementMode(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.WithData(string! configName, GitVersion.Model.Configuration.BranchConfig! config) -> GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode! -GitVersion.Configuration.Init.SetConfig.SetBranchTag -GitVersion.Configuration.Init.SetConfig.SetBranchTag.SetBranchTag(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.SetBranchTag.WithData(string! configName, GitVersion.Model.Configuration.BranchConfig! config) -> GitVersion.Configuration.Init.SetConfig.SetBranchTag! -GitVersion.Configuration.Init.SetNextVersion -GitVersion.Configuration.Init.SetNextVersion.SetNextVersion(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.StepResult -GitVersion.Configuration.Init.StepResult.Exit.get -> bool -GitVersion.Configuration.Init.StepResult.InvalidResponse.get -> bool -GitVersion.Configuration.Init.StepResult.Save.get -> bool -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.ConfigInitStepFactory() -> void -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.ConfigInitStepFactory(System.IServiceProvider! sp) -> void -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.CreateStep() -> T -GitVersion.Configuration.Init.Wizard.ConfigInitWizard -GitVersion.Configuration.Init.Wizard.ConfigInitWizard.ConfigInitWizard(GitVersion.Logging.IConsole! console, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.ConfigInitWizard.Run(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Model.Configuration.Config? -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Apply(System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> bool -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.ConfigInitWizardStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.FinishedSetupStep -GitVersion.Configuration.Init.Wizard.FinishedSetupStep.FinishedSetupStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.GitFlowSetupStep -GitVersion.Configuration.Init.Wizard.GitFlowSetupStep.GitFlowSetupStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.GitHubFlowStep -GitVersion.Configuration.Init.Wizard.GitHubFlowStep.GitHubFlowStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory -GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory.CreateStep() -> T -GitVersion.Configuration.Init.Wizard.IConfigInitWizard -GitVersion.Configuration.Init.Wizard.IConfigInitWizard.Run(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Model.Configuration.Config? -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.PickBranchingStrategy1Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.PickBranchingStrategy2Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.PickBranchingStrategy3Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep -GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.PickBranchingStrategyStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Environment -GitVersion.Environment.Environment() -> void -GitVersion.Environment.GetEnvironmentVariable(string! variableName) -> string? -GitVersion.Environment.SetEnvironmentVariable(string! variableName, string? value) -> void -GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyFileVersioningScheme.Major = 3 -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyFileVersioningScheme.MajorMinor = 2 -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyFileVersioningScheme.MajorMinorPatch = 1 -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyFileVersioningScheme.MajorMinorPatchTag = 0 -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyFileVersioningScheme.None = 4 -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme.Major = 3 -> GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme.MajorMinor = 2 -> GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme.MajorMinorPatch = 1 -> GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme.MajorMinorPatchTag = 0 -> GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Extensions.AssemblyVersioningScheme.None = 4 -> GitVersion.Extensions.AssemblyVersioningScheme +GitVersion.Common.IRepositoryStore.Branches.get -> GitVersion.Git.IBranchCollection! +GitVersion.Common.IRepositoryStore.ExcludingBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.FindBranch(GitVersion.Git.ReferenceName! branchName) -> GitVersion.Git.IBranch? +GitVersion.Common.IRepositoryStore.FindCommitBranchesBranchedFrom(GitVersion.Git.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.Git.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.FindMergeBase(GitVersion.Git.IBranch? branch, GitVersion.Git.IBranch? otherBranch) -> GitVersion.Git.ICommit? +GitVersion.Common.IRepositoryStore.FindMergeBase(GitVersion.Git.ICommit! commit, GitVersion.Git.ICommit! mainlineTip) -> GitVersion.Git.ICommit? +GitVersion.Common.IRepositoryStore.GetBranchesContainingCommit(GitVersion.Git.ICommit! commit, System.Collections.Generic.IEnumerable? branches = null, bool onlyTrackedBranches = false) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.GetCommitLog(GitVersion.Git.ICommit? baseVersionSource, GitVersion.Git.ICommit! currentCommit, GitVersion.Configuration.IIgnoreConfiguration! ignore) -> System.Collections.Generic.IReadOnlyList! +GitVersion.Common.IRepositoryStore.GetCommitsReacheableFromHead(GitVersion.Git.ICommit? headCommit, GitVersion.Configuration.IIgnoreConfiguration! ignore) -> System.Collections.Generic.IReadOnlyList! +GitVersion.Common.IRepositoryStore.GetCurrentCommit(GitVersion.Git.IBranch! currentBranch, string? commitId, GitVersion.Configuration.IIgnoreConfiguration! ignore) -> GitVersion.Git.ICommit? +GitVersion.Common.IRepositoryStore.GetForwardMerge(GitVersion.Git.ICommit? commitToFindCommonBase, GitVersion.Git.ICommit? findMergeBase) -> GitVersion.Git.ICommit? +GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.Git.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.Git.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.Git.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.Git.IBranch! +GitVersion.Common.IRepositoryStore.Head.get -> GitVersion.Git.IBranch! +GitVersion.Common.IRepositoryStore.IsCommitOnBranch(GitVersion.Git.ICommit? baseVersionSource, GitVersion.Git.IBranch! branch, GitVersion.Git.ICommit! firstMatchingCommit) -> bool +GitVersion.Common.IRepositoryStore.Tags.get -> GitVersion.Git.ITagCollection! +GitVersion.Common.IRepositoryStore.UncommittedChangesCount.get -> int +GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyFileVersioningScheme.Major = 3 -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyFileVersioningScheme.MajorMinor = 2 -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyFileVersioningScheme.MajorMinorPatch = 1 -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyFileVersioningScheme.MajorMinorPatchTag = 0 -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyFileVersioningScheme.None = 4 -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme.Major = 3 -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme.MajorMinor = 2 -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme.MajorMinorPatch = 1 -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme.MajorMinorPatchTag = 0 -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.AssemblyVersioningScheme.None = 4 -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.EffectiveBranchConfiguration +GitVersion.Configuration.EffectiveBranchConfiguration.Branch.get -> GitVersion.Git.IBranch! +GitVersion.Configuration.EffectiveBranchConfiguration.Deconstruct(out GitVersion.Configuration.EffectiveConfiguration! Value, out GitVersion.Git.IBranch! Branch) -> void +GitVersion.Configuration.EffectiveBranchConfiguration.EffectiveBranchConfiguration(GitVersion.Configuration.EffectiveBranchConfiguration! original) -> void +GitVersion.Configuration.EffectiveBranchConfiguration.EffectiveBranchConfiguration(GitVersion.Configuration.EffectiveConfiguration! Value, GitVersion.Git.IBranch! Branch) -> void +GitVersion.Configuration.EffectiveBranchConfiguration.Value.get -> GitVersion.Configuration.EffectiveConfiguration! +GitVersion.Configuration.EffectiveConfiguration +GitVersion.Configuration.EffectiveConfiguration.AssemblyFileVersioningFormat.get -> string? +GitVersion.Configuration.EffectiveConfiguration.AssemblyFileVersioningScheme.get -> GitVersion.Configuration.AssemblyFileVersioningScheme +GitVersion.Configuration.EffectiveConfiguration.AssemblyInformationalFormat.get -> string? +GitVersion.Configuration.EffectiveConfiguration.AssemblyVersioningFormat.get -> string? +GitVersion.Configuration.EffectiveConfiguration.AssemblyVersioningScheme.get -> GitVersion.Configuration.AssemblyVersioningScheme +GitVersion.Configuration.EffectiveConfiguration.CommitDateFormat.get -> string? +GitVersion.Configuration.EffectiveConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode +GitVersion.Configuration.EffectiveConfiguration.DeploymentMode.get -> GitVersion.VersionCalculation.DeploymentMode +GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Configuration.EffectiveConfiguration! original) -> void +GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.Configuration.IBranchConfiguration! branchConfiguration, GitVersion.Configuration.EffectiveConfiguration? fallbackConfiguration = null) -> void +GitVersion.Configuration.EffectiveConfiguration.Ignore.get -> GitVersion.Configuration.IIgnoreConfiguration! +GitVersion.Configuration.EffectiveConfiguration.Increment.get -> GitVersion.IncrementStrategy +GitVersion.Configuration.EffectiveConfiguration.IsMainBranch.get -> bool +GitVersion.Configuration.EffectiveConfiguration.IsReleaseBranch.get -> bool +GitVersion.Configuration.EffectiveConfiguration.Label.get -> string? +GitVersion.Configuration.EffectiveConfiguration.MajorVersionBumpMessage.get -> string? +GitVersion.Configuration.EffectiveConfiguration.MinorVersionBumpMessage.get -> string? +GitVersion.Configuration.EffectiveConfiguration.NextVersion.get -> string? +GitVersion.Configuration.EffectiveConfiguration.NoBumpMessage.get -> string? +GitVersion.Configuration.EffectiveConfiguration.PatchVersionBumpMessage.get -> string? +GitVersion.Configuration.EffectiveConfiguration.PreReleaseWeight.get -> int +GitVersion.Configuration.EffectiveConfiguration.PreventIncrementOfMergedBranch.get -> bool +GitVersion.Configuration.EffectiveConfiguration.PreventIncrementWhenBranchMerged.get -> bool +GitVersion.Configuration.EffectiveConfiguration.PreventIncrementWhenCurrentCommitTagged.get -> bool +GitVersion.Configuration.EffectiveConfiguration.RegularExpression.get -> string? +GitVersion.Configuration.EffectiveConfiguration.SemanticVersionFormat.get -> GitVersion.SemanticVersionFormat +GitVersion.Configuration.EffectiveConfiguration.TagPrefix.get -> string? +GitVersion.Configuration.EffectiveConfiguration.TagPreReleaseWeight.get -> int +GitVersion.Configuration.EffectiveConfiguration.TrackMergeMessage.get -> bool +GitVersion.Configuration.EffectiveConfiguration.TrackMergeTarget.get -> bool +GitVersion.Configuration.EffectiveConfiguration.TracksReleaseBranches.get -> bool +GitVersion.Configuration.EffectiveConfiguration.UpdateBuildNumber.get -> bool +GitVersion.Configuration.EffectiveConfiguration.VersionInBranchPattern.get -> string? +GitVersion.Configuration.EffectiveConfiguration.VersionStrategy.get -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.Configuration.IBranchConfiguration +GitVersion.Configuration.IBranchConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode? +GitVersion.Configuration.IBranchConfiguration.DeploymentMode.get -> GitVersion.VersionCalculation.DeploymentMode? +GitVersion.Configuration.IBranchConfiguration.Increment.get -> GitVersion.IncrementStrategy +GitVersion.Configuration.IBranchConfiguration.Inherit(GitVersion.Configuration.EffectiveConfiguration! configuration) -> GitVersion.Configuration.IBranchConfiguration! +GitVersion.Configuration.IBranchConfiguration.Inherit(GitVersion.Configuration.IBranchConfiguration! configuration) -> GitVersion.Configuration.IBranchConfiguration! +GitVersion.Configuration.IBranchConfiguration.IsMainBranch.get -> bool? +GitVersion.Configuration.IBranchConfiguration.IsMatch(string! branchName) -> bool +GitVersion.Configuration.IBranchConfiguration.IsReleaseBranch.get -> bool? +GitVersion.Configuration.IBranchConfiguration.IsSourceBranchFor.get -> System.Collections.Generic.IReadOnlyCollection! +GitVersion.Configuration.IBranchConfiguration.Label.get -> string? +GitVersion.Configuration.IBranchConfiguration.PreReleaseWeight.get -> int? +GitVersion.Configuration.IBranchConfiguration.PreventIncrement.get -> GitVersion.Configuration.IPreventIncrementConfiguration! +GitVersion.Configuration.IBranchConfiguration.RegularExpression.get -> string? +GitVersion.Configuration.IBranchConfiguration.SourceBranches.get -> System.Collections.Generic.IReadOnlyCollection! +GitVersion.Configuration.IBranchConfiguration.TrackMergeMessage.get -> bool? +GitVersion.Configuration.IBranchConfiguration.TrackMergeTarget.get -> bool? +GitVersion.Configuration.IBranchConfiguration.TracksReleaseBranches.get -> bool? +GitVersion.Configuration.IConfigurationBuilder +GitVersion.Configuration.IConfigurationBuilder.AddOverride(System.Collections.Generic.IReadOnlyDictionary! value) -> void +GitVersion.Configuration.IConfigurationBuilder.Build() -> GitVersion.Configuration.IGitVersionConfiguration! +GitVersion.Configuration.IConfigurationFileLocator +GitVersion.Configuration.IConfigurationFileLocator.GetConfigurationFile(string? directoryPath) -> string? +GitVersion.Configuration.IConfigurationFileLocator.Verify(string? workingDirectory, string? projectRootDirectory) -> void +GitVersion.Configuration.IConfigurationProvider +GitVersion.Configuration.IConfigurationProvider.Provide(System.Collections.Generic.IReadOnlyDictionary? overrideConfiguration = null) -> GitVersion.Configuration.IGitVersionConfiguration! +GitVersion.Configuration.IGitVersionConfiguration +GitVersion.Configuration.IGitVersionConfiguration.AssemblyFileVersioningFormat.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.AssemblyFileVersioningScheme.get -> GitVersion.Configuration.AssemblyFileVersioningScheme? +GitVersion.Configuration.IGitVersionConfiguration.AssemblyInformationalFormat.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.AssemblyVersioningFormat.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.AssemblyVersioningScheme.get -> GitVersion.Configuration.AssemblyVersioningScheme? +GitVersion.Configuration.IGitVersionConfiguration.Branches.get -> System.Collections.Generic.IReadOnlyDictionary! +GitVersion.Configuration.IGitVersionConfiguration.CommitDateFormat.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.GetEmptyBranchConfiguration() -> GitVersion.Configuration.IBranchConfiguration! +GitVersion.Configuration.IGitVersionConfiguration.Ignore.get -> GitVersion.Configuration.IIgnoreConfiguration! +GitVersion.Configuration.IGitVersionConfiguration.MajorVersionBumpMessage.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.MergeMessageFormats.get -> System.Collections.Generic.IReadOnlyDictionary! +GitVersion.Configuration.IGitVersionConfiguration.MinorVersionBumpMessage.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.NextVersion.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.NoBumpMessage.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.PatchVersionBumpMessage.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.SemanticVersionFormat.get -> GitVersion.SemanticVersionFormat +GitVersion.Configuration.IGitVersionConfiguration.TagPrefixPattern.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.TagPreReleaseWeight.get -> int? +GitVersion.Configuration.IGitVersionConfiguration.UpdateBuildNumber.get -> bool +GitVersion.Configuration.IGitVersionConfiguration.VersionInBranchPattern.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.VersionStrategy.get -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.Configuration.IGitVersionConfiguration.Workflow.get -> string? +GitVersion.Configuration.IIgnoreConfiguration +GitVersion.Configuration.IIgnoreConfiguration.Before.get -> System.DateTimeOffset? +GitVersion.Configuration.IIgnoreConfiguration.IsEmpty.get -> bool +GitVersion.Configuration.IIgnoreConfiguration.Paths.get -> System.Collections.Generic.IReadOnlyCollection! +GitVersion.Configuration.IIgnoreConfiguration.Shas.get -> System.Collections.Generic.IReadOnlySet! +GitVersion.Configuration.IPreventIncrementConfiguration +GitVersion.Configuration.IPreventIncrementConfiguration.OfMergedBranch.get -> bool? +GitVersion.Configuration.IPreventIncrementConfiguration.WhenBranchMerged.get -> bool? +GitVersion.Configuration.IPreventIncrementConfiguration.WhenCurrentCommitTagged.get -> bool? +GitVersion.Configuration.ReferenceNameExtensions +GitVersion.ConfigurationInfo +GitVersion.ConfigurationInfo.ConfigurationFile -> string? +GitVersion.ConfigurationInfo.ConfigurationInfo() -> void +GitVersion.ConfigurationInfo.ConfigurationInfo(GitVersion.ConfigurationInfo! original) -> void +GitVersion.ConfigurationInfo.OverrideConfiguration -> System.Collections.Generic.IReadOnlyDictionary? +GitVersion.ConfigurationInfo.ShowConfiguration -> bool GitVersion.Extensions.AssemblyVersionsGeneratorExtensions GitVersion.Extensions.CommonExtensions -GitVersion.Extensions.DictionaryExtensions GitVersion.Extensions.EnumerableExtensions +GitVersion.Extensions.FileSystemExtensions GitVersion.Extensions.GitExtensions -GitVersion.Extensions.ObjectExtensions +GitVersion.Extensions.IncrementStrategyExtensions GitVersion.Extensions.ReadEmbeddedResourceExtensions GitVersion.Extensions.ServiceCollectionExtensions GitVersion.Extensions.StringExtensions -GitVersion.FileSystem -GitVersion.FileSystem.Copy(string! from, string! to, bool overwrite) -> void -GitVersion.FileSystem.CreateDirectory(string! path) -> void -GitVersion.FileSystem.Delete(string! path) -> void -GitVersion.FileSystem.DirectoryEnumerateFiles(string? directory, string! searchPattern, System.IO.SearchOption searchOption) -> System.Collections.Generic.IEnumerable! -GitVersion.FileSystem.DirectoryExists(string! path) -> bool -GitVersion.FileSystem.Exists(string! file) -> bool -GitVersion.FileSystem.FileSystem() -> void -GitVersion.FileSystem.GetLastDirectoryWrite(string! path) -> long -GitVersion.FileSystem.Move(string! from, string! to) -> void -GitVersion.FileSystem.OpenRead(string! path) -> System.IO.Stream! -GitVersion.FileSystem.OpenWrite(string! path) -> System.IO.Stream! -GitVersion.FileSystem.PathsEqual(string? path, string? otherPath) -> bool -GitVersion.FileSystem.ReadAllText(string! path) -> string! -GitVersion.FileSystem.WriteAllText(string? file, string! fileContents) -> void -GitVersion.FileSystem.WriteAllText(string? file, string! fileContents, System.Text.Encoding! encoding) -> void GitVersion.FileWriteInfo +GitVersion.FileWriteInfo.$() -> GitVersion.FileWriteInfo! +GitVersion.FileWriteInfo.Deconstruct(out string! WorkingDirectory, out string! FileName, out string! FileExtension) -> void +GitVersion.FileWriteInfo.Equals(GitVersion.FileWriteInfo? other) -> bool GitVersion.FileWriteInfo.FileExtension.get -> string! +GitVersion.FileWriteInfo.FileExtension.init -> void GitVersion.FileWriteInfo.FileName.get -> string! -GitVersion.FileWriteInfo.FileWriteInfo(string! workingDirectory, string! fileName, string! fileExtension) -> void +GitVersion.FileWriteInfo.FileName.init -> void +GitVersion.FileWriteInfo.FileWriteInfo(string! WorkingDirectory, string! FileName, string! FileExtension) -> void GitVersion.FileWriteInfo.WorkingDirectory.get -> string! -GitVersion.GitPreparer -GitVersion.GitPreparer.EnsureLocalBranchExistsForCurrentBranch(GitVersion.IRemote? remote, string? currentBranch) -> void -GitVersion.GitPreparer.GitPreparer(GitVersion.Logging.ILog! log, GitVersion.IEnvironment! environment, GitVersion.BuildAgents.ICurrentBuildAgent! buildAgent, Microsoft.Extensions.Options.IOptions! options, GitVersion.IMutatingGitRepository! repository, GitVersion.IGitRepositoryInfo! repositoryInfo, System.Lazy! versionContext) -> void -GitVersion.GitPreparer.Prepare() -> void -GitVersion.GitToolsException -GitVersion.GitToolsException.GitToolsException(string! message, System.Exception! innerException) -> void -GitVersion.GitToolsException.GitToolsException(string! messageFormat, params object![]! args) -> void -GitVersion.GitVersionCalculateTool -GitVersion.GitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.VersionVariables! -GitVersion.GitVersionCalculateTool.GitVersionCalculateTool(GitVersion.Logging.ILog! log, GitVersion.VersionCalculation.INextVersionCalculator! nextVersionCalculator, GitVersion.VersionCalculation.IVariableProvider! variableProvider, GitVersion.IGitPreparer! gitPreparer, GitVersion.VersionCalculation.Cache.IGitVersionCache! gitVersionCache, GitVersion.VersionCalculation.Cache.IGitVersionCacheKeyFactory! cacheKeyFactory, Microsoft.Extensions.Options.IOptions! options, System.Lazy! versionContext) -> void +GitVersion.FileWriteInfo.WorkingDirectory.init -> void +GitVersion.Git.AuthenticationInfo +GitVersion.Git.AuthenticationInfo.AuthenticationInfo() -> void +GitVersion.Git.AuthenticationInfo.AuthenticationInfo(GitVersion.Git.AuthenticationInfo! original) -> void +GitVersion.Git.AuthenticationInfo.Password.get -> string? +GitVersion.Git.AuthenticationInfo.Password.set -> void +GitVersion.Git.AuthenticationInfo.Token.get -> string? +GitVersion.Git.AuthenticationInfo.Token.set -> void +GitVersion.Git.AuthenticationInfo.Username.get -> string? +GitVersion.Git.AuthenticationInfo.Username.set -> void +GitVersion.Git.BranchCommit +GitVersion.Git.BranchCommit.Branch.get -> GitVersion.Git.IBranch! +GitVersion.Git.BranchCommit.BranchCommit() -> void +GitVersion.Git.BranchCommit.BranchCommit(GitVersion.Git.ICommit! commit, GitVersion.Git.IBranch! branch) -> void +GitVersion.Git.BranchCommit.Commit.get -> GitVersion.Git.ICommit! +GitVersion.Git.BranchCommit.Equals(GitVersion.Git.BranchCommit? other) -> bool +GitVersion.Git.CommitExtensions +GitVersion.Git.CommitFilter +GitVersion.Git.CommitFilter.CommitFilter() -> void +GitVersion.Git.CommitFilter.CommitFilter(GitVersion.Git.CommitFilter! original) -> void +GitVersion.Git.CommitFilter.ExcludeReachableFrom.get -> object? +GitVersion.Git.CommitFilter.ExcludeReachableFrom.init -> void +GitVersion.Git.CommitFilter.FirstParentOnly.get -> bool +GitVersion.Git.CommitFilter.FirstParentOnly.init -> void +GitVersion.Git.CommitFilter.IncludeReachableFrom.get -> object? +GitVersion.Git.CommitFilter.IncludeReachableFrom.init -> void +GitVersion.Git.CommitFilter.SortBy.get -> GitVersion.Git.CommitSortStrategies +GitVersion.Git.CommitFilter.SortBy.init -> void +GitVersion.Git.CommitSortStrategies +GitVersion.Git.CommitSortStrategies.None = 0 -> GitVersion.Git.CommitSortStrategies +GitVersion.Git.CommitSortStrategies.Reverse = 4 -> GitVersion.Git.CommitSortStrategies +GitVersion.Git.CommitSortStrategies.Time = 2 -> GitVersion.Git.CommitSortStrategies +GitVersion.Git.CommitSortStrategies.Topological = 1 -> GitVersion.Git.CommitSortStrategies +GitVersion.Git.IBranch +GitVersion.Git.IBranch.Commits.get -> GitVersion.Git.ICommitCollection! +GitVersion.Git.IBranch.IsDetachedHead.get -> bool +GitVersion.Git.IBranch.IsRemote.get -> bool +GitVersion.Git.IBranch.IsTracking.get -> bool +GitVersion.Git.IBranch.Tip.get -> GitVersion.Git.ICommit? +GitVersion.Git.IBranchCollection +GitVersion.Git.IBranchCollection.ExcludeBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! +GitVersion.Git.IBranchCollection.this[string! name].get -> GitVersion.Git.IBranch? +GitVersion.Git.IBranchCollection.UpdateTrackedBranch(GitVersion.Git.IBranch! branch, string! remoteTrackingReferenceName) -> void +GitVersion.Git.ICommit +GitVersion.Git.ICommit.DiffPaths.get -> System.Collections.Generic.IReadOnlyList! +GitVersion.Git.ICommit.Message.get -> string! +GitVersion.Git.ICommit.Parents.get -> System.Collections.Generic.IReadOnlyList! +GitVersion.Git.ICommit.When.get -> System.DateTimeOffset +GitVersion.Git.ICommitCollection +GitVersion.Git.ICommitCollection.GetCommitsPriorTo(System.DateTimeOffset olderThan) -> System.Collections.Generic.IEnumerable! +GitVersion.Git.ICommitCollection.QueryBy(GitVersion.Git.CommitFilter! commitFilter) -> System.Collections.Generic.IEnumerable! +GitVersion.Git.IGitRepository +GitVersion.Git.IGitRepository.Branches.get -> GitVersion.Git.IBranchCollection! +GitVersion.Git.IGitRepository.Commits.get -> GitVersion.Git.ICommitCollection! +GitVersion.Git.IGitRepository.DiscoverRepository(string? gitDirectory) -> void +GitVersion.Git.IGitRepository.FindMergeBase(GitVersion.Git.ICommit! commit, GitVersion.Git.ICommit! otherCommit) -> GitVersion.Git.ICommit? +GitVersion.Git.IGitRepository.Head.get -> GitVersion.Git.IBranch! +GitVersion.Git.IGitRepository.IsHeadDetached.get -> bool +GitVersion.Git.IGitRepository.IsShallow.get -> bool +GitVersion.Git.IGitRepository.Path.get -> string! +GitVersion.Git.IGitRepository.Remotes.get -> GitVersion.Git.IRemoteCollection! +GitVersion.Git.IGitRepository.Tags.get -> GitVersion.Git.ITagCollection! +GitVersion.Git.IGitRepository.UncommittedChangesCount() -> int +GitVersion.Git.IGitRepository.WorkingDirectory.get -> string! +GitVersion.Git.IGitRepositoryInfo +GitVersion.Git.IGitRepositoryInfo.DotGitDirectory.get -> string? +GitVersion.Git.IGitRepositoryInfo.DynamicGitRepositoryPath.get -> string? +GitVersion.Git.IGitRepositoryInfo.GitRootPath.get -> string? +GitVersion.Git.IGitRepositoryInfo.ProjectRootDirectory.get -> string? +GitVersion.Git.IMutatingGitRepository +GitVersion.Git.IMutatingGitRepository.Checkout(string! commitOrBranchSpec) -> void +GitVersion.Git.IMutatingGitRepository.Clone(string? sourceUrl, string? workdirPath, GitVersion.Git.AuthenticationInfo! auth) -> void +GitVersion.Git.IMutatingGitRepository.CreateBranchForPullRequestBranch(GitVersion.Git.AuthenticationInfo! auth) -> void +GitVersion.Git.IMutatingGitRepository.Fetch(string! remote, System.Collections.Generic.IEnumerable! refSpecs, GitVersion.Git.AuthenticationInfo! auth, string? logMessage) -> void +GitVersion.Git.INamedReference +GitVersion.Git.INamedReference.Name.get -> GitVersion.Git.ReferenceName! +GitVersion.Git.IObjectId +GitVersion.Git.IObjectId.Sha.get -> string! +GitVersion.Git.IObjectId.ToString(int prefixLength) -> string! +GitVersion.Git.IReference +GitVersion.Git.IReference.ReferenceTargetId.get -> GitVersion.Git.IObjectId? +GitVersion.Git.IReference.TargetIdentifier.get -> string! +GitVersion.Git.IReferenceCollection +GitVersion.Git.IReferenceCollection.Add(string! name, string! canonicalRefNameOrObject, bool allowOverwrite = false) -> void +GitVersion.Git.IReferenceCollection.FromGlob(string! prefix) -> System.Collections.Generic.IEnumerable! +GitVersion.Git.IReferenceCollection.Head.get -> GitVersion.Git.IReference? +GitVersion.Git.IReferenceCollection.this[GitVersion.Git.ReferenceName! referenceName].get -> GitVersion.Git.IReference? +GitVersion.Git.IReferenceCollection.this[string! name].get -> GitVersion.Git.IReference? +GitVersion.Git.IReferenceCollection.UpdateTarget(GitVersion.Git.IReference! directRef, GitVersion.Git.IObjectId! targetId) -> void +GitVersion.Git.IRefSpec +GitVersion.Git.IRefSpec.Destination.get -> string! +GitVersion.Git.IRefSpec.Direction.get -> GitVersion.Git.RefSpecDirection +GitVersion.Git.IRefSpec.Source.get -> string! +GitVersion.Git.IRefSpec.Specification.get -> string! +GitVersion.Git.IRefSpecCollection +GitVersion.Git.IRemote +GitVersion.Git.IRemote.FetchRefSpecs.get -> System.Collections.Generic.IEnumerable! +GitVersion.Git.IRemote.Name.get -> string! +GitVersion.Git.IRemote.PushRefSpecs.get -> System.Collections.Generic.IEnumerable! +GitVersion.Git.IRemote.Url.get -> string! +GitVersion.Git.IRemoteCollection +GitVersion.Git.IRemoteCollection.Remove(string! remoteName) -> void +GitVersion.Git.IRemoteCollection.this[string! name].get -> GitVersion.Git.IRemote? +GitVersion.Git.IRemoteCollection.Update(string! remoteName, string! refSpec) -> void +GitVersion.Git.ITag +GitVersion.Git.ITag.Commit.get -> GitVersion.Git.ICommit! +GitVersion.Git.ITag.TargetSha.get -> string! +GitVersion.Git.ITagCollection +GitVersion.Git.ITreeChanges +GitVersion.Git.ITreeChanges.Paths.get -> System.Collections.Generic.IReadOnlyList! +GitVersion.Git.ReferenceName +GitVersion.Git.ReferenceName.Canonical.get -> string! +GitVersion.Git.ReferenceName.CompareTo(GitVersion.Git.ReferenceName? other) -> int +GitVersion.Git.ReferenceName.Equals(GitVersion.Git.ReferenceName? other) -> bool +GitVersion.Git.ReferenceName.EquivalentTo(string? name) -> bool +GitVersion.Git.ReferenceName.Friendly.get -> string! +GitVersion.Git.ReferenceName.IsLocalBranch.get -> bool +GitVersion.Git.ReferenceName.IsPullRequest.get -> bool +GitVersion.Git.ReferenceName.IsRemoteBranch.get -> bool +GitVersion.Git.ReferenceName.IsTag.get -> bool +GitVersion.Git.ReferenceName.ReferenceName(string! canonical) -> void +GitVersion.Git.ReferenceName.WithoutOrigin.get -> string! +GitVersion.Git.RefSpecDirection +GitVersion.Git.RefSpecDirection.Fetch = 0 -> GitVersion.Git.RefSpecDirection +GitVersion.Git.RefSpecDirection.Push = 1 -> GitVersion.Git.RefSpecDirection +GitVersion.GitVersionCommonModule +GitVersion.GitVersionCommonModule.GitVersionCommonModule() -> void +GitVersion.GitVersionCommonModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.GitVersionContext -GitVersion.GitVersionContext.CurrentBranch.get -> GitVersion.IBranch! -GitVersion.GitVersionContext.CurrentCommit.get -> GitVersion.ICommit? -GitVersion.GitVersionContext.CurrentCommitTaggedVersion.get -> GitVersion.SemanticVersion? -GitVersion.GitVersionContext.FullConfiguration.get -> GitVersion.Model.Configuration.Config! -GitVersion.GitVersionContext.GetEffectiveConfiguration(GitVersion.IBranch! branch) -> GitVersion.Model.Configuration.EffectiveConfiguration! -GitVersion.GitVersionContext.GitVersionContext(GitVersion.IBranch! currentBranch, GitVersion.ICommit? currentCommit, GitVersion.Model.Configuration.Config! configuration, GitVersion.SemanticVersion? currentCommitTaggedVersion, int numberOfUncommittedChanges) -> void +GitVersion.GitVersionContext.Configuration.get -> GitVersion.Configuration.IGitVersionConfiguration! +GitVersion.GitVersionContext.CurrentBranch.get -> GitVersion.Git.IBranch! +GitVersion.GitVersionContext.CurrentBranchCommits.get -> System.Collections.Generic.IEnumerable! +GitVersion.GitVersionContext.CurrentCommit.get -> GitVersion.Git.ICommit! +GitVersion.GitVersionContext.GitVersionContext(GitVersion.Git.IBranch! currentBranch, GitVersion.Git.ICommit! currentCommit, GitVersion.Configuration.IGitVersionConfiguration! configuration, bool isCurrentCommitTagged, int numberOfUncommittedChanges) -> void GitVersion.GitVersionContext.IsCurrentCommitTagged.get -> bool GitVersion.GitVersionContext.NumberOfUncommittedChanges.get -> int -GitVersion.GitVersionContextFactory -GitVersion.GitVersionContextFactory.Create(GitVersion.GitVersionOptions! gitVersionOptions) -> GitVersion.GitVersionContext! -GitVersion.GitVersionContextFactory.GitVersionContextFactory(GitVersion.Configuration.IConfigProvider! configProvider, GitVersion.Common.IRepositoryStore! repositoryStore, Microsoft.Extensions.Options.IOptions! options) -> void GitVersion.GitVersionCoreModule GitVersion.GitVersionCoreModule.GitVersionCoreModule() -> void GitVersion.GitVersionCoreModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.GitVersionException -GitVersion.GitVersionException.GitVersionException(string! message) -> void +GitVersion.GitVersionException.GitVersionException() -> void GitVersion.GitVersionException.GitVersionException(string! message, System.Exception! innerException) -> void -GitVersion.GitVersionModule -GitVersion.GitVersionModule.GitVersionModule() -> void +GitVersion.GitVersionException.GitVersionException(string! message) -> void +GitVersion.GitVersionException.GitVersionException(string! messageFormat, params object![]! args) -> void GitVersion.GitVersionOptions -GitVersion.GitVersionOptions.AssemblyInfo.get -> GitVersion.AssemblyInfoData! -GitVersion.GitVersionOptions.Authentication.get -> GitVersion.AuthenticationInfo! -GitVersion.GitVersionOptions.ConfigInfo.get -> GitVersion.ConfigInfo! +GitVersion.GitVersionOptions.AssemblySettingsInfo.get -> GitVersion.AssemblySettingsInfo! +GitVersion.GitVersionOptions.AuthenticationInfo.get -> GitVersion.Git.AuthenticationInfo! +GitVersion.GitVersionOptions.ConfigurationInfo.get -> GitVersion.ConfigurationInfo! GitVersion.GitVersionOptions.Diag -> bool +GitVersion.GitVersionOptions.Format -> string? GitVersion.GitVersionOptions.GitVersionOptions() -> void -GitVersion.GitVersionOptions.Init -> bool GitVersion.GitVersionOptions.IsHelp -> bool GitVersion.GitVersionOptions.IsVersion -> bool GitVersion.GitVersionOptions.LogFilePath -> string? -GitVersion.GitVersionOptions.Output -> System.Collections.Generic.ISet! +GitVersion.GitVersionOptions.Output -> System.Collections.Generic.ISet! GitVersion.GitVersionOptions.OutputFile -> string? GitVersion.GitVersionOptions.RepositoryInfo.get -> GitVersion.RepositoryInfo! GitVersion.GitVersionOptions.Settings.get -> GitVersion.Settings! @@ -365,22 +338,15 @@ GitVersion.GitVersionOptions.Verbosity -> GitVersion.Logging.Verbosity GitVersion.GitVersionOptions.WixInfo.get -> GitVersion.WixInfo! GitVersion.GitVersionOptions.WorkingDirectory.get -> string! GitVersion.GitVersionOptions.WorkingDirectory.set -> void -GitVersion.GitVersionOutputTool -GitVersion.GitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo) -> void -GitVersion.GitVersionOutputTool.GitVersionOutputTool(Microsoft.Extensions.Options.IOptions! options, GitVersion.VersionConverters.OutputGenerator.IOutputGenerator! outputGenerator, GitVersion.VersionConverters.WixUpdater.IWixVersionFileUpdater! wixVersionFileUpdater, GitVersion.VersionConverters.GitVersionInfo.IGitVersionInfoGenerator! gitVersionInfoGenerator, GitVersion.VersionConverters.AssemblyInfo.IAssemblyInfoFileUpdater! assemblyInfoFileUpdater, GitVersion.VersionConverters.AssemblyInfo.IProjectFileUpdater! projectFileUpdater) -> void -GitVersion.GitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber) -> void -GitVersion.GitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.GitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.Helpers.EncodingHelper +GitVersion.Helpers.Disposable +GitVersion.Helpers.IDisposable +GitVersion.Helpers.IDisposable.Value.get -> T GitVersion.Helpers.LambdaEqualityHelper GitVersion.Helpers.LambdaEqualityHelper.Equals(T? instance, T? other) -> bool GitVersion.Helpers.LambdaEqualityHelper.GetHashCode(T instance) -> int GitVersion.Helpers.LambdaEqualityHelper.LambdaEqualityHelper(params System.Func![]! equalityContributorAccessors) -> void GitVersion.Helpers.LambdaKeyComparer GitVersion.Helpers.LambdaKeyComparer.LambdaKeyComparer(System.Func! keySelector, System.Collections.Generic.IComparer? innerComparer = null) -> void -GitVersion.Helpers.PathHelper -GitVersion.Helpers.PathHelper.PathHelper() -> void -GitVersion.Helpers.ProcessHelper GitVersion.Helpers.RetryAction GitVersion.Helpers.RetryAction.Execute(System.Func! operation) -> Result GitVersion.Helpers.RetryAction.RetryAction(int maxRetries = 5) -> void @@ -388,161 +354,46 @@ GitVersion.Helpers.RetryAction GitVersion.Helpers.RetryAction.Execute(System.Action! operation) -> void GitVersion.Helpers.RetryAction.RetryAction(int maxRetries = 5) -> void GitVersion.Helpers.ServiceMessageEscapeHelper -GitVersion.Helpers.StringComparerUtils -GitVersion.IBranch -GitVersion.IBranch.Commits.get -> GitVersion.ICommitCollection? -GitVersion.IBranch.IsDetachedHead.get -> bool -GitVersion.IBranch.IsRemote.get -> bool -GitVersion.IBranch.IsTracking.get -> bool -GitVersion.IBranch.Tip.get -> GitVersion.ICommit? -GitVersion.IBranchCollection -GitVersion.IBranchCollection.ExcludeBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! -GitVersion.IBranchCollection.this[string! name].get -> GitVersion.IBranch? -GitVersion.IBranchCollection.UpdateTrackedBranch(GitVersion.IBranch! branch, string! remoteTrackingReferenceName) -> void -GitVersion.ICommit -GitVersion.ICommit.Message.get -> string! -GitVersion.ICommit.Parents.get -> System.Collections.Generic.IEnumerable! -GitVersion.ICommit.When.get -> System.DateTimeOffset -GitVersion.ICommitCollection -GitVersion.ICommitCollection.GetCommitsPriorTo(System.DateTimeOffset olderThan) -> System.Collections.Generic.IEnumerable! -GitVersion.ICommitCollection.QueryBy(GitVersion.CommitFilter! commitFilter) -> System.Collections.Generic.IEnumerable! +GitVersion.IConverterContext GitVersion.IEnvironment GitVersion.IEnvironment.GetEnvironmentVariable(string! variableName) -> string? GitVersion.IEnvironment.SetEnvironmentVariable(string! variableName, string? value) -> void -GitVersion.IFileSystem -GitVersion.IFileSystem.Copy(string! from, string! to, bool overwrite) -> void -GitVersion.IFileSystem.CreateDirectory(string! path) -> void -GitVersion.IFileSystem.Delete(string! path) -> void -GitVersion.IFileSystem.DirectoryEnumerateFiles(string? directory, string! searchPattern, System.IO.SearchOption searchOption) -> System.Collections.Generic.IEnumerable! -GitVersion.IFileSystem.DirectoryExists(string! path) -> bool -GitVersion.IFileSystem.Exists(string! file) -> bool -GitVersion.IFileSystem.GetLastDirectoryWrite(string! path) -> long -GitVersion.IFileSystem.Move(string! from, string! to) -> void -GitVersion.IFileSystem.OpenRead(string! path) -> System.IO.Stream! -GitVersion.IFileSystem.OpenWrite(string! path) -> System.IO.Stream! -GitVersion.IFileSystem.PathsEqual(string? path, string? otherPath) -> bool -GitVersion.IFileSystem.ReadAllText(string! path) -> string! -GitVersion.IFileSystem.WriteAllText(string? file, string! fileContents) -> void -GitVersion.IFileSystem.WriteAllText(string? file, string! fileContents, System.Text.Encoding! encoding) -> void -GitVersion.IGitObject -GitVersion.IGitObject.Id.get -> GitVersion.IObjectId! -GitVersion.IGitObject.Sha.get -> string! GitVersion.IGitPreparer -GitVersion.IGitPreparer.EnsureLocalBranchExistsForCurrentBranch(GitVersion.IRemote! remote, string! currentBranch) -> void +GitVersion.IGitPreparer.EnsureLocalBranchExistsForCurrentBranch(GitVersion.Git.IRemote! remote, string! currentBranch) -> void GitVersion.IGitPreparer.Prepare() -> void -GitVersion.IGitRepository -GitVersion.IGitRepository.Branches.get -> GitVersion.IBranchCollection! -GitVersion.IGitRepository.Commits.get -> GitVersion.ICommitCollection! -GitVersion.IGitRepository.FindMergeBase(GitVersion.ICommit! commit, GitVersion.ICommit! otherCommit) -> GitVersion.ICommit? -GitVersion.IGitRepository.GetNumberOfUncommittedChanges() -> int -GitVersion.IGitRepository.Head.get -> GitVersion.IBranch! -GitVersion.IGitRepository.IsHeadDetached.get -> bool -GitVersion.IGitRepository.Path.get -> string! -GitVersion.IGitRepository.Refs.get -> GitVersion.IReferenceCollection! -GitVersion.IGitRepository.Remotes.get -> GitVersion.IRemoteCollection! -GitVersion.IGitRepository.Tags.get -> GitVersion.ITagCollection! -GitVersion.IGitRepository.WorkingDirectory.get -> string! -GitVersion.IGitRepositoryInfo -GitVersion.IGitRepositoryInfo.DotGitDirectory.get -> string? -GitVersion.IGitRepositoryInfo.DynamicGitRepositoryPath.get -> string? -GitVersion.IGitRepositoryInfo.GitRootPath.get -> string? -GitVersion.IGitRepositoryInfo.ProjectRootDirectory.get -> string? GitVersion.IGitVersionCalculateTool -GitVersion.IGitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.VersionVariables! +GitVersion.IGitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.GitVersionVariables! GitVersion.IGitVersionContextFactory -GitVersion.IGitVersionContextFactory.Create(GitVersion.GitVersionOptions! gitVersionOptions) -> GitVersion.GitVersionContext! GitVersion.IGitVersionModule +GitVersion.IGitVersionModule.FindAllDerivedTypes(System.Reflection.Assembly? assembly) -> System.Collections.Generic.IEnumerable! GitVersion.IGitVersionModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.IGitVersionOutputTool -GitVersion.IGitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo) -> void -GitVersion.IGitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber) -> void -GitVersion.IGitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.IGitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.IMutatingGitRepository -GitVersion.IMutatingGitRepository.Checkout(string! commitOrBranchSpec) -> void -GitVersion.IMutatingGitRepository.Clone(string? sourceUrl, string? workdirPath, GitVersion.AuthenticationInfo! auth) -> void -GitVersion.IMutatingGitRepository.CreateBranchForPullRequestBranch(GitVersion.AuthenticationInfo! auth) -> void -GitVersion.IMutatingGitRepository.Fetch(string! remote, System.Collections.Generic.IEnumerable! refSpecs, GitVersion.AuthenticationInfo! auth, string? logMessage) -> void -GitVersion.INamedReference -GitVersion.INamedReference.Name.get -> GitVersion.ReferenceName! GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Inherit = 4 -> GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Major = 1 -> GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Minor = 2 -> GitVersion.IncrementStrategy GitVersion.IncrementStrategy.None = 0 -> GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Patch = 3 -> GitVersion.IncrementStrategy -GitVersion.IncrementStrategyExtensions -GitVersion.IObjectId -GitVersion.IObjectId.Sha.get -> string! -GitVersion.IObjectId.ToString(int prefixLength) -> string! -GitVersion.IReference -GitVersion.IReference.ReferenceTargetId.get -> GitVersion.IObjectId? -GitVersion.IReference.TargetIdentifier.get -> string! -GitVersion.IReferenceCollection -GitVersion.IReferenceCollection.Add(string! name, string! canonicalRefNameOrObject, bool allowOverwrite = false) -> void -GitVersion.IReferenceCollection.FromGlob(string! prefix) -> System.Collections.Generic.IEnumerable! -GitVersion.IReferenceCollection.Head.get -> GitVersion.IReference? -GitVersion.IReferenceCollection.this[GitVersion.ReferenceName! referenceName].get -> GitVersion.IReference? -GitVersion.IReferenceCollection.this[string! name].get -> GitVersion.IReference? -GitVersion.IReferenceCollection.UpdateTarget(GitVersion.IReference! directRef, GitVersion.IObjectId! targetId) -> void -GitVersion.IRefSpec -GitVersion.IRefSpec.Destination.get -> string! -GitVersion.IRefSpec.Direction.get -> GitVersion.RefSpecDirection -GitVersion.IRefSpec.Source.get -> string! -GitVersion.IRefSpec.Specification.get -> string! -GitVersion.IRefSpecCollection -GitVersion.IRemote -GitVersion.IRemote.FetchRefSpecs.get -> System.Collections.Generic.IEnumerable! -GitVersion.IRemote.Name.get -> string! -GitVersion.IRemote.PushRefSpecs.get -> System.Collections.Generic.IEnumerable! -GitVersion.IRemote.RefSpecs.get -> System.Collections.Generic.IEnumerable! -GitVersion.IRemote.Url.get -> string! -GitVersion.IRemoteCollection -GitVersion.IRemoteCollection.Remove(string! remoteName) -> void -GitVersion.IRemoteCollection.this[string! name].get -> GitVersion.IRemote? -GitVersion.IRemoteCollection.Update(string! remoteName, string! refSpec) -> void -GitVersion.ITag -GitVersion.ITag.PeeledTargetCommit() -> GitVersion.ICommit? -GitVersion.ITag.TargetSha.get -> string? -GitVersion.ITagCollection +GitVersion.IVersionConverter +GitVersion.IVersionConverter.Execute(GitVersion.OutputVariables.GitVersionVariables! variables, T context) -> void GitVersion.LockedFileException +GitVersion.LockedFileException.LockedFileException() -> void +GitVersion.LockedFileException.LockedFileException(string? message, System.Exception? innerException) -> void +GitVersion.LockedFileException.LockedFileException(string? message) -> void GitVersion.LockedFileException.LockedFileException(System.Exception! inner) -> void -GitVersion.Logging.ConsoleAdapter -GitVersion.Logging.ConsoleAdapter.ConsoleAdapter() -> void -GitVersion.Logging.ConsoleAdapter.ReadLine() -> string? -GitVersion.Logging.ConsoleAdapter.UseColor(System.ConsoleColor consoleColor) -> System.IDisposable! -GitVersion.Logging.ConsoleAdapter.Write(string? msg) -> void -GitVersion.Logging.ConsoleAdapter.WriteLine() -> void -GitVersion.Logging.ConsoleAdapter.WriteLine(string? msg) -> void -GitVersion.Logging.ConsoleAppender -GitVersion.Logging.ConsoleAppender.ConsoleAppender() -> void -GitVersion.Logging.ConsoleAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void -GitVersion.Logging.Disposable -GitVersion.Logging.FileAppender -GitVersion.Logging.FileAppender.FileAppender(string! filePath) -> void -GitVersion.Logging.FileAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void GitVersion.Logging.IConsole GitVersion.Logging.IConsole.ReadLine() -> string? GitVersion.Logging.IConsole.UseColor(System.ConsoleColor consoleColor) -> System.IDisposable! GitVersion.Logging.IConsole.Write(string? msg) -> void -GitVersion.Logging.IConsole.WriteLine() -> void GitVersion.Logging.IConsole.WriteLine(string? msg) -> void GitVersion.Logging.ILog GitVersion.Logging.ILog.AddLogAppender(GitVersion.Logging.ILogAppender! logAppender) -> void GitVersion.Logging.ILog.IndentLog(string! operationDescription) -> System.IDisposable! +GitVersion.Logging.ILog.Separator() -> void GitVersion.Logging.ILog.Verbosity.get -> GitVersion.Logging.Verbosity GitVersion.Logging.ILog.Verbosity.set -> void GitVersion.Logging.ILog.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.ILogAppender GitVersion.Logging.ILogAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void -GitVersion.Logging.Log -GitVersion.Logging.Log.AddLogAppender(GitVersion.Logging.ILogAppender! logAppender) -> void -GitVersion.Logging.Log.IndentLog(string! operationDescription) -> System.IDisposable! -GitVersion.Logging.Log.Log() -> void -GitVersion.Logging.Log.Log(params GitVersion.Logging.ILogAppender![]! appenders) -> void -GitVersion.Logging.Log.Verbosity.get -> GitVersion.Logging.Verbosity -GitVersion.Logging.Log.Verbosity.set -> void -GitVersion.Logging.Log.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.LogAction GitVersion.Logging.LogActionEntry GitVersion.Logging.LogExtensions @@ -553,15 +404,6 @@ GitVersion.Logging.LogLevel.Fatal = 0 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Info = 3 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Verbose = 4 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Warn = 2 -> GitVersion.Logging.LogLevel -GitVersion.Logging.NullLog -GitVersion.Logging.NullLog.AddLogAppender(GitVersion.Logging.ILogAppender! logAppender) -> void -GitVersion.Logging.NullLog.Indent.get -> string? -GitVersion.Logging.NullLog.Indent.set -> void -GitVersion.Logging.NullLog.IndentLog(string! operationDescription) -> System.IDisposable! -GitVersion.Logging.NullLog.NullLog() -> void -GitVersion.Logging.NullLog.Verbosity.get -> GitVersion.Logging.Verbosity -GitVersion.Logging.NullLog.Verbosity.set -> void -GitVersion.Logging.NullLog.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.Verbosity GitVersion.Logging.Verbosity.Diagnostic = 4 -> GitVersion.Logging.Verbosity GitVersion.Logging.Verbosity.Minimal = 1 -> GitVersion.Logging.Verbosity @@ -571,778 +413,435 @@ GitVersion.Logging.Verbosity.Verbose = 3 -> GitVersion.Logging.Verbosity GitVersion.MergeMessage GitVersion.MergeMessage.FormatName.get -> string? GitVersion.MergeMessage.IsMergedPullRequest.get -> bool -GitVersion.MergeMessage.MergedBranch.get -> string! -GitVersion.MergeMessage.MergeMessage(string? mergeMessage, GitVersion.Model.Configuration.Config! config) -> void +GitVersion.MergeMessage.MergedBranch.get -> GitVersion.Git.ReferenceName? +GitVersion.MergeMessage.MergeMessage(string! mergeMessage, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> void GitVersion.MergeMessage.PullRequestNumber.get -> int? GitVersion.MergeMessage.TargetBranch.get -> string? GitVersion.MergeMessage.Version.get -> GitVersion.SemanticVersion? -GitVersion.Model.Configuration.BranchConfig -GitVersion.Model.Configuration.BranchConfig.Apply(GitVersion.Model.Configuration.BranchConfig! overrides) -> GitVersion.Model.Configuration.BranchConfig! -GitVersion.Model.Configuration.BranchConfig.BranchConfig() -> void -GitVersion.Model.Configuration.BranchConfig.BranchConfig(GitVersion.Model.Configuration.BranchConfig! branchConfiguration) -> void -GitVersion.Model.Configuration.BranchConfig.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode? -GitVersion.Model.Configuration.BranchConfig.CommitMessageIncrementing.set -> void -GitVersion.Model.Configuration.BranchConfig.Increment.get -> GitVersion.IncrementStrategy? -GitVersion.Model.Configuration.BranchConfig.Increment.set -> void -GitVersion.Model.Configuration.BranchConfig.IsMainline.get -> bool? -GitVersion.Model.Configuration.BranchConfig.IsMainline.set -> void -GitVersion.Model.Configuration.BranchConfig.IsReleaseBranch.get -> bool? -GitVersion.Model.Configuration.BranchConfig.IsReleaseBranch.set -> void -GitVersion.Model.Configuration.BranchConfig.IsSourceBranchFor.get -> System.Collections.Generic.HashSet? -GitVersion.Model.Configuration.BranchConfig.IsSourceBranchFor.set -> void -GitVersion.Model.Configuration.BranchConfig.MergeTo(GitVersion.Model.Configuration.BranchConfig! targetConfig) -> void -GitVersion.Model.Configuration.BranchConfig.Name.get -> string! -GitVersion.Model.Configuration.BranchConfig.Name.set -> void -GitVersion.Model.Configuration.BranchConfig.PreReleaseWeight.get -> int? -GitVersion.Model.Configuration.BranchConfig.PreReleaseWeight.set -> void -GitVersion.Model.Configuration.BranchConfig.PreventIncrementOfMergedBranchVersion.get -> bool? -GitVersion.Model.Configuration.BranchConfig.PreventIncrementOfMergedBranchVersion.set -> void -GitVersion.Model.Configuration.BranchConfig.Regex.get -> string? -GitVersion.Model.Configuration.BranchConfig.Regex.set -> void -GitVersion.Model.Configuration.BranchConfig.SourceBranches.get -> System.Collections.Generic.HashSet? -GitVersion.Model.Configuration.BranchConfig.SourceBranches.set -> void -GitVersion.Model.Configuration.BranchConfig.Tag.get -> string? -GitVersion.Model.Configuration.BranchConfig.Tag.set -> void -GitVersion.Model.Configuration.BranchConfig.TagNumberPattern.get -> string? -GitVersion.Model.Configuration.BranchConfig.TagNumberPattern.set -> void -GitVersion.Model.Configuration.BranchConfig.TrackMergeTarget.get -> bool? -GitVersion.Model.Configuration.BranchConfig.TrackMergeTarget.set -> void -GitVersion.Model.Configuration.BranchConfig.TracksReleaseBranches.get -> bool? -GitVersion.Model.Configuration.BranchConfig.TracksReleaseBranches.set -> void -GitVersion.Model.Configuration.BranchConfig.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode? -GitVersion.Model.Configuration.BranchConfig.VersioningMode.set -> void -GitVersion.Model.Configuration.Config -GitVersion.Model.Configuration.Config.AssemblyFileVersioningFormat.get -> string? -GitVersion.Model.Configuration.Config.AssemblyFileVersioningFormat.set -> void -GitVersion.Model.Configuration.Config.AssemblyFileVersioningScheme.get -> GitVersion.Extensions.AssemblyFileVersioningScheme? -GitVersion.Model.Configuration.Config.AssemblyFileVersioningScheme.set -> void -GitVersion.Model.Configuration.Config.AssemblyInformationalFormat.get -> string? -GitVersion.Model.Configuration.Config.AssemblyInformationalFormat.set -> void -GitVersion.Model.Configuration.Config.AssemblyVersioningFormat.get -> string? -GitVersion.Model.Configuration.Config.AssemblyVersioningFormat.set -> void -GitVersion.Model.Configuration.Config.AssemblyVersioningScheme.get -> GitVersion.Extensions.AssemblyVersioningScheme? -GitVersion.Model.Configuration.Config.AssemblyVersioningScheme.set -> void -GitVersion.Model.Configuration.Config.Branches.get -> System.Collections.Generic.Dictionary! -GitVersion.Model.Configuration.Config.Branches.set -> void -GitVersion.Model.Configuration.Config.BuildMetaDataPadding.get -> int? -GitVersion.Model.Configuration.Config.BuildMetaDataPadding.set -> void -GitVersion.Model.Configuration.Config.CommitDateFormat.get -> string? -GitVersion.Model.Configuration.Config.CommitDateFormat.set -> void -GitVersion.Model.Configuration.Config.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode? -GitVersion.Model.Configuration.Config.CommitMessageIncrementing.set -> void -GitVersion.Model.Configuration.Config.CommitsSinceVersionSourcePadding.get -> int? -GitVersion.Model.Configuration.Config.CommitsSinceVersionSourcePadding.set -> void -GitVersion.Model.Configuration.Config.Config() -> void -GitVersion.Model.Configuration.Config.ContinuousDeploymentFallbackTag.get -> string? -GitVersion.Model.Configuration.Config.ContinuousDeploymentFallbackTag.set -> void -GitVersion.Model.Configuration.Config.Ignore.get -> GitVersion.Model.Configuration.IgnoreConfig! -GitVersion.Model.Configuration.Config.Ignore.set -> void -GitVersion.Model.Configuration.Config.Increment.get -> GitVersion.IncrementStrategy? -GitVersion.Model.Configuration.Config.Increment.set -> void -GitVersion.Model.Configuration.Config.LegacySemVerPadding.get -> int? -GitVersion.Model.Configuration.Config.LegacySemVerPadding.set -> void -GitVersion.Model.Configuration.Config.MajorVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.Config.MajorVersionBumpMessage.set -> void -GitVersion.Model.Configuration.Config.MergeMessageFormats.get -> System.Collections.Generic.Dictionary! -GitVersion.Model.Configuration.Config.MergeMessageFormats.set -> void -GitVersion.Model.Configuration.Config.MinorVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.Config.MinorVersionBumpMessage.set -> void -GitVersion.Model.Configuration.Config.NextVersion.get -> string? -GitVersion.Model.Configuration.Config.NextVersion.set -> void -GitVersion.Model.Configuration.Config.NoBumpMessage.get -> string? -GitVersion.Model.Configuration.Config.NoBumpMessage.set -> void -GitVersion.Model.Configuration.Config.PatchVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.Config.PatchVersionBumpMessage.set -> void -GitVersion.Model.Configuration.Config.TagPrefix.get -> string? -GitVersion.Model.Configuration.Config.TagPrefix.set -> void -GitVersion.Model.Configuration.Config.TagPreReleaseWeight.get -> int? -GitVersion.Model.Configuration.Config.TagPreReleaseWeight.set -> void -GitVersion.Model.Configuration.Config.UpdateBuildNumber.get -> bool? -GitVersion.Model.Configuration.Config.UpdateBuildNumber.set -> void -GitVersion.Model.Configuration.Config.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode? -GitVersion.Model.Configuration.Config.VersioningMode.set -> void -GitVersion.Model.Configuration.EffectiveBranchConfiguration -GitVersion.Model.Configuration.EffectiveBranchConfiguration.Branch.get -> GitVersion.IBranch! -GitVersion.Model.Configuration.EffectiveBranchConfiguration.CreateNextVersion(GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.SemanticVersion! incrementedVersion) -> GitVersion.VersionCalculation.NextVersion! -GitVersion.Model.Configuration.EffectiveBranchConfiguration.EffectiveBranchConfiguration(GitVersion.IBranch! branch, GitVersion.Model.Configuration.EffectiveConfiguration! value) -> void -GitVersion.Model.Configuration.EffectiveBranchConfiguration.Value.get -> GitVersion.Model.Configuration.EffectiveConfiguration! -GitVersion.Model.Configuration.EffectiveConfiguration -GitVersion.Model.Configuration.EffectiveConfiguration.AssemblyFileVersioningFormat.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.AssemblyFileVersioningScheme.get -> GitVersion.Extensions.AssemblyFileVersioningScheme -GitVersion.Model.Configuration.EffectiveConfiguration.AssemblyInformationalFormat.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.AssemblyVersioningFormat.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.AssemblyVersioningScheme.get -> GitVersion.Extensions.AssemblyVersioningScheme -GitVersion.Model.Configuration.EffectiveConfiguration.BranchPrefixToTrim.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.BuildMetaDataPadding.get -> int -GitVersion.Model.Configuration.EffectiveConfiguration.CommitDateFormat.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode -GitVersion.Model.Configuration.EffectiveConfiguration.CommitsSinceVersionSourcePadding.get -> int -GitVersion.Model.Configuration.EffectiveConfiguration.ContinuousDeploymentFallbackTag.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Extensions.AssemblyVersioningScheme assemblyVersioningScheme, GitVersion.Extensions.AssemblyFileVersioningScheme assemblyFileVersioningScheme, string? assemblyInformationalFormat, string? assemblyVersioningFormat, string? assemblyFileVersioningFormat, GitVersion.VersionCalculation.VersioningMode versioningMode, string? tagPrefix, string? tag, string? nextVersion, GitVersion.IncrementStrategy increment, string? branchPrefixToTrim, bool preventIncrementOfMergedBranchVersion, string? tagNumberPattern, string? continuousDeploymentFallbackTag, bool trackMergeTarget, string? majorVersionBumpMessage, string? minorVersionBumpMessage, string? patchVersionBumpMessage, string? noBumpMessage, GitVersion.VersionCalculation.CommitMessageIncrementMode commitMessageIncrementing, int legacySemVerPaddding, int buildMetaDataPadding, int commitsSinceVersionSourcePadding, System.Collections.Generic.IEnumerable! versionFilters, bool tracksReleaseBranches, bool isReleaseBranch, bool isMainline, string? commitDateFormat, bool updateBuildNumber, int preReleaseWeight, int tagPreReleaseWeight) -> void -GitVersion.Model.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Model.Configuration.Config! configuration, GitVersion.Model.Configuration.BranchConfig! currentBranchConfig) -> void -GitVersion.Model.Configuration.EffectiveConfiguration.Increment.get -> GitVersion.IncrementStrategy -GitVersion.Model.Configuration.EffectiveConfiguration.IsMainline.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.IsReleaseBranch.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.LegacySemVerPadding.get -> int -GitVersion.Model.Configuration.EffectiveConfiguration.MajorVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.MinorVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.NextVersion.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.NoBumpMessage.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.PatchVersionBumpMessage.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.PreReleaseWeight.get -> int -GitVersion.Model.Configuration.EffectiveConfiguration.PreventIncrementOfMergedBranchVersion.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.Tag.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.TagNumberPattern.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.TagPrefix.get -> string? -GitVersion.Model.Configuration.EffectiveConfiguration.TagPreReleaseWeight.get -> int -GitVersion.Model.Configuration.EffectiveConfiguration.TrackMergeTarget.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.TracksReleaseBranches.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.UpdateBuildNumber.get -> bool -GitVersion.Model.Configuration.EffectiveConfiguration.VersionFilters.get -> System.Collections.Generic.IEnumerable! -GitVersion.Model.Configuration.EffectiveConfiguration.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode -GitVersion.Model.Configuration.IgnoreConfig -GitVersion.Model.Configuration.IgnoreConfig.Before.get -> System.DateTimeOffset? -GitVersion.Model.Configuration.IgnoreConfig.Before.set -> void -GitVersion.Model.Configuration.IgnoreConfig.IgnoreConfig() -> void -GitVersion.Model.Configuration.IgnoreConfig.ShAs.get -> System.Collections.Generic.IEnumerable! -GitVersion.Model.Configuration.IgnoreConfig.ShAs.set -> void -GitVersion.Model.Exceptions.InfiniteLoopProtectionException -GitVersion.Model.Exceptions.InfiniteLoopProtectionException.InfiniteLoopProtectionException(string! messageFormat) -> void -GitVersion.Model.OutputType -GitVersion.Model.OutputType.BuildServer = 0 -> GitVersion.Model.OutputType -GitVersion.Model.OutputType.File = 2 -> GitVersion.Model.OutputType -GitVersion.Model.OutputType.Json = 1 -> GitVersion.Model.OutputType -GitVersion.OutputVariables.VersionVariables -GitVersion.OutputVariables.VersionVariables.AssemblySemFileVer.get -> string? -GitVersion.OutputVariables.VersionVariables.AssemblySemVer.get -> string? -GitVersion.OutputVariables.VersionVariables.BranchName.get -> string? -GitVersion.OutputVariables.VersionVariables.BuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariables.BuildMetaDataPadded.get -> string? -GitVersion.OutputVariables.VersionVariables.CommitDate.get -> string? -GitVersion.OutputVariables.VersionVariables.CommitDate.set -> void -GitVersion.OutputVariables.VersionVariables.CommitsSinceVersionSource.get -> string? -GitVersion.OutputVariables.VersionVariables.CommitsSinceVersionSourcePadded.get -> string? -GitVersion.OutputVariables.VersionVariables.EscapedBranchName.get -> string? -GitVersion.OutputVariables.VersionVariables.FileName.get -> string? -GitVersion.OutputVariables.VersionVariables.FileName.set -> void -GitVersion.OutputVariables.VersionVariables.FullBuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariables.FullSemVer.get -> string! -GitVersion.OutputVariables.VersionVariables.GetEnumerator() -> System.Collections.Generic.IEnumerator>! -GitVersion.OutputVariables.VersionVariables.InformationalVersion.get -> string? -GitVersion.OutputVariables.VersionVariables.LegacySemVer.get -> string! -GitVersion.OutputVariables.VersionVariables.LegacySemVerPadded.get -> string! -GitVersion.OutputVariables.VersionVariables.Major.get -> string! -GitVersion.OutputVariables.VersionVariables.MajorMinorPatch.get -> string! -GitVersion.OutputVariables.VersionVariables.Minor.get -> string! -GitVersion.OutputVariables.VersionVariables.NuGetPreReleaseTag.get -> string? -GitVersion.OutputVariables.VersionVariables.NuGetPreReleaseTagV2.get -> string? -GitVersion.OutputVariables.VersionVariables.NuGetVersion.get -> string! -GitVersion.OutputVariables.VersionVariables.NuGetVersionV2.get -> string! -GitVersion.OutputVariables.VersionVariables.Patch.get -> string! -GitVersion.OutputVariables.VersionVariables.PreReleaseLabel.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseLabelWithDash.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseNumber.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseTag.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseTagWithDash.get -> string? -GitVersion.OutputVariables.VersionVariables.SemVer.get -> string! -GitVersion.OutputVariables.VersionVariables.Sha.get -> string? -GitVersion.OutputVariables.VersionVariables.ShortSha.get -> string? -GitVersion.OutputVariables.VersionVariables.this[string! variable].get -> string? -GitVersion.OutputVariables.VersionVariables.TryGetValue(string! variable, out string? variableValue) -> bool -GitVersion.OutputVariables.VersionVariables.UncommittedChanges.get -> string? -GitVersion.OutputVariables.VersionVariables.VersionSourceSha.get -> string? -GitVersion.OutputVariables.VersionVariables.VersionVariables(string! major, string! minor, string! patch, string? buildMetaData, string? buildMetaDataPadded, string? fullBuildMetaData, string? branchName, string? escapedBranchName, string? sha, string? shortSha, string! majorMinorPatch, string! semVer, string! legacySemVer, string! legacySemVerPadded, string! fullSemVer, string? assemblySemVer, string? assemblySemFileVer, string? preReleaseTag, string? preReleaseTagWithDash, string? preReleaseLabel, string? preReleaseLabelWithDash, string? preReleaseNumber, string! weightedPreReleaseNumber, string? informationalVersion, string? commitDate, string! nugetVersion, string! nugetVersionV2, string? nugetPreReleaseTag, string? nugetPreReleaseTagV2, string? versionSourceSha, string? commitsSinceVersionSource, string? commitsSinceVersionSourcePadded, string? uncommittedChanges) -> void -GitVersion.OutputVariables.VersionVariables.WeightedPreReleaseNumber.get -> string! -GitVersion.OutputVariables.VersionVariablesJsonModel -GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemFileVer.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemFileVer.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemVer.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemVer.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.BranchName.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.BranchName.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.BuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.BuildMetaData.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.BuildMetaDataPadded.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.BuildMetaDataPadded.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitDate.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitDate.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitsSinceVersionSource.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitsSinceVersionSource.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitsSinceVersionSourcePadded.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.CommitsSinceVersionSourcePadded.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.EscapedBranchName.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.EscapedBranchName.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.FullBuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.FullBuildMetaData.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.FullSemVer.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.FullSemVer.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.InformationalVersion.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.InformationalVersion.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.LegacySemVer.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.LegacySemVer.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.LegacySemVerPadded.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.LegacySemVerPadded.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.Major.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.Major.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.MajorMinorPatch.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.MajorMinorPatch.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.Minor.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.Minor.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetPreReleaseTag.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetPreReleaseTag.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetPreReleaseTagV2.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetPreReleaseTagV2.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetVersion.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetVersion.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetVersionV2.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.NuGetVersionV2.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.Patch.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.Patch.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseLabel.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseLabel.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseLabelWithDash.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseLabelWithDash.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseNumber.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseNumber.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseTag.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseTag.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseTagWithDash.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.PreReleaseTagWithDash.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.SemVer.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.SemVer.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.Sha.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.Sha.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.ShortSha.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.ShortSha.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.UncommittedChanges.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.UncommittedChanges.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.VersionSourceSha.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.VersionSourceSha.set -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.VersionVariablesJsonModel() -> void -GitVersion.OutputVariables.VersionVariablesJsonModel.WeightedPreReleaseNumber.get -> string? -GitVersion.OutputVariables.VersionVariablesJsonModel.WeightedPreReleaseNumber.set -> void -GitVersion.OutputVariables.VersionVariablesJsonNumberConverter -GitVersion.OutputVariables.VersionVariablesJsonNumberConverter.VersionVariablesJsonNumberConverter() -> void -GitVersion.OutputVariables.VersionVariablesJsonStringConverter -GitVersion.OutputVariables.VersionVariablesJsonStringConverter.VersionVariablesJsonStringConverter() -> void -GitVersion.ReferenceName -GitVersion.ReferenceName.Canonical.get -> string! -GitVersion.ReferenceName.CompareTo(GitVersion.ReferenceName! other) -> int -GitVersion.ReferenceName.Equals(GitVersion.ReferenceName? other) -> bool -GitVersion.ReferenceName.EquivalentTo(string? name) -> bool -GitVersion.ReferenceName.Friendly.get -> string! -GitVersion.ReferenceName.IsBranch.get -> bool -GitVersion.ReferenceName.IsPullRequest.get -> bool -GitVersion.ReferenceName.IsRemoteBranch.get -> bool -GitVersion.ReferenceName.IsTag.get -> bool -GitVersion.ReferenceName.ReferenceName(string! canonical) -> void -GitVersion.ReferenceName.WithoutRemote.get -> string! -GitVersion.RefSpecDirection -GitVersion.RefSpecDirection.Fetch = 0 -> GitVersion.RefSpecDirection -GitVersion.RefSpecDirection.Push = 1 -> GitVersion.RefSpecDirection +GitVersion.OutputType +GitVersion.OutputType.BuildServer = 0 -> GitVersion.OutputType +GitVersion.OutputType.DotEnv = 3 -> GitVersion.OutputType +GitVersion.OutputType.File = 2 -> GitVersion.OutputType +GitVersion.OutputType.Json = 1 -> GitVersion.OutputType +GitVersion.OutputVariables.GitVersionVariables +GitVersion.OutputVariables.GitVersionVariables.AssemblySemFileVer.get -> string? +GitVersion.OutputVariables.GitVersionVariables.AssemblySemFileVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.AssemblySemVer.get -> string? +GitVersion.OutputVariables.GitVersionVariables.AssemblySemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.BranchName.get -> string? +GitVersion.OutputVariables.GitVersionVariables.BranchName.init -> void +GitVersion.OutputVariables.GitVersionVariables.BuildMetaData.get -> string? +GitVersion.OutputVariables.GitVersionVariables.BuildMetaData.init -> void +GitVersion.OutputVariables.GitVersionVariables.CommitDate.get -> string? +GitVersion.OutputVariables.GitVersionVariables.CommitDate.init -> void +GitVersion.OutputVariables.GitVersionVariables.CommitsSinceVersionSource.get -> string? +GitVersion.OutputVariables.GitVersionVariables.CommitsSinceVersionSource.init -> void +GitVersion.OutputVariables.GitVersionVariables.Deconstruct(out string! Major, out string! Minor, out string! Patch, out string? BuildMetaData, out string? FullBuildMetaData, out string? BranchName, out string? EscapedBranchName, out string? Sha, out string? ShortSha, out string! MajorMinorPatch, out string! SemVer, out string! FullSemVer, out string? AssemblySemVer, out string? AssemblySemFileVer, out string? PreReleaseTag, out string? PreReleaseTagWithDash, out string? PreReleaseLabel, out string? PreReleaseLabelWithDash, out string? PreReleaseNumber, out string! WeightedPreReleaseNumber, out string? InformationalVersion, out string? CommitDate, out string? VersionSourceSha, out string? CommitsSinceVersionSource, out string? UncommittedChanges) -> void +GitVersion.OutputVariables.GitVersionVariables.EscapedBranchName.get -> string? +GitVersion.OutputVariables.GitVersionVariables.EscapedBranchName.init -> void +GitVersion.OutputVariables.GitVersionVariables.FullBuildMetaData.get -> string? +GitVersion.OutputVariables.GitVersionVariables.FullBuildMetaData.init -> void +GitVersion.OutputVariables.GitVersionVariables.FullSemVer.get -> string! +GitVersion.OutputVariables.GitVersionVariables.FullSemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.GetEnumerator() -> System.Collections.Generic.IEnumerator>! +GitVersion.OutputVariables.GitVersionVariables.GitVersionVariables(GitVersion.OutputVariables.GitVersionVariables! original) -> void +GitVersion.OutputVariables.GitVersionVariables.GitVersionVariables(string! Major, string! Minor, string! Patch, string? BuildMetaData, string? FullBuildMetaData, string? BranchName, string? EscapedBranchName, string? Sha, string? ShortSha, string! MajorMinorPatch, string! SemVer, string! FullSemVer, string? AssemblySemVer, string? AssemblySemFileVer, string? PreReleaseTag, string? PreReleaseTagWithDash, string? PreReleaseLabel, string? PreReleaseLabelWithDash, string? PreReleaseNumber, string! WeightedPreReleaseNumber, string? InformationalVersion, string? CommitDate, string? VersionSourceSha, string? CommitsSinceVersionSource, string? UncommittedChanges) -> void +GitVersion.OutputVariables.GitVersionVariables.InformationalVersion.get -> string? +GitVersion.OutputVariables.GitVersionVariables.InformationalVersion.init -> void +GitVersion.OutputVariables.GitVersionVariables.Major.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Major.init -> void +GitVersion.OutputVariables.GitVersionVariables.MajorMinorPatch.get -> string! +GitVersion.OutputVariables.GitVersionVariables.MajorMinorPatch.init -> void +GitVersion.OutputVariables.GitVersionVariables.Minor.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Minor.init -> void +GitVersion.OutputVariables.GitVersionVariables.Patch.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Patch.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabel.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabel.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabelWithDash.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabelWithDash.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseNumber.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseNumber.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTag.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTag.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTagWithDash.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTagWithDash.init -> void +GitVersion.OutputVariables.GitVersionVariables.SemVer.get -> string! +GitVersion.OutputVariables.GitVersionVariables.SemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.Sha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.Sha.init -> void +GitVersion.OutputVariables.GitVersionVariables.ShortSha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.ShortSha.init -> void +GitVersion.OutputVariables.GitVersionVariables.TryGetValue(string! variable, out string? variableValue) -> bool +GitVersion.OutputVariables.GitVersionVariables.UncommittedChanges.get -> string? +GitVersion.OutputVariables.GitVersionVariables.UncommittedChanges.init -> void +GitVersion.OutputVariables.GitVersionVariables.VersionSourceSha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.VersionSourceSha.init -> void +GitVersion.OutputVariables.GitVersionVariables.WeightedPreReleaseNumber.get -> string! +GitVersion.OutputVariables.GitVersionVariables.WeightedPreReleaseNumber.init -> void +GitVersion.OutputVariables.IVersionVariableSerializer +GitVersion.OutputVariables.IVersionVariableSerializer.FromFile(string! filePath) -> GitVersion.OutputVariables.GitVersionVariables! +GitVersion.OutputVariables.IVersionVariableSerializer.ToFile(GitVersion.OutputVariables.GitVersionVariables! gitVersionVariables, string! filePath) -> void +GitVersion.OutputVariables.IVersionVariableSerializer.ToJson(GitVersion.OutputVariables.GitVersionVariables! gitVersionVariables) -> string! GitVersion.RepositoryInfo GitVersion.RepositoryInfo.ClonePath -> string? GitVersion.RepositoryInfo.CommitId -> string? GitVersion.RepositoryInfo.RepositoryInfo() -> void +GitVersion.RepositoryInfo.RepositoryInfo(GitVersion.RepositoryInfo! original) -> void GitVersion.RepositoryInfo.TargetBranch -> string? GitVersion.RepositoryInfo.TargetUrl -> string? -GitVersion.RepositoryStore -GitVersion.RepositoryStore.ExcludingBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.FindBranch(string? branchName) -> GitVersion.IBranch? -GitVersion.RepositoryStore.FindCommitBranchWasBranchedFrom(GitVersion.IBranch? branch, GitVersion.Model.Configuration.Config! configuration, params GitVersion.IBranch![]! excludedBranches) -> GitVersion.BranchCommit -GitVersion.RepositoryStore.FindMainBranch(GitVersion.Model.Configuration.Config! configuration) -> GitVersion.IBranch? -GitVersion.RepositoryStore.FindMergeBase(GitVersion.IBranch? branch, GitVersion.IBranch? otherBranch) -> GitVersion.ICommit? -GitVersion.RepositoryStore.FindMergeBase(GitVersion.ICommit! commit, GitVersion.ICommit! mainlineTip) -> GitVersion.ICommit? -GitVersion.RepositoryStore.GetBaseVersionSource(GitVersion.ICommit! currentBranchTip) -> GitVersion.ICommit! -GitVersion.RepositoryStore.GetBranchesContainingCommit(GitVersion.ICommit? commit, System.Collections.Generic.IEnumerable? branches = null, bool onlyTrackedBranches = false) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetBranchesForCommit(GitVersion.ICommit! commit) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetChosenBranch(GitVersion.Model.Configuration.Config! configuration) -> GitVersion.IBranch? -GitVersion.RepositoryStore.GetCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? currentCommit) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetCurrentCommit(GitVersion.IBranch! currentBranch, string? commitId) -> GitVersion.ICommit? -GitVersion.RepositoryStore.GetCurrentCommitTaggedVersion(GitVersion.ICommit? commit, string? tagPrefix, bool handleDetachedBranch) -> GitVersion.SemanticVersion! -GitVersion.RepositoryStore.GetExcludedInheritBranches(GitVersion.Model.Configuration.Config! configuration) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetMainlineBranches(GitVersion.ICommit! commit, GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IEnumerable>? mainlineBranchConfigs) -> System.Collections.Generic.IDictionary!>! -GitVersion.RepositoryStore.GetMainlineCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? mainlineTip) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetMergeBaseCommits(GitVersion.ICommit? mergeCommit, GitVersion.ICommit? mergedHead, GitVersion.ICommit? findMergeBase) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetNumberOfUncommittedChanges() -> int -GitVersion.RepositoryStore.GetReleaseBranches(System.Collections.Generic.IEnumerable>! releaseBranchConfig) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.IBranch! -GitVersion.RepositoryStore.GetValidVersionTags(string? tagPrefixRegex, System.DateTimeOffset? olderThan = null) -> System.Collections.Generic.IEnumerable<(GitVersion.ITag! Tag, GitVersion.SemanticVersion! Semver, GitVersion.ICommit! Commit)>! -GitVersion.RepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? tagPrefixRegex) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool -GitVersion.RepositoryStore.RepositoryStore(GitVersion.Logging.ILog! log, GitVersion.IGitRepository! repository) -> void GitVersion.SemanticVersion -GitVersion.SemanticVersion.BuildMetaData -> GitVersion.SemanticVersionBuildMetaData? -GitVersion.SemanticVersion.CompareTo(GitVersion.SemanticVersion! value) -> int -GitVersion.SemanticVersion.CompareTo(GitVersion.SemanticVersion? value, bool includePrerelease) -> int +GitVersion.SemanticVersion.BuildMetaData.get -> GitVersion.SemanticVersionBuildMetaData! +GitVersion.SemanticVersion.BuildMetaData.init -> void +GitVersion.SemanticVersion.CompareTo(GitVersion.SemanticVersion? value, bool includePreRelease) -> int +GitVersion.SemanticVersion.CompareTo(GitVersion.SemanticVersion? value) -> int GitVersion.SemanticVersion.Equals(GitVersion.SemanticVersion? obj) -> bool -GitVersion.SemanticVersion.IncrementVersion(GitVersion.VersionField incrementStrategy) -> GitVersion.SemanticVersion! +GitVersion.SemanticVersion.Increment(GitVersion.VersionField increment, string? label, bool forceIncrement, params GitVersion.SemanticVersion?[]! alternativeSemanticVersions) -> GitVersion.SemanticVersion! +GitVersion.SemanticVersion.Increment(GitVersion.VersionField increment, string? label, GitVersion.SemanticVersion.IncrementMode mode, params GitVersion.SemanticVersion?[]! alternativeSemanticVersions) -> GitVersion.SemanticVersion! +GitVersion.SemanticVersion.Increment(GitVersion.VersionField increment, string? label, params GitVersion.SemanticVersion?[]! alternativeSemanticVersions) -> GitVersion.SemanticVersion! +GitVersion.SemanticVersion.IncrementMode +GitVersion.SemanticVersion.IncrementMode.EnsureIntegrity = 2 -> GitVersion.SemanticVersion.IncrementMode +GitVersion.SemanticVersion.IncrementMode.Force = 1 -> GitVersion.SemanticVersion.IncrementMode +GitVersion.SemanticVersion.IncrementMode.Standard = 0 -> GitVersion.SemanticVersion.IncrementMode GitVersion.SemanticVersion.IsEmpty() -> bool -GitVersion.SemanticVersion.Major -> long -GitVersion.SemanticVersion.Minor -> long -GitVersion.SemanticVersion.Patch -> long -GitVersion.SemanticVersion.PreReleaseTag -> GitVersion.SemanticVersionPreReleaseTag? -GitVersion.SemanticVersion.SemanticVersion(GitVersion.SemanticVersion? semanticVersion) -> void +GitVersion.SemanticVersion.IsEqualTo(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool +GitVersion.SemanticVersion.IsGreaterThan(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool +GitVersion.SemanticVersion.IsGreaterThanOrEqualTo(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool +GitVersion.SemanticVersion.IsLabeledWith(string! value) -> bool +GitVersion.SemanticVersion.IsLessThan(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool +GitVersion.SemanticVersion.IsLessThanOrEqualTo(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool +GitVersion.SemanticVersion.IsMatchForBranchSpecificLabel(string? value) -> bool +GitVersion.SemanticVersion.IsPreRelease.get -> bool +GitVersion.SemanticVersion.Major.get -> long +GitVersion.SemanticVersion.Major.init -> void +GitVersion.SemanticVersion.Minor.get -> long +GitVersion.SemanticVersion.Minor.init -> void +GitVersion.SemanticVersion.Patch.get -> long +GitVersion.SemanticVersion.Patch.init -> void +GitVersion.SemanticVersion.PreReleaseTag.get -> GitVersion.SemanticVersionPreReleaseTag! +GitVersion.SemanticVersion.PreReleaseTag.init -> void +GitVersion.SemanticVersion.SemanticVersion(GitVersion.SemanticVersion! semanticVersion) -> void GitVersion.SemanticVersion.SemanticVersion(long major = 0, long minor = 0, long patch = 0) -> void GitVersion.SemanticVersion.ToString(string! format) -> string! GitVersion.SemanticVersion.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +GitVersion.SemanticVersion.WithLabel(string? label) -> GitVersion.SemanticVersion! GitVersion.SemanticVersionBuildMetaData -GitVersion.SemanticVersionBuildMetaData.Branch -> string? -GitVersion.SemanticVersionBuildMetaData.CommitDate -> System.DateTimeOffset? -GitVersion.SemanticVersionBuildMetaData.CommitsSinceTag -> long? -GitVersion.SemanticVersionBuildMetaData.CommitsSinceVersionSource -> long? +GitVersion.SemanticVersionBuildMetaData.Branch.get -> string? +GitVersion.SemanticVersionBuildMetaData.Branch.init -> void +GitVersion.SemanticVersionBuildMetaData.CommitDate.get -> System.DateTimeOffset? +GitVersion.SemanticVersionBuildMetaData.CommitDate.init -> void +GitVersion.SemanticVersionBuildMetaData.CommitsSinceTag.get -> long? +GitVersion.SemanticVersionBuildMetaData.CommitsSinceTag.init -> void +GitVersion.SemanticVersionBuildMetaData.CommitsSinceVersionSource.get -> long +GitVersion.SemanticVersionBuildMetaData.CommitsSinceVersionSource.init -> void GitVersion.SemanticVersionBuildMetaData.Equals(GitVersion.SemanticVersionBuildMetaData? other) -> bool -GitVersion.SemanticVersionBuildMetaData.OtherMetaData -> string? +GitVersion.SemanticVersionBuildMetaData.OtherMetaData.get -> string? +GitVersion.SemanticVersionBuildMetaData.OtherMetaData.init -> void GitVersion.SemanticVersionBuildMetaData.SemanticVersionBuildMetaData() -> void -GitVersion.SemanticVersionBuildMetaData.SemanticVersionBuildMetaData(GitVersion.SemanticVersionBuildMetaData? buildMetaData) -> void -GitVersion.SemanticVersionBuildMetaData.SemanticVersionBuildMetaData(string? versionSourceSha, int? commitsSinceTag, string? branch, string? commitSha, string? commitShortSha, System.DateTimeOffset? commitDate, int numberOfUnCommittedChanges, string? otherMetadata = null) -> void -GitVersion.SemanticVersionBuildMetaData.Sha -> string? -GitVersion.SemanticVersionBuildMetaData.ShortSha -> string? +GitVersion.SemanticVersionBuildMetaData.SemanticVersionBuildMetaData(GitVersion.SemanticVersionBuildMetaData! buildMetaData) -> void +GitVersion.SemanticVersionBuildMetaData.SemanticVersionBuildMetaData(string? versionSourceSha, long? commitsSinceTag, string? branch, string? commitSha, string? commitShortSha, System.DateTimeOffset? commitDate, long numberOfUnCommittedChanges, string? otherMetadata = null) -> void +GitVersion.SemanticVersionBuildMetaData.Sha.get -> string? +GitVersion.SemanticVersionBuildMetaData.Sha.init -> void +GitVersion.SemanticVersionBuildMetaData.ShortSha.get -> string? +GitVersion.SemanticVersionBuildMetaData.ShortSha.init -> void GitVersion.SemanticVersionBuildMetaData.ToString(string! format) -> string! GitVersion.SemanticVersionBuildMetaData.ToString(string? format, System.IFormatProvider? formatProvider) -> string! -GitVersion.SemanticVersionBuildMetaData.UncommittedChanges -> long -GitVersion.SemanticVersionBuildMetaData.VersionSourceSha -> string? +GitVersion.SemanticVersionBuildMetaData.UncommittedChanges.get -> long +GitVersion.SemanticVersionBuildMetaData.UncommittedChanges.init -> void +GitVersion.SemanticVersionBuildMetaData.VersionSourceSha.get -> string? +GitVersion.SemanticVersionBuildMetaData.VersionSourceSha.init -> void +GitVersion.SemanticVersionFormat +GitVersion.SemanticVersionFormat.Loose = 1 -> GitVersion.SemanticVersionFormat +GitVersion.SemanticVersionFormat.Strict = 0 -> GitVersion.SemanticVersionFormat GitVersion.SemanticVersionFormatValues GitVersion.SemanticVersionFormatValues.AssemblyFileSemVer.get -> string? GitVersion.SemanticVersionFormatValues.AssemblySemVer.get -> string? GitVersion.SemanticVersionFormatValues.BranchName.get -> string? -GitVersion.SemanticVersionFormatValues.BuildMetaData.get -> string? -GitVersion.SemanticVersionFormatValues.BuildMetaDataPadded.get -> string? +GitVersion.SemanticVersionFormatValues.BuildMetaData.get -> string! GitVersion.SemanticVersionFormatValues.CommitDate.get -> string? -GitVersion.SemanticVersionFormatValues.CommitsSinceVersionSource.get -> string? -GitVersion.SemanticVersionFormatValues.CommitsSinceVersionSourcePadded.get -> string? -GitVersion.SemanticVersionFormatValues.DefaultInformationalVersion.get -> string! +GitVersion.SemanticVersionFormatValues.CommitsSinceVersionSource.get -> string! GitVersion.SemanticVersionFormatValues.EscapedBranchName.get -> string? -GitVersion.SemanticVersionFormatValues.FullBuildMetaData.get -> string? +GitVersion.SemanticVersionFormatValues.FullBuildMetaData.get -> string! GitVersion.SemanticVersionFormatValues.FullSemVer.get -> string! GitVersion.SemanticVersionFormatValues.InformationalVersion.get -> string! -GitVersion.SemanticVersionFormatValues.LegacySemVer.get -> string! -GitVersion.SemanticVersionFormatValues.LegacySemVerPadded.get -> string! GitVersion.SemanticVersionFormatValues.Major.get -> string! GitVersion.SemanticVersionFormatValues.MajorMinorPatch.get -> string! GitVersion.SemanticVersionFormatValues.Minor.get -> string! -GitVersion.SemanticVersionFormatValues.NuGetPreReleaseTag.get -> string? -GitVersion.SemanticVersionFormatValues.NuGetPreReleaseTagV2.get -> string? -GitVersion.SemanticVersionFormatValues.NuGetVersion.get -> string! -GitVersion.SemanticVersionFormatValues.NuGetVersionV2.get -> string! GitVersion.SemanticVersionFormatValues.Patch.get -> string! -GitVersion.SemanticVersionFormatValues.PreReleaseLabel.get -> string? -GitVersion.SemanticVersionFormatValues.PreReleaseLabelWithDash.get -> string? -GitVersion.SemanticVersionFormatValues.PreReleaseNumber.get -> string? -GitVersion.SemanticVersionFormatValues.PreReleaseTag.get -> string? -GitVersion.SemanticVersionFormatValues.PreReleaseTagWithDash.get -> string? -GitVersion.SemanticVersionFormatValues.SemanticVersionFormatValues(GitVersion.SemanticVersion! semver, GitVersion.Model.Configuration.EffectiveConfiguration! config) -> void +GitVersion.SemanticVersionFormatValues.PreReleaseLabel.get -> string! +GitVersion.SemanticVersionFormatValues.PreReleaseLabelWithDash.get -> string! +GitVersion.SemanticVersionFormatValues.PreReleaseNumber.get -> string! +GitVersion.SemanticVersionFormatValues.PreReleaseTag.get -> string! +GitVersion.SemanticVersionFormatValues.PreReleaseTagWithDash.get -> string! +GitVersion.SemanticVersionFormatValues.SemanticVersionFormatValues(GitVersion.SemanticVersion! semver, GitVersion.Configuration.IGitVersionConfiguration! configuration, int preReleaseWeight) -> void GitVersion.SemanticVersionFormatValues.SemVer.get -> string! GitVersion.SemanticVersionFormatValues.Sha.get -> string? GitVersion.SemanticVersionFormatValues.ShortSha.get -> string? -GitVersion.SemanticVersionFormatValues.UncommittedChanges.get -> string? +GitVersion.SemanticVersionFormatValues.UncommittedChanges.get -> string! GitVersion.SemanticVersionFormatValues.VersionSourceSha.get -> string? GitVersion.SemanticVersionFormatValues.WeightedPreReleaseNumber.get -> string! GitVersion.SemanticVersionPreReleaseTag GitVersion.SemanticVersionPreReleaseTag.CompareTo(GitVersion.SemanticVersionPreReleaseTag? other) -> int GitVersion.SemanticVersionPreReleaseTag.Equals(GitVersion.SemanticVersionPreReleaseTag? other) -> bool GitVersion.SemanticVersionPreReleaseTag.HasTag() -> bool -GitVersion.SemanticVersionPreReleaseTag.Name.get -> string? -GitVersion.SemanticVersionPreReleaseTag.Name.set -> void +GitVersion.SemanticVersionPreReleaseTag.Name.get -> string! +GitVersion.SemanticVersionPreReleaseTag.Name.init -> void GitVersion.SemanticVersionPreReleaseTag.Number.get -> long? -GitVersion.SemanticVersionPreReleaseTag.Number.set -> void -GitVersion.SemanticVersionPreReleaseTag.PromotedFromCommits.get -> bool? -GitVersion.SemanticVersionPreReleaseTag.PromotedFromCommits.set -> void +GitVersion.SemanticVersionPreReleaseTag.Number.init -> void +GitVersion.SemanticVersionPreReleaseTag.PromoteTagEvenIfNameIsEmpty.get -> bool +GitVersion.SemanticVersionPreReleaseTag.PromoteTagEvenIfNameIsEmpty.init -> void GitVersion.SemanticVersionPreReleaseTag.SemanticVersionPreReleaseTag() -> void -GitVersion.SemanticVersionPreReleaseTag.SemanticVersionPreReleaseTag(GitVersion.SemanticVersionPreReleaseTag? preReleaseTag) -> void -GitVersion.SemanticVersionPreReleaseTag.SemanticVersionPreReleaseTag(string? name, long? number) -> void +GitVersion.SemanticVersionPreReleaseTag.SemanticVersionPreReleaseTag(GitVersion.SemanticVersionPreReleaseTag! preReleaseTag) -> void +GitVersion.SemanticVersionPreReleaseTag.SemanticVersionPreReleaseTag(string! name, long? number, bool promoteTagEvenIfNameIsEmpty) -> void GitVersion.SemanticVersionPreReleaseTag.ToString(string! format) -> string! GitVersion.SemanticVersionPreReleaseTag.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +GitVersion.SemanticVersionWithTag +GitVersion.SemanticVersionWithTag.$() -> GitVersion.SemanticVersionWithTag! +GitVersion.SemanticVersionWithTag.CompareTo(GitVersion.SemanticVersionWithTag? other) -> int +GitVersion.SemanticVersionWithTag.Deconstruct(out GitVersion.SemanticVersion! Value, out GitVersion.Git.ITag! Tag) -> void +GitVersion.SemanticVersionWithTag.Equals(GitVersion.SemanticVersionWithTag? other) -> bool +GitVersion.SemanticVersionWithTag.SemanticVersionWithTag(GitVersion.SemanticVersion! Value, GitVersion.Git.ITag! Tag) -> void +GitVersion.SemanticVersionWithTag.Tag.get -> GitVersion.Git.ITag! +GitVersion.SemanticVersionWithTag.Tag.init -> void +GitVersion.SemanticVersionWithTag.Value.get -> GitVersion.SemanticVersion! +GitVersion.SemanticVersionWithTag.Value.init -> void GitVersion.Settings +GitVersion.Settings.AllowShallow -> bool GitVersion.Settings.NoCache -> bool GitVersion.Settings.NoFetch -> bool GitVersion.Settings.NoNormalize -> bool GitVersion.Settings.OnlyTrackedBranches -> bool GitVersion.Settings.Settings() -> void +GitVersion.Settings.Settings(GitVersion.Settings! original) -> void GitVersion.VersionCalculation.BaseVersion -GitVersion.VersionCalculation.BaseVersion.BaseVersion(string! source, bool shouldIncrement, GitVersion.SemanticVersion! semanticVersion, GitVersion.ICommit? baseVersionSource, string? branchNameOverride) -> void -GitVersion.VersionCalculation.BaseVersion.BaseVersionSource.get -> GitVersion.ICommit? -GitVersion.VersionCalculation.BaseVersion.BranchNameOverride.get -> string? +GitVersion.VersionCalculation.BaseVersion.$() -> GitVersion.VersionCalculation.BaseVersion! +GitVersion.VersionCalculation.BaseVersion.BaseVersion() -> void +GitVersion.VersionCalculation.BaseVersion.BaseVersion(GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void +GitVersion.VersionCalculation.BaseVersion.BaseVersion(string! source, GitVersion.SemanticVersion! semanticVersion, GitVersion.Git.ICommit? baseVersionSource = null) -> void +GitVersion.VersionCalculation.BaseVersion.BaseVersionSource.get -> GitVersion.Git.ICommit? +GitVersion.VersionCalculation.BaseVersion.Deconstruct(out GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void +GitVersion.VersionCalculation.BaseVersion.Equals(GitVersion.VersionCalculation.BaseVersion? other) -> bool +GitVersion.VersionCalculation.BaseVersion.GetIncrementedVersion() -> GitVersion.SemanticVersion! +GitVersion.VersionCalculation.BaseVersion.Operand.get -> GitVersion.VersionCalculation.BaseVersionOperand! +GitVersion.VersionCalculation.BaseVersion.Operand.init -> void +GitVersion.VersionCalculation.BaseVersion.Operator.get -> GitVersion.VersionCalculation.BaseVersionOperator? +GitVersion.VersionCalculation.BaseVersion.Operator.init -> void GitVersion.VersionCalculation.BaseVersion.SemanticVersion.get -> GitVersion.SemanticVersion! GitVersion.VersionCalculation.BaseVersion.ShouldIncrement.get -> bool GitVersion.VersionCalculation.BaseVersion.Source.get -> string! -GitVersion.VersionCalculation.BaseVersionCalculator -GitVersion.VersionCalculation.BaseVersionCalculator.BaseVersionCalculator(GitVersion.Logging.ILog! log, GitVersion.Common.IRepositoryStore! repositoryStore, GitVersion.Configuration.IBranchConfigurationCalculator! branchConfigurationCalculator, GitVersion.VersionCalculation.IIncrementStrategyFinder! incrementStrategyFinder, System.Lazy! versionContext, System.Collections.Generic.IEnumerable! strategies) -> void -GitVersion.VersionCalculation.BaseVersionCalculator.GetBaseVersion() -> (GitVersion.VersionCalculation.BaseVersion!, GitVersion.Model.Configuration.EffectiveBranchConfiguration!) -GitVersion.VersionCalculation.Cache.GitVersionCache -GitVersion.VersionCalculation.Cache.GitVersionCache.GetCacheDirectory() -> string! -GitVersion.VersionCalculation.Cache.GitVersionCache.GitVersionCache(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.VersionCalculation.Cache.GitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.Cache.GitVersionCacheKey! key) -> GitVersion.OutputVariables.VersionVariables? -GitVersion.VersionCalculation.Cache.GitVersionCache.WriteVariablesToDiskCache(GitVersion.Cache.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.VersionVariables! variablesFromCache) -> void -GitVersion.VersionCalculation.Cache.GitVersionCacheKeyFactory -GitVersion.VersionCalculation.Cache.GitVersionCacheKeyFactory.Create(GitVersion.Model.Configuration.Config? overrideConfig) -> GitVersion.Cache.GitVersionCacheKey! -GitVersion.VersionCalculation.Cache.GitVersionCacheKeyFactory.GitVersionCacheKeyFactory(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, Microsoft.Extensions.Options.IOptions! options, GitVersion.Configuration.IConfigFileLocator! configFileLocator, GitVersion.IGitRepository! gitRepository, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.VersionCalculation.Cache.IGitVersionCache -GitVersion.VersionCalculation.Cache.IGitVersionCache.GetCacheDirectory() -> string! -GitVersion.VersionCalculation.Cache.IGitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.Cache.GitVersionCacheKey! key) -> GitVersion.OutputVariables.VersionVariables? -GitVersion.VersionCalculation.Cache.IGitVersionCache.WriteVariablesToDiskCache(GitVersion.Cache.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.VersionVariables! variablesFromCache) -> void -GitVersion.VersionCalculation.Cache.IGitVersionCacheKeyFactory -GitVersion.VersionCalculation.Cache.IGitVersionCacheKeyFactory.Create(GitVersion.Model.Configuration.Config? overrideConfig) -> GitVersion.Cache.GitVersionCacheKey! +GitVersion.VersionCalculation.BaseVersionOperand +GitVersion.VersionCalculation.BaseVersionOperand.$() -> GitVersion.VersionCalculation.BaseVersionOperand! +GitVersion.VersionCalculation.BaseVersionOperand.BaseVersionOperand() -> void +GitVersion.VersionCalculation.BaseVersionOperand.BaseVersionOperand(string! Source, GitVersion.SemanticVersion! SemanticVersion, GitVersion.Git.ICommit? BaseVersionSource = null) -> void +GitVersion.VersionCalculation.BaseVersionOperand.BaseVersionSource.get -> GitVersion.Git.ICommit? +GitVersion.VersionCalculation.BaseVersionOperand.BaseVersionSource.init -> void +GitVersion.VersionCalculation.BaseVersionOperand.Deconstruct(out string! Source, out GitVersion.SemanticVersion! SemanticVersion, out GitVersion.Git.ICommit? BaseVersionSource) -> void +GitVersion.VersionCalculation.BaseVersionOperand.Equals(GitVersion.VersionCalculation.BaseVersionOperand? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperand.SemanticVersion.get -> GitVersion.SemanticVersion! +GitVersion.VersionCalculation.BaseVersionOperand.SemanticVersion.init -> void +GitVersion.VersionCalculation.BaseVersionOperand.Source.get -> string! +GitVersion.VersionCalculation.BaseVersionOperand.Source.init -> void +GitVersion.VersionCalculation.BaseVersionOperator +GitVersion.VersionCalculation.BaseVersionOperator.$() -> GitVersion.VersionCalculation.BaseVersionOperator! +GitVersion.VersionCalculation.BaseVersionOperator.AlternativeSemanticVersion.get -> GitVersion.SemanticVersion? +GitVersion.VersionCalculation.BaseVersionOperator.AlternativeSemanticVersion.init -> void +GitVersion.VersionCalculation.BaseVersionOperator.BaseVersionOperator() -> void +GitVersion.VersionCalculation.BaseVersionOperator.BaseVersionSource.get -> GitVersion.Git.ICommit? +GitVersion.VersionCalculation.BaseVersionOperator.BaseVersionSource.init -> void +GitVersion.VersionCalculation.BaseVersionOperator.Equals(GitVersion.VersionCalculation.BaseVersionOperator? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperator.ForceIncrement.get -> bool +GitVersion.VersionCalculation.BaseVersionOperator.ForceIncrement.init -> void +GitVersion.VersionCalculation.BaseVersionOperator.Increment.get -> GitVersion.VersionField +GitVersion.VersionCalculation.BaseVersionOperator.Increment.init -> void +GitVersion.VersionCalculation.BaseVersionOperator.Label.get -> string? +GitVersion.VersionCalculation.BaseVersionOperator.Label.init -> void +GitVersion.VersionCalculation.BaseVersionOperator.Source.get -> string! +GitVersion.VersionCalculation.BaseVersionOperator.Source.init -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Deconstruct(out string! Value) -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GitVersionCacheKey(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! original) -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GitVersionCacheKey(string! Value) -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Value.get -> string! +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Value.init -> void +GitVersion.VersionCalculation.Caching.IGitVersionCacheProvider +GitVersion.VersionCalculation.Caching.IGitVersionCacheProvider.LoadVersionVariablesFromDiskCache() -> GitVersion.OutputVariables.GitVersionVariables? +GitVersion.VersionCalculation.Caching.IGitVersionCacheProvider.WriteVariablesToDiskCache(GitVersion.OutputVariables.GitVersionVariables! versionVariables) -> void GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.Disabled = 1 -> GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.Enabled = 0 -> GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.MergeMessageOnly = 2 -> GitVersion.VersionCalculation.CommitMessageIncrementMode -GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy -GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy.ConfigNextVersionVersionStrategy(System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.FallbackVersionStrategy -GitVersion.VersionCalculation.FallbackVersionStrategy.FallbackVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.IBaseVersionCalculator -GitVersion.VersionCalculation.IBaseVersionCalculator.GetBaseVersion() -> (GitVersion.VersionCalculation.BaseVersion!, GitVersion.Model.Configuration.EffectiveBranchConfiguration!) +GitVersion.VersionCalculation.DeploymentMode +GitVersion.VersionCalculation.DeploymentMode.ContinuousDelivery = 1 -> GitVersion.VersionCalculation.DeploymentMode +GitVersion.VersionCalculation.DeploymentMode.ContinuousDeployment = 2 -> GitVersion.VersionCalculation.DeploymentMode +GitVersion.VersionCalculation.DeploymentMode.ManualDeployment = 0 -> GitVersion.VersionCalculation.DeploymentMode +GitVersion.VersionCalculation.IBaseVersion +GitVersion.VersionCalculation.IBaseVersion.SemanticVersion.get -> GitVersion.SemanticVersion! +GitVersion.VersionCalculation.IBaseVersionIncrement +GitVersion.VersionCalculation.IBaseVersionIncrement.BaseVersionSource.get -> GitVersion.Git.ICommit? +GitVersion.VersionCalculation.IBaseVersionIncrement.Source.get -> string! +GitVersion.VersionCalculation.IDeploymentModeCalculator +GitVersion.VersionCalculation.IDeploymentModeCalculator.Calculate(GitVersion.SemanticVersion! semanticVersion, GitVersion.Git.ICommit? baseVersionSource) -> GitVersion.SemanticVersion! +GitVersion.VersionCalculation.IEffectiveBranchConfigurationFinder +GitVersion.VersionCalculation.IEffectiveBranchConfigurationFinder.GetConfigurations(GitVersion.Git.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IEnumerable! GitVersion.VersionCalculation.IIncrementStrategyFinder -GitVersion.VersionCalculation.IIncrementStrategyFinder.DetermineIncrementedField(GitVersion.GitVersionContext! context, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.Model.Configuration.EffectiveConfiguration! configuration) -> GitVersion.VersionField -GitVersion.VersionCalculation.IIncrementStrategyFinder.GetIncrementForCommits(GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IEnumerable! commits) -> GitVersion.VersionField? -GitVersion.VersionCalculation.IMainlineVersionCalculator -GitVersion.VersionCalculation.IMainlineVersionCalculator.CreateVersionBuildMetaData(GitVersion.ICommit? baseVersionSource) -> GitVersion.SemanticVersionBuildMetaData! -GitVersion.VersionCalculation.IMainlineVersionCalculator.FindMainlineModeVersion(GitVersion.VersionCalculation.BaseVersion! baseVersion) -> GitVersion.SemanticVersion! -GitVersion.VersionCalculation.IncrementStrategyFinder -GitVersion.VersionCalculation.IncrementStrategyFinder.DetermineIncrementedField(GitVersion.GitVersionContext! context, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.Model.Configuration.EffectiveConfiguration! configuration) -> GitVersion.VersionField -GitVersion.VersionCalculation.IncrementStrategyFinder.GetIncrementForCommits(GitVersion.Model.Configuration.Config! configuration, System.Collections.Generic.IEnumerable! commits) -> GitVersion.VersionField? -GitVersion.VersionCalculation.IncrementStrategyFinder.IncrementStrategyFinder(GitVersion.IGitRepository! repository) -> void +GitVersion.VersionCalculation.IIncrementStrategyFinder.DetermineIncrementedField(GitVersion.Git.ICommit! currentCommit, GitVersion.Git.ICommit? baseVersionSource, bool shouldIncrement, GitVersion.Configuration.EffectiveConfiguration! configuration, string? label) -> GitVersion.VersionField +GitVersion.VersionCalculation.IIncrementStrategyFinder.GetIncrementForcedByCommit(GitVersion.Git.ICommit! commit, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> GitVersion.VersionField +GitVersion.VersionCalculation.IIncrementStrategyFinder.GetMergedCommits(GitVersion.Git.ICommit! mergeCommit, int index, GitVersion.Configuration.IIgnoreConfiguration! ignore) -> System.Collections.Generic.IEnumerable! GitVersion.VersionCalculation.INextVersionCalculator -GitVersion.VersionCalculation.INextVersionCalculator.FindVersion() -> GitVersion.VersionCalculation.NextVersion! +GitVersion.VersionCalculation.INextVersionCalculator.FindVersion() -> GitVersion.SemanticVersion! GitVersion.VersionCalculation.IVariableProvider -GitVersion.VersionCalculation.IVariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Model.Configuration.EffectiveConfiguration! config, bool isCurrentCommitTagged) -> GitVersion.OutputVariables.VersionVariables! +GitVersion.VersionCalculation.IVariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Configuration.IGitVersionConfiguration! configuration, int preReleaseWeight) -> GitVersion.OutputVariables.GitVersionVariables! GitVersion.VersionCalculation.IVersionFilter -GitVersion.VersionCalculation.IVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion! version, out string? reason) -> bool +GitVersion.VersionCalculation.IVersionFilter.Exclude(GitVersion.Git.ICommit? commit, out string? reason) -> bool +GitVersion.VersionCalculation.IVersionFilter.Exclude(GitVersion.VersionCalculation.IBaseVersion! baseVersion, out string? reason) -> bool GitVersion.VersionCalculation.IVersionStrategy -GitVersion.VersionCalculation.IVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -GitVersion.VersionCalculation.MergeMessageVersionStrategy -GitVersion.VersionCalculation.MergeMessageVersionStrategy.MergeMessageVersionStrategy(GitVersion.Logging.ILog! log, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.MinDateVersionFilter -GitVersion.VersionCalculation.MinDateVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion! version, out string? reason) -> bool -GitVersion.VersionCalculation.MinDateVersionFilter.MinDateVersionFilter(System.DateTimeOffset minimum) -> void +GitVersion.VersionCalculation.IVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! GitVersion.VersionCalculation.NextVersion -GitVersion.VersionCalculation.NextVersion.BaseVersion.get -> GitVersion.VersionCalculation.BaseVersion! -GitVersion.VersionCalculation.NextVersion.BaseVersion.set -> void -GitVersion.VersionCalculation.NextVersion.Branch.get -> GitVersion.IBranch! -GitVersion.VersionCalculation.NextVersion.Configuration.get -> GitVersion.Model.Configuration.EffectiveConfiguration! +GitVersion.VersionCalculation.NextVersion.BaseVersion.get -> GitVersion.VersionCalculation.IBaseVersion! +GitVersion.VersionCalculation.NextVersion.BranchConfiguration.get -> GitVersion.Configuration.EffectiveBranchConfiguration! +GitVersion.VersionCalculation.NextVersion.CompareTo(GitVersion.VersionCalculation.NextVersion? other) -> int +GitVersion.VersionCalculation.NextVersion.Configuration.get -> GitVersion.Configuration.EffectiveConfiguration! +GitVersion.VersionCalculation.NextVersion.Equals(GitVersion.VersionCalculation.NextVersion? other) -> bool GitVersion.VersionCalculation.NextVersion.IncrementedVersion.get -> GitVersion.SemanticVersion! -GitVersion.VersionCalculation.NextVersion.NextVersion(GitVersion.SemanticVersion! incrementedVersion, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.IBranch! branch, GitVersion.Model.Configuration.EffectiveConfiguration! configuration) -> void -GitVersion.VersionCalculation.NextVersion.NextVersion(GitVersion.SemanticVersion! incrementedVersion, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> void -GitVersion.VersionCalculation.NextVersionCalculator -GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() -> GitVersion.VersionCalculation.NextVersion! -GitVersion.VersionCalculation.NextVersionCalculator.NextVersionCalculator(GitVersion.Logging.ILog! log, GitVersion.VersionCalculation.IBaseVersionCalculator! baseVersionCalculator, GitVersion.VersionCalculation.IMainlineVersionCalculator! mainlineVersionCalculator, GitVersion.Common.IRepositoryStore! repositoryStore, GitVersion.VersionCalculation.IIncrementStrategyFinder! incrementStrategyFinder, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.ShaVersionFilter -GitVersion.VersionCalculation.ShaVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion! version, out string? reason) -> bool -GitVersion.VersionCalculation.ShaVersionFilter.ShaVersionFilter(System.Collections.Generic.IEnumerable! shas) -> void -GitVersion.VersionCalculation.TaggedCommitVersionStrategy -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.TaggedCommitVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit.Commit -> GitVersion.ICommit! -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit.SemVer -> GitVersion.SemanticVersion! -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit.Tag -> string! -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit.VersionTaggedCommit(GitVersion.ICommit! commit, GitVersion.SemanticVersion! semVer, string! tag) -> void -GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy -GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy.TrackReleaseBranchesVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.VariableProvider -GitVersion.VersionCalculation.VariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Model.Configuration.EffectiveConfiguration! config, bool isCurrentCommitTagged) -> GitVersion.OutputVariables.VersionVariables! -GitVersion.VersionCalculation.VariableProvider.VariableProvider(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void +GitVersion.VersionCalculation.NextVersion.NextVersion(GitVersion.SemanticVersion! incrementedVersion, GitVersion.VersionCalculation.IBaseVersion! baseVersion, GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> void GitVersion.VersionCalculation.VersionCalculationModule GitVersion.VersionCalculation.VersionCalculationModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.VersionCalculation.VersionCalculationModule.VersionCalculationModule() -> void -GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy -GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy.VersionInBranchNameVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.VersioningMode -GitVersion.VersionCalculation.VersioningMode.ContinuousDelivery = 0 -> GitVersion.VersionCalculation.VersioningMode -GitVersion.VersionCalculation.VersioningMode.ContinuousDeployment = 1 -> GitVersion.VersionCalculation.VersioningMode -GitVersion.VersionCalculation.VersioningMode.Mainline = 2 -> GitVersion.VersionCalculation.VersioningMode -GitVersion.VersionCalculation.VersionStrategyBase -GitVersion.VersionCalculation.VersionStrategyBase.Context.get -> GitVersion.GitVersionContext! -GitVersion.VersionCalculation.VersionStrategyBase.VersionStrategyBase(System.Lazy! versionContext) -> void +GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.ConfiguredNextVersion = 2 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.Fallback = 1 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.Mainline = 64 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.MergeMessage = 4 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.None = 0 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.TaggedCommit = 8 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.TrackReleaseBranches = 16 -> GitVersion.VersionCalculation.VersionStrategies +GitVersion.VersionCalculation.VersionStrategies.VersionInBranchName = 32 -> GitVersion.VersionCalculation.VersionStrategies GitVersion.VersionCalculation.VersionStrategyModule +GitVersion.VersionCalculation.VersionStrategyModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.VersionCalculation.VersionStrategyModule.VersionStrategyModule() -> void -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext.AssemblyInfoContext() -> void -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext.AssemblyInfoContext(string! workingDirectory, bool ensureAssemblyInfo, params string![]! assemblyInfoFiles) -> void -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext.AssemblyInfoFiles.get -> string![]! -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext.EnsureAssemblyInfo.get -> bool -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext.WorkingDirectory.get -> string! -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoFileUpdater -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoFileUpdater.AssemblyInfoFileUpdater(GitVersion.Logging.ILog! log, GitVersion.IFileSystem! fileSystem) -> void -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoFileUpdater.Dispose() -> void -GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext context) -> void -GitVersion.VersionConverters.AssemblyInfo.IAssemblyInfoFileUpdater -GitVersion.VersionConverters.AssemblyInfo.IProjectFileUpdater -GitVersion.VersionConverters.AssemblyInfo.IProjectFileUpdater.CanUpdateProjectFile(System.Xml.Linq.XElement! xmlRoot) -> bool -GitVersion.VersionConverters.AssemblyInfo.ProjectFileUpdater -GitVersion.VersionConverters.AssemblyInfo.ProjectFileUpdater.CanUpdateProjectFile(System.Xml.Linq.XElement! xmlRoot) -> bool -GitVersion.VersionConverters.AssemblyInfo.ProjectFileUpdater.Dispose() -> void -GitVersion.VersionConverters.AssemblyInfo.ProjectFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.VersionConverters.AssemblyInfo.AssemblyInfoContext context) -> void -GitVersion.VersionConverters.AssemblyInfo.ProjectFileUpdater.ProjectFileUpdater(GitVersion.Logging.ILog! log, GitVersion.IFileSystem! fileSystem) -> void -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext.FileExtension.get -> string! -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext.FileName.get -> string! -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext.GitVersionInfoContext() -> void -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext.GitVersionInfoContext(string! workingDirectory, string! fileName, string! fileExtension) -> void -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext.WorkingDirectory.get -> string! -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoGenerator -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoGenerator.Dispose() -> void -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoGenerator.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoContext context) -> void -GitVersion.VersionConverters.GitVersionInfo.GitVersionInfoGenerator.GitVersionInfoGenerator(GitVersion.IFileSystem! fileSystem) -> void -GitVersion.VersionConverters.GitVersionInfo.IGitVersionInfoGenerator -GitVersion.VersionConverters.IConverterContext -GitVersion.VersionConverters.IConverterContext.WorkingDirectory.get -> string! -GitVersion.VersionConverters.IVersionConverter -GitVersion.VersionConverters.IVersionConverter.Execute(GitVersion.OutputVariables.VersionVariables! variables, T context) -> void -GitVersion.VersionConverters.OutputGenerator.IOutputGenerator -GitVersion.VersionConverters.OutputGenerator.OutputContext -GitVersion.VersionConverters.OutputGenerator.OutputContext.OutputContext() -> void -GitVersion.VersionConverters.OutputGenerator.OutputContext.OutputContext(string! workingDirectory, string? outputFile, bool? updateBuildNumber) -> void -GitVersion.VersionConverters.OutputGenerator.OutputContext.OutputFile.get -> string? -GitVersion.VersionConverters.OutputGenerator.OutputContext.UpdateBuildNumber.get -> bool? -GitVersion.VersionConverters.OutputGenerator.OutputContext.WorkingDirectory.get -> string! -GitVersion.VersionConverters.OutputGenerator.OutputGenerator -GitVersion.VersionConverters.OutputGenerator.OutputGenerator.Dispose() -> void -GitVersion.VersionConverters.OutputGenerator.OutputGenerator.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.VersionConverters.OutputGenerator.OutputContext context) -> void -GitVersion.VersionConverters.OutputGenerator.OutputGenerator.OutputGenerator(GitVersion.BuildAgents.ICurrentBuildAgent! buildAgent, GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.VersionConverters.VersionConvertersModule -GitVersion.VersionConverters.VersionConvertersModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.VersionConverters.VersionConvertersModule.VersionConvertersModule() -> void -GitVersion.VersionConverters.WixUpdater.IWixVersionFileUpdater -GitVersion.VersionConverters.WixUpdater.WixVersionContext -GitVersion.VersionConverters.WixUpdater.WixVersionContext.WixVersionContext() -> void -GitVersion.VersionConverters.WixUpdater.WixVersionContext.WixVersionContext(string! workingDirectory) -> void -GitVersion.VersionConverters.WixUpdater.WixVersionContext.WorkingDirectory.get -> string! -GitVersion.VersionConverters.WixUpdater.WixVersionFileUpdater -GitVersion.VersionConverters.WixUpdater.WixVersionFileUpdater.Dispose() -> void -GitVersion.VersionConverters.WixUpdater.WixVersionFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.VersionConverters.WixUpdater.WixVersionContext context) -> void -GitVersion.VersionConverters.WixUpdater.WixVersionFileUpdater.WixVersionFileUpdater(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log) -> void GitVersion.VersionField GitVersion.VersionField.Major = 3 -> GitVersion.VersionField GitVersion.VersionField.Minor = 2 -> GitVersion.VersionField GitVersion.VersionField.None = 0 -> GitVersion.VersionField GitVersion.VersionField.Patch = 1 -> GitVersion.VersionField GitVersion.WarningException +GitVersion.WarningException.WarningException() -> void GitVersion.WarningException.WarningException(string! message) -> void +GitVersion.WarningException.WarningException(string? message, System.Exception? innerException) -> void GitVersion.WixInfo -GitVersion.WixInfo.ShouldUpdate -> bool +GitVersion.WixInfo.UpdateWixVersionFile -> bool GitVersion.WixInfo.WixInfo() -> void -override GitVersion.BranchCommit.Equals(object? obj) -> bool -override GitVersion.BranchCommit.GetHashCode() -> int -override GitVersion.BuildAgents.AppVeyor.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.AppVeyor.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.AppVeyor.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.AppVeyor.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.AppVeyor.PreventFetch() -> bool -override GitVersion.BuildAgents.AzurePipelines.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.AzurePipelines.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.AzurePipelines.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.AzurePipelines.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.AzurePipelines.PreventFetch() -> bool -override GitVersion.BuildAgents.BitBucketPipelines.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.BitBucketPipelines.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.BitBucketPipelines.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? -override GitVersion.BuildAgents.BitBucketPipelines.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.BitBucketPipelines.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -override GitVersion.BuildAgents.BuildKite.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.BuildKite.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.BuildKite.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.BuildKite.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.BuildKite.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.BuildKite.PreventFetch() -> bool -override GitVersion.BuildAgents.BuildServerModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -override GitVersion.BuildAgents.CodeBuild.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.CodeBuild.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.CodeBuild.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.CodeBuild.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.CodeBuild.PreventFetch() -> bool -override GitVersion.BuildAgents.CodeBuild.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -override GitVersion.BuildAgents.ContinuaCi.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.ContinuaCi.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.ContinuaCi.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.ContinuaCi.PreventFetch() -> bool -override GitVersion.BuildAgents.Drone.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.Drone.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.Drone.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.Drone.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.Drone.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.Drone.PreventFetch() -> bool -override GitVersion.BuildAgents.EnvRun.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.EnvRun.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.EnvRun.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.EnvRun.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.EnvRun.PreventFetch() -> bool -override GitVersion.BuildAgents.GitHubActions.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.GitHubActions.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.GitHubActions.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.GitHubActions.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.GitHubActions.PreventFetch() -> bool -override GitVersion.BuildAgents.GitHubActions.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -override GitVersion.BuildAgents.GitLabCi.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.GitLabCi.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.GitLabCi.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.GitLabCi.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.GitLabCi.PreventFetch() -> bool -override GitVersion.BuildAgents.GitLabCi.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -override GitVersion.BuildAgents.Jenkins.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.Jenkins.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.Jenkins.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.Jenkins.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.Jenkins.PreventFetch() -> bool -override GitVersion.BuildAgents.Jenkins.ShouldCleanUpRemotes() -> bool -override GitVersion.BuildAgents.Jenkins.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -override GitVersion.BuildAgents.LocalBuild.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.LocalBuild.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.LocalBuild.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.LocalBuild.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? -override GitVersion.BuildAgents.MyGet.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.MyGet.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.MyGet.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.MyGet.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? -override GitVersion.BuildAgents.MyGet.PreventFetch() -> bool -override GitVersion.BuildAgents.SpaceAutomation.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.SpaceAutomation.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.SpaceAutomation.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.SpaceAutomation.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.TeamCity.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.TeamCity.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.TeamCity.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.TeamCity.GetCurrentBranch(bool usingDynamicRepos) -> string? -override GitVersion.BuildAgents.TeamCity.PreventFetch() -> bool -override GitVersion.BuildAgents.TravisCi.CanApplyToCurrentContext() -> bool -override GitVersion.BuildAgents.TravisCi.EnvironmentVariable.get -> string! -override GitVersion.BuildAgents.TravisCi.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.BuildAgents.TravisCi.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string! -override GitVersion.BuildAgents.TravisCi.PreventFetch() -> bool -override GitVersion.Configuration.Init.EditConfigStep.DefaultResult.get -> string? -override GitVersion.Configuration.Init.EditConfigStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.EditConfigStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.GitVersionInitModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetNextVersion.DefaultResult.get -> string? -override GitVersion.Configuration.Init.SetNextVersion.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetNextVersion.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.FinishedSetupStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.GitFlowSetupStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.GitHubFlowStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.GetPrompt(GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Model.Configuration.Config! config, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! +GitVersion.WixInfo.WixInfo(GitVersion.WixInfo! original) -> void +override GitVersion.Configuration.EffectiveBranchConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveBranchConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveBranchConfiguration.ToString() -> string! +override GitVersion.Configuration.EffectiveConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveConfiguration.ToString() -> string! +override GitVersion.ConfigurationInfo.Equals(object? obj) -> bool +override GitVersion.ConfigurationInfo.GetHashCode() -> int +override GitVersion.ConfigurationInfo.ToString() -> string! +override GitVersion.FileWriteInfo.Equals(object? obj) -> bool +override GitVersion.FileWriteInfo.GetHashCode() -> int +override GitVersion.FileWriteInfo.ToString() -> string! +override GitVersion.Git.AuthenticationInfo.Equals(object? obj) -> bool +override GitVersion.Git.AuthenticationInfo.GetHashCode() -> int +override GitVersion.Git.AuthenticationInfo.ToString() -> string! +override GitVersion.Git.BranchCommit.Equals(object? obj) -> bool +override GitVersion.Git.BranchCommit.GetHashCode() -> int +override GitVersion.Git.CommitFilter.Equals(object? obj) -> bool +override GitVersion.Git.CommitFilter.GetHashCode() -> int +override GitVersion.Git.CommitFilter.ToString() -> string! +override GitVersion.Git.ReferenceName.Equals(object? obj) -> bool +override GitVersion.Git.ReferenceName.GetHashCode() -> int +override GitVersion.Git.ReferenceName.ToString() -> string! override GitVersion.Helpers.LambdaKeyComparer.Compare(TSource? x, TSource? y) -> int -override GitVersion.Logging.Log.ToString() -> string! -override GitVersion.Model.Configuration.Config.ToString() -> string! -override GitVersion.OutputVariables.VersionVariables.ToString() -> string! -override GitVersion.OutputVariables.VersionVariablesJsonNumberConverter.CanConvert(System.Type! typeToConvert) -> bool -override GitVersion.OutputVariables.VersionVariablesJsonNumberConverter.HandleNull.get -> bool -override GitVersion.OutputVariables.VersionVariablesJsonNumberConverter.Read(ref System.Text.Json.Utf8JsonReader reader, System.Type! typeToConvert, System.Text.Json.JsonSerializerOptions! options) -> string! -override GitVersion.OutputVariables.VersionVariablesJsonNumberConverter.Write(System.Text.Json.Utf8JsonWriter! writer, string? value, System.Text.Json.JsonSerializerOptions! options) -> void -override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.CanConvert(System.Type! typeToConvert) -> bool -override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.HandleNull.get -> bool -override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.Read(ref System.Text.Json.Utf8JsonReader reader, System.Type! typeToConvert, System.Text.Json.JsonSerializerOptions! options) -> string! -override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.Write(System.Text.Json.Utf8JsonWriter! writer, string? value, System.Text.Json.JsonSerializerOptions! options) -> void -override GitVersion.ReferenceName.Equals(object! obj) -> bool -override GitVersion.ReferenceName.GetHashCode() -> int -override GitVersion.ReferenceName.ToString() -> string! +override GitVersion.OutputVariables.GitVersionVariables.Equals(object? obj) -> bool +override GitVersion.OutputVariables.GitVersionVariables.GetHashCode() -> int +override GitVersion.OutputVariables.GitVersionVariables.ToString() -> string! +override GitVersion.RepositoryInfo.Equals(object? obj) -> bool +override GitVersion.RepositoryInfo.GetHashCode() -> int +override GitVersion.RepositoryInfo.ToString() -> string! override GitVersion.SemanticVersion.Equals(object? obj) -> bool override GitVersion.SemanticVersion.GetHashCode() -> int override GitVersion.SemanticVersion.ToString() -> string! -override GitVersion.SemanticVersionBuildMetaData.Equals(object! obj) -> bool +override GitVersion.SemanticVersionBuildMetaData.Equals(object? obj) -> bool override GitVersion.SemanticVersionBuildMetaData.GetHashCode() -> int override GitVersion.SemanticVersionBuildMetaData.ToString() -> string! override GitVersion.SemanticVersionPreReleaseTag.Equals(object? obj) -> bool override GitVersion.SemanticVersionPreReleaseTag.GetHashCode() -> int override GitVersion.SemanticVersionPreReleaseTag.ToString() -> string! +override GitVersion.SemanticVersionWithTag.Equals(object? obj) -> bool +override GitVersion.SemanticVersionWithTag.GetHashCode() -> int +override GitVersion.SemanticVersionWithTag.ToString() -> string! +override GitVersion.Settings.Equals(object? obj) -> bool +override GitVersion.Settings.GetHashCode() -> int +override GitVersion.Settings.ToString() -> string! +override GitVersion.VersionCalculation.BaseVersion.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersion.GetHashCode() -> int override GitVersion.VersionCalculation.BaseVersion.ToString() -> string! -override GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.FallbackVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.MergeMessageVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! +override GitVersion.VersionCalculation.BaseVersionOperand.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperand.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperand.ToString() -> string! +override GitVersion.VersionCalculation.BaseVersionOperator.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperator.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperator.ToString() -> string! +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GetHashCode() -> int +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.ToString() -> string! +override GitVersion.VersionCalculation.NextVersion.Equals(object? other) -> bool +override GitVersion.VersionCalculation.NextVersion.GetHashCode() -> int override GitVersion.VersionCalculation.NextVersion.ToString() -> string! -override GitVersion.VersionCalculation.TaggedCommitVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit.ToString() -> string! -override GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy.GetBaseVersions(GitVersion.Model.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.VersionStrategyModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -readonly GitVersion.BuildAgents.BuildAgentBase.Log -> GitVersion.Logging.ILog! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Console -> GitVersion.Logging.IConsole! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.FileSystem -> GitVersion.IFileSystem! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Log -> GitVersion.Logging.ILog! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.StepFactory -> GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! -static GitVersion.BranchCommit.operator !=(GitVersion.BranchCommit left, GitVersion.BranchCommit right) -> bool -static GitVersion.BranchCommit.operator ==(GitVersion.BranchCommit left, GitVersion.BranchCommit right) -> bool -static GitVersion.Configuration.ConfigExtensions.GetBranchConfiguration(this GitVersion.Model.Configuration.Config! configuration, GitVersion.IBranch! branch) -> GitVersion.Model.Configuration.BranchConfig! -static GitVersion.Configuration.ConfigExtensions.GetBranchConfiguration(this GitVersion.Model.Configuration.Config! configuration, string! branchName) -> GitVersion.Model.Configuration.BranchConfig! -static GitVersion.Configuration.ConfigExtensions.GetBranchSpecificTag(this GitVersion.Model.Configuration.EffectiveConfiguration! configuration, GitVersion.Logging.ILog! log, string? branchFriendlyName, string? branchNameOverride) -> string! -static GitVersion.Configuration.ConfigExtensions.GetFallbackBranchConfiguration(this GitVersion.Model.Configuration.Config! configuration) -> GitVersion.Model.Configuration.BranchConfig! -static GitVersion.Configuration.ConfigExtensions.GetReleaseBranchConfig(this GitVersion.Model.Configuration.Config! configuration) -> System.Collections.Generic.List>! -static GitVersion.Configuration.ConfigExtensions.GetUnknownBranchConfiguration(this GitVersion.Model.Configuration.Config! configuration) -> GitVersion.Model.Configuration.BranchConfig! -static GitVersion.Configuration.ConfigExtensions.IsReleaseBranch(this GitVersion.Model.Configuration.Config! config, string! branchName) -> bool -static GitVersion.Configuration.ConfigSerializer.Read(System.IO.TextReader! reader) -> GitVersion.Model.Configuration.Config! -static GitVersion.Configuration.ConfigSerializer.Write(GitVersion.Model.Configuration.Config! config, System.IO.TextWriter! writer) -> void -static GitVersion.Configuration.Init.StepResult.ExitWithoutSaving() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.InvalidResponseSelected() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.Ok() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.SaveAndExit() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyFileVersion(this GitVersion.SemanticVersion! sv, GitVersion.Extensions.AssemblyFileVersioningScheme scheme) -> string? -static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyVersion(this GitVersion.SemanticVersion! sv, GitVersion.Extensions.AssemblyVersioningScheme scheme) -> string? +override GitVersion.WixInfo.Equals(object? obj) -> bool +override GitVersion.WixInfo.GetHashCode() -> int +override GitVersion.WixInfo.ToString() -> string! +static GitVersion.Configuration.EffectiveBranchConfiguration.operator !=(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveBranchConfiguration.operator ==(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator !=(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator ==(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.Configuration.ReferenceNameExtensions.TryGetSemanticVersion(this GitVersion.Git.ReferenceName! source, out (GitVersion.SemanticVersion! Value, string? Name) result, GitVersion.Configuration.EffectiveConfiguration! configuration) -> bool +static GitVersion.Configuration.ReferenceNameExtensions.TryGetSemanticVersion(this GitVersion.Git.ReferenceName! source, out (GitVersion.SemanticVersion! Value, string? Name) result, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> bool +static GitVersion.ConfigurationInfo.operator !=(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.ConfigurationInfo.operator ==(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyFileVersion(this GitVersion.SemanticVersion! sv, GitVersion.Configuration.AssemblyFileVersioningScheme scheme) -> string? +static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyVersion(this GitVersion.SemanticVersion! sv, GitVersion.Configuration.AssemblyVersioningScheme scheme) -> string? static GitVersion.Extensions.CommonExtensions.NotNull(this T? value, string! name = "") -> T! static GitVersion.Extensions.CommonExtensions.NotNullOrEmpty(this string? value, string! name = "") -> string! static GitVersion.Extensions.CommonExtensions.NotNullOrWhitespace(this string? value, string! name = "") -> string! -static GitVersion.Extensions.DictionaryExtensions.GetOrAdd(this System.Collections.Generic.IDictionary! dict, TKey key, System.Func! getValue) -> TValue +static GitVersion.Extensions.EnumerableExtensions.AddRange(this System.Collections.Generic.ICollection! source, System.Collections.Generic.IEnumerable! items) -> void static GitVersion.Extensions.EnumerableExtensions.OnlyOrDefault(this System.Collections.Generic.IEnumerable! source) -> T? +static GitVersion.Extensions.EnumerableExtensions.SingleOfType(this System.Collections.IEnumerable! source) -> T +static GitVersion.Extensions.FileSystemExtensions.GetLastDirectoryWrite(this System.IO.Abstractions.IFileSystem! fileSystem, string! path) -> long static GitVersion.Extensions.GitExtensions.CreateGitLogArgs(int? maxCommits) -> string! -static GitVersion.Extensions.GitExtensions.DumpGraph(string! workingDirectory, System.Action? writer = null, int? maxCommits = null) -> void -static GitVersion.Extensions.ObjectExtensions.Deconstruct(this System.Collections.Generic.KeyValuePair kvp, out TKey key, out TValue value) -> void -static GitVersion.Extensions.ObjectExtensions.GetProperties(this object! obj) -> System.Collections.Generic.IEnumerable>! +static GitVersion.Extensions.GitExtensions.DumpGraphLog(System.Action? writer = null, int? maxCommits = null) -> void +static GitVersion.Extensions.IncrementStrategyExtensions.ToVersionField(this GitVersion.IncrementStrategy strategy) -> GitVersion.VersionField +static GitVersion.Extensions.ReadEmbeddedResourceExtensions.ReadAsStringFromEmbeddedResource(this string! resourceName, System.Reflection.Assembly! assembly) -> string! static GitVersion.Extensions.ReadEmbeddedResourceExtensions.ReadAsStringFromEmbeddedResource(this string! resourceName) -> string! static GitVersion.Extensions.ServiceCollectionExtensions.AddModule(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, GitVersion.IGitVersionModule! gitVersionModule) -> Microsoft.Extensions.DependencyInjection.IServiceCollection! static GitVersion.Extensions.ServiceCollectionExtensions.GetServiceForType(this System.IServiceProvider! serviceProvider) -> TService static GitVersion.Extensions.StringExtensions.AppendLineFormat(this System.Text.StringBuilder! stringBuilder, string! format, params object![]! args) -> void -static GitVersion.Extensions.StringExtensions.ArgumentRequiresValue(this string! argument, int argumentIndex) -> bool +static GitVersion.Extensions.StringExtensions.IsEmpty(this string? value) -> bool static GitVersion.Extensions.StringExtensions.IsEquivalentTo(this string! self, string? other) -> bool -static GitVersion.Extensions.StringExtensions.IsFalse(this string? value) -> bool -static GitVersion.Extensions.StringExtensions.IsHelp(this string! singleArgument) -> bool -static GitVersion.Extensions.StringExtensions.IsInit(this string! singleArgument) -> bool static GitVersion.Extensions.StringExtensions.IsNullOrEmpty(this string? value) -> bool static GitVersion.Extensions.StringExtensions.IsNullOrWhiteSpace(this string? value) -> bool -static GitVersion.Extensions.StringExtensions.IsEmpty(this string? value) -> bool -static GitVersion.Extensions.StringExtensions.IsSwitch(this string? value, string! switchName) -> bool -static GitVersion.Extensions.StringExtensions.IsSwitchArgument(this string? value) -> bool -static GitVersion.Extensions.StringExtensions.IsTrue(this string? value) -> bool -static GitVersion.Extensions.StringExtensions.IsValidPath(this string? path) -> bool -static GitVersion.Extensions.StringExtensions.RegexReplace(this string! input, string! pattern, string! replace, System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None) -> string! -static GitVersion.GitVersionModule.FindAllDerivedTypes(System.Reflection.Assembly! assembly) -> System.Collections.Generic.IEnumerable! -static GitVersion.Helpers.EncodingHelper.DetectEncoding(string? filename) -> System.Text.Encoding? -static GitVersion.Helpers.EncodingHelper.DetectEncoding(System.Collections.Generic.IList! bytes) -> System.Text.Encoding? -static GitVersion.Helpers.PathHelper.Combine(string? path1) -> string! -static GitVersion.Helpers.PathHelper.Combine(string? path1, string? path2) -> string! -static GitVersion.Helpers.PathHelper.Combine(string? path1, string? path2, string? path3) -> string! -static GitVersion.Helpers.PathHelper.Combine(string? path1, string? path2, string? path3, string? path4) -> string! -static GitVersion.Helpers.PathHelper.GetFullPath(string? path) -> string! -static GitVersion.Helpers.ProcessHelper.Run(System.Action! output, System.Action! errorOutput, System.IO.TextReader? input, string! exe, string! args, string! workingDirectory, params System.Collections.Generic.KeyValuePair[]! environmentalVariables) -> int +static GitVersion.Extensions.StringExtensions.RegexReplace(this string! input, string! pattern, string! replace) -> string! +static GitVersion.Extensions.StringExtensions.WithPrefixIfNotNullOrEmpty(this string! value, string! prefix) -> string! +static GitVersion.FileWriteInfo.operator !=(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.FileWriteInfo.operator ==(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator !=(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator ==(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.BranchCommit.operator !=(GitVersion.Git.BranchCommit left, GitVersion.Git.BranchCommit right) -> bool +static GitVersion.Git.BranchCommit.operator ==(GitVersion.Git.BranchCommit left, GitVersion.Git.BranchCommit right) -> bool +static GitVersion.Git.CommitExtensions.IsMergeCommit(this GitVersion.Git.ICommit! source) -> bool +static GitVersion.Git.CommitFilter.operator !=(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.Git.CommitFilter.operator ==(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.Git.ReferenceName.FromBranchName(string! branchName) -> GitVersion.Git.ReferenceName! +static GitVersion.Git.ReferenceName.operator !=(GitVersion.Git.ReferenceName? left, GitVersion.Git.ReferenceName? right) -> bool +static GitVersion.Git.ReferenceName.operator ==(GitVersion.Git.ReferenceName? left, GitVersion.Git.ReferenceName? right) -> bool +static GitVersion.Git.ReferenceName.Parse(string! canonicalName) -> GitVersion.Git.ReferenceName! +static GitVersion.Helpers.Disposable.Create(System.Action! disposer) -> System.IDisposable! +static GitVersion.Helpers.Disposable.Create(T value, System.Action! disposer) -> GitVersion.Helpers.IDisposable! static GitVersion.Helpers.ServiceMessageEscapeHelper.EscapeValue(string? value) -> string? -static GitVersion.IncrementStrategyExtensions.ToVersionField(this GitVersion.IncrementStrategy strategy) -> GitVersion.VersionField -static GitVersion.Logging.Disposable.Create(System.Action! disposer) -> System.IDisposable! static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Debug(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void @@ -1352,7 +851,6 @@ static GitVersion.Logging.LogExtensions.Error(this GitVersion.Logging.ILog! log, static GitVersion.Logging.LogExtensions.Error(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Error(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void static GitVersion.Logging.LogExtensions.Error(this GitVersion.Logging.ILog! log, string! format, params object![]! args) -> void -static GitVersion.Logging.LogExtensions.GetVerbosityForLevel(GitVersion.Logging.LogLevel level) -> GitVersion.Logging.Verbosity static GitVersion.Logging.LogExtensions.Info(this GitVersion.Logging.ILog! log, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Info(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Info(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void @@ -1369,21 +867,19 @@ static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! lo static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogAction! logAction) -> void static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! log, string! format, params object![]! args) -> void -static GitVersion.Logging.LogExtensions.Write(this GitVersion.Logging.ILog! log, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void -static GitVersion.Model.Configuration.BranchConfig.CreateDefaultBranchConfig(string! name) -> GitVersion.Model.Configuration.BranchConfig! -static GitVersion.OutputVariables.VersionVariables.AvailableVariables.get -> System.Collections.Generic.IEnumerable! -static GitVersion.OutputVariables.VersionVariables.FromFile(string! filePath, GitVersion.IFileSystem! fileSystem) -> GitVersion.OutputVariables.VersionVariables! -static GitVersion.OutputVariables.VersionVariables.FromJson(string! json) -> GitVersion.OutputVariables.VersionVariables! -static GitVersion.ReferenceName.FromBranchName(string! branchName) -> GitVersion.ReferenceName! -static GitVersion.ReferenceName.Parse(string! canonicalName) -> GitVersion.ReferenceName! +static GitVersion.MergeMessage.TryParse(GitVersion.Git.ICommit! mergeCommit, GitVersion.Configuration.IGitVersionConfiguration! configuration, out GitVersion.MergeMessage? mergeMessage) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator !=(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator ==(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.RepositoryInfo.operator !=(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool +static GitVersion.RepositoryInfo.operator ==(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool static GitVersion.SemanticVersion.operator !=(GitVersion.SemanticVersion? v1, GitVersion.SemanticVersion? v2) -> bool static GitVersion.SemanticVersion.operator <(GitVersion.SemanticVersion! v1, GitVersion.SemanticVersion! v2) -> bool static GitVersion.SemanticVersion.operator <=(GitVersion.SemanticVersion! v1, GitVersion.SemanticVersion! v2) -> bool static GitVersion.SemanticVersion.operator ==(GitVersion.SemanticVersion? v1, GitVersion.SemanticVersion? v2) -> bool static GitVersion.SemanticVersion.operator >(GitVersion.SemanticVersion! v1, GitVersion.SemanticVersion! v2) -> bool static GitVersion.SemanticVersion.operator >=(GitVersion.SemanticVersion! v1, GitVersion.SemanticVersion! v2) -> bool -static GitVersion.SemanticVersion.Parse(string! version, string? tagPrefixRegex) -> GitVersion.SemanticVersion! -static GitVersion.SemanticVersion.TryParse(string! version, string? tagPrefixRegex, out GitVersion.SemanticVersion? semanticVersion) -> bool +static GitVersion.SemanticVersion.Parse(string! version, string? tagPrefixRegex, GitVersion.SemanticVersionFormat versionFormat = GitVersion.SemanticVersionFormat.Strict) -> GitVersion.SemanticVersion! +static GitVersion.SemanticVersion.TryParse(string! version, string? tagPrefixRegex, out GitVersion.SemanticVersion? semanticVersion, GitVersion.SemanticVersionFormat format = GitVersion.SemanticVersionFormat.Strict) -> bool static GitVersion.SemanticVersionBuildMetaData.implicit operator GitVersion.SemanticVersionBuildMetaData!(string! preReleaseTag) -> GitVersion.SemanticVersionBuildMetaData! static GitVersion.SemanticVersionBuildMetaData.implicit operator string?(GitVersion.SemanticVersionBuildMetaData? preReleaseTag) -> string? static GitVersion.SemanticVersionBuildMetaData.operator !=(GitVersion.SemanticVersionBuildMetaData? left, GitVersion.SemanticVersionBuildMetaData? right) -> bool @@ -1398,19 +894,70 @@ static GitVersion.SemanticVersionPreReleaseTag.operator ==(GitVersion.SemanticVe static GitVersion.SemanticVersionPreReleaseTag.operator >(GitVersion.SemanticVersionPreReleaseTag? left, GitVersion.SemanticVersionPreReleaseTag? right) -> bool static GitVersion.SemanticVersionPreReleaseTag.operator >=(GitVersion.SemanticVersionPreReleaseTag? left, GitVersion.SemanticVersionPreReleaseTag? right) -> bool static GitVersion.SemanticVersionPreReleaseTag.Parse(string? preReleaseTag) -> GitVersion.SemanticVersionPreReleaseTag! -static readonly GitVersion.BranchCommit.Empty -> GitVersion.BranchCommit -static readonly GitVersion.Helpers.StringComparerUtils.IgnoreCaseComparer -> System.StringComparer! -static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparer -> System.StringComparer! -static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparison -> System.StringComparison -static readonly GitVersion.Logging.Disposable.Empty -> System.IDisposable! -System.Runtime.CompilerServices.CallerArgumentExpressionAttribute -System.Runtime.CompilerServices.CallerArgumentExpressionAttribute.CallerArgumentExpressionAttribute(string! parameterName) -> void -System.Runtime.CompilerServices.CallerArgumentExpressionAttribute.ParameterName.get -> string! -virtual GitVersion.BuildAgents.BuildAgentBase.CanApplyToCurrentContext() -> bool -virtual GitVersion.BuildAgents.BuildAgentBase.GetCurrentBranch(bool usingDynamicRepos) -> string? -virtual GitVersion.BuildAgents.BuildAgentBase.PreventFetch() -> bool -virtual GitVersion.BuildAgents.BuildAgentBase.ShouldCleanUpRemotes() -> bool -virtual GitVersion.BuildAgents.BuildAgentBase.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -virtual GitVersion.Model.Configuration.IgnoreConfig.IsEmpty.get -> bool -virtual GitVersion.Model.Configuration.IgnoreConfig.ToFilters() -> System.Collections.Generic.IEnumerable! -virtual GitVersion.VersionCalculation.TaggedCommitVersionStrategy.FormatSource(GitVersion.VersionCalculation.TaggedCommitVersionStrategy.VersionTaggedCommit! version) -> string! +static GitVersion.SemanticVersionWithTag.operator !=(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.SemanticVersionWithTag.operator ==(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.Settings.operator !=(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.Settings.operator ==(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator !=(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator ==(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator !=(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator ==(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator !=(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator ==(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator !=(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator ==(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator !=(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator <(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator <=(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator ==(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion? right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator >(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool +static GitVersion.VersionCalculation.NextVersion.operator >=(GitVersion.VersionCalculation.NextVersion! left, GitVersion.VersionCalculation.NextVersion! right) -> bool +static GitVersion.WixInfo.operator !=(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +static GitVersion.WixInfo.operator ==(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +static readonly GitVersion.Git.BranchCommit.Empty -> GitVersion.Git.BranchCommit +static readonly GitVersion.Helpers.Disposable.Empty -> System.IDisposable! +static readonly GitVersion.SemanticVersion.Empty -> GitVersion.SemanticVersion! +static readonly GitVersion.SemanticVersionBuildMetaData.Empty -> GitVersion.SemanticVersionBuildMetaData! +static readonly GitVersion.SemanticVersionPreReleaseTag.Empty -> GitVersion.SemanticVersionPreReleaseTag! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.$() -> GitVersion.Configuration.EffectiveBranchConfiguration! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.Equals(GitVersion.Configuration.EffectiveBranchConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveBranchConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.$() -> GitVersion.Configuration.EffectiveConfiguration! +virtual GitVersion.Configuration.EffectiveConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveConfiguration.Equals(GitVersion.Configuration.EffectiveConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.ConfigurationInfo.$() -> GitVersion.ConfigurationInfo! +virtual GitVersion.ConfigurationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.ConfigurationInfo.Equals(GitVersion.ConfigurationInfo? other) -> bool +virtual GitVersion.ConfigurationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.AuthenticationInfo.$() -> GitVersion.Git.AuthenticationInfo! +virtual GitVersion.Git.AuthenticationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.Git.AuthenticationInfo.Equals(GitVersion.Git.AuthenticationInfo? other) -> bool +virtual GitVersion.Git.AuthenticationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.CommitFilter.$() -> GitVersion.Git.CommitFilter! +virtual GitVersion.Git.CommitFilter.EqualityContract.get -> System.Type! +virtual GitVersion.Git.CommitFilter.Equals(GitVersion.Git.CommitFilter? other) -> bool +virtual GitVersion.Git.CommitFilter.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Logging.LogAction.Invoke(GitVersion.Logging.LogActionEntry! actionEntry) -> void +virtual GitVersion.Logging.LogActionEntry.Invoke(string! format, params object![]! args) -> void +virtual GitVersion.OutputVariables.GitVersionVariables.$() -> GitVersion.OutputVariables.GitVersionVariables! +virtual GitVersion.OutputVariables.GitVersionVariables.EqualityContract.get -> System.Type! +virtual GitVersion.OutputVariables.GitVersionVariables.Equals(GitVersion.OutputVariables.GitVersionVariables? other) -> bool +virtual GitVersion.OutputVariables.GitVersionVariables.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.RepositoryInfo.$() -> GitVersion.RepositoryInfo! +virtual GitVersion.RepositoryInfo.EqualityContract.get -> System.Type! +virtual GitVersion.RepositoryInfo.Equals(GitVersion.RepositoryInfo? other) -> bool +virtual GitVersion.RepositoryInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Settings.$() -> GitVersion.Settings! +virtual GitVersion.Settings.EqualityContract.get -> System.Type! +virtual GitVersion.Settings.Equals(GitVersion.Settings? other) -> bool +virtual GitVersion.Settings.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.$() -> GitVersion.VersionCalculation.Caching.GitVersionCacheKey! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.EqualityContract.get -> System.Type! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? other) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.WixInfo.$() -> GitVersion.WixInfo! +virtual GitVersion.WixInfo.EqualityContract.get -> System.Type! +virtual GitVersion.WixInfo.Equals(GitVersion.WixInfo? other) -> bool +virtual GitVersion.WixInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index e69de29bb2..6d147e0548 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -0,0 +1,6 @@ +#nullable enable +GitVersion.Common.IRepositoryStore.GetCommitsReacheableFrom(GitVersion.Git.ICommit! commit, GitVersion.Git.IBranch! branch) -> System.Collections.Generic.IReadOnlyList! +GitVersion.Git.ICommit.Id.get -> GitVersion.Git.IObjectId! +GitVersion.Git.ICommit.Sha.get -> string! +GitVersion.Git.IGitRepository.References.get -> GitVersion.Git.IReferenceCollection! +GitVersion.IGitVersionContextFactory.Create() -> GitVersion.GitVersionContext! diff --git a/src/GitVersion.Core/SemVer/SemanticVersion.cs b/src/GitVersion.Core/SemVer/SemanticVersion.cs new file mode 100644 index 0000000000..eb421e36c7 --- /dev/null +++ b/src/GitVersion.Core/SemVer/SemanticVersion.cs @@ -0,0 +1,433 @@ +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using GitVersion.Core; +using GitVersion.Extensions; + +namespace GitVersion; + +public class SemanticVersion : IFormattable, IComparable, IEquatable +{ + public static readonly SemanticVersion Empty = new(); + + public long Major { get; init; } + + public long Minor { get; init; } + + public long Patch { get; init; } + + public bool IsPreRelease => PreReleaseTag.HasTag(); + + public SemanticVersionPreReleaseTag PreReleaseTag { get; init; } + + public SemanticVersionBuildMetaData BuildMetaData { get; init; } + + public bool IsLabeledWith(string value) => PreReleaseTag.HasTag() && PreReleaseTag.Name.IsEquivalentTo(value); + + public bool IsMatchForBranchSpecificLabel(string? value) + => (PreReleaseTag.Name.Length == 0 && PreReleaseTag.Number is null) || value is null || IsLabeledWith(value); + + public SemanticVersion(long major = 0, long minor = 0, long patch = 0) + { + this.Major = major; + this.Minor = minor; + this.Patch = patch; + this.PreReleaseTag = SemanticVersionPreReleaseTag.Empty; + this.BuildMetaData = SemanticVersionBuildMetaData.Empty; + } + + public SemanticVersion(SemanticVersion semanticVersion) + { + semanticVersion.NotNull(); + + this.Major = semanticVersion.Major; + this.Minor = semanticVersion.Minor; + this.Patch = semanticVersion.Patch; + + this.PreReleaseTag = semanticVersion.PreReleaseTag; + this.BuildMetaData = semanticVersion.BuildMetaData; + } + + public bool Equals(SemanticVersion? obj) + { + if (obj == null) + { + return false; + } + return this.Major == obj.Major + && this.Minor == obj.Minor + && this.Patch == obj.Patch + && this.PreReleaseTag == obj.PreReleaseTag + && this.BuildMetaData == obj.BuildMetaData; + } + + public bool IsEmpty() => Equals(Empty); + + public override bool Equals(object? obj) + { + if (obj is null) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + return obj.GetType() == GetType() && Equals((SemanticVersion)obj); + } + + public override int GetHashCode() => HashCode.Combine(Major, Minor, Patch, PreReleaseTag, BuildMetaData); + + public static bool operator ==(SemanticVersion? v1, SemanticVersion? v2) + { + if (v1 is null) + { + return v2 is null; + } + return v1.Equals(v2); + } + + public static bool operator !=(SemanticVersion? v1, SemanticVersion? v2) => !(v1 == v2); + + public static bool operator >(SemanticVersion v1, SemanticVersion v2) + { + ArgumentNullException.ThrowIfNull(v1); + ArgumentNullException.ThrowIfNull(v2); + + return v1.CompareTo(v2) > 0; + } + + public static bool operator >=(SemanticVersion v1, SemanticVersion v2) + { + ArgumentNullException.ThrowIfNull(v1); + ArgumentNullException.ThrowIfNull(v2); + + return v1.CompareTo(v2) >= 0; + } + + public static bool operator <=(SemanticVersion v1, SemanticVersion v2) + { + ArgumentNullException.ThrowIfNull(v1); + ArgumentNullException.ThrowIfNull(v2); + + return v1.CompareTo(v2) <= 0; + } + + public static bool operator <(SemanticVersion v1, SemanticVersion v2) + { + ArgumentNullException.ThrowIfNull(v1); + ArgumentNullException.ThrowIfNull(v2); + + return v1.CompareTo(v2) < 0; + } + + public static SemanticVersion Parse( + string version, string? tagPrefixRegex, SemanticVersionFormat versionFormat = SemanticVersionFormat.Strict) + { + if (!TryParse(version, tagPrefixRegex, out var semanticVersion, versionFormat)) + throw new WarningException($"Failed to parse {version} into a Semantic Version"); + + return semanticVersion; + } + + public static bool TryParse(string version, string? tagPrefixRegex, + [NotNullWhen(true)] out SemanticVersion? semanticVersion, SemanticVersionFormat format = SemanticVersionFormat.Strict) + { + var regex = RegexPatterns.Cache.GetOrAdd($"^({tagPrefixRegex})(?.*)$"); + var match = regex.Match(version); + + if (!match.Success) + { + semanticVersion = null; + return false; + } + + version = match.Groups["version"].Value; + return format == SemanticVersionFormat.Strict + ? TryParseStrict(version, out semanticVersion) + : TryParseLoose(version, out semanticVersion); + } + + private static bool TryParseStrict(string version, [NotNullWhen(true)] out SemanticVersion? semanticVersion) + { + var parsed = RegexPatterns.SemanticVersion.ParseStrictRegex().Match(version); + + if (!parsed.Success) + { + semanticVersion = null; + return false; + } + + semanticVersion = new() + { + Major = long.Parse(parsed.Groups["major"].Value), + Minor = parsed.Groups["minor"].Success ? long.Parse(parsed.Groups["minor"].Value) : 0, + Patch = parsed.Groups["patch"].Success ? long.Parse(parsed.Groups["patch"].Value) : 0, + PreReleaseTag = SemanticVersionPreReleaseTag.Parse(parsed.Groups["prerelease"].Value), + BuildMetaData = SemanticVersionBuildMetaData.Parse(parsed.Groups["buildmetadata"].Value) + }; + + return true; + } + + private static bool TryParseLoose(string version, [NotNullWhen(true)] out SemanticVersion? semanticVersion) + { + var parsed = RegexPatterns.SemanticVersion.ParseLooseRegex().Match(version); + + if (!parsed.Success) + { + semanticVersion = null; + return false; + } + + var semanticVersionBuildMetaData = SemanticVersionBuildMetaData.Parse(parsed.Groups["BuildMetaData"].Value); + var fourthPart = parsed.Groups["FourthPart"]; + if (fourthPart.Success && semanticVersionBuildMetaData.CommitsSinceTag == null) + { + semanticVersionBuildMetaData = new(semanticVersionBuildMetaData) + { + CommitsSinceTag = int.Parse(fourthPart.Value) + }; + } + + semanticVersion = new() + { + Major = long.Parse(parsed.Groups["Major"].Value), + Minor = parsed.Groups["Minor"].Success ? long.Parse(parsed.Groups["Minor"].Value) : 0, + Patch = parsed.Groups["Patch"].Success ? long.Parse(parsed.Groups["Patch"].Value) : 0, + PreReleaseTag = SemanticVersionPreReleaseTag.Parse(parsed.Groups["Tag"].Value), + BuildMetaData = semanticVersionBuildMetaData + }; + + return true; + } + + public bool IsGreaterThan(SemanticVersion? value, bool includePreRelease = true) + => CompareTo(value, includePreRelease) > 0; + + public bool IsGreaterThanOrEqualTo(SemanticVersion? value, bool includePreRelease = true) + => CompareTo(value, includePreRelease) >= 0; + + public bool IsLessThan(SemanticVersion? value, bool includePreRelease = true) + => CompareTo(value, includePreRelease) < 0; + + public bool IsLessThanOrEqualTo(SemanticVersion? value, bool includePreRelease = true) + => CompareTo(value, includePreRelease) <= 0; + + public bool IsEqualTo(SemanticVersion? value, bool includePreRelease = true) + => CompareTo(value, includePreRelease) == 0; + + public int CompareTo(SemanticVersion? value) => CompareTo(value, includePreRelease: true); + + public int CompareTo(SemanticVersion? value, bool includePreRelease) + { + if (value == null) + { + return 1; + } + if (this.Major != value.Major) + { + if (this.Major > value.Major) + { + return 1; + } + return -1; + } + if (this.Minor != value.Minor) + { + if (this.Minor > value.Minor) + { + return 1; + } + return -1; + } + if (this.Patch != value.Patch) + { + if (this.Patch > value.Patch) + { + return 1; + } + return -1; + } + + if (!includePreRelease || this.PreReleaseTag == value.PreReleaseTag) return 0; + if (this.PreReleaseTag > value.PreReleaseTag) + { + return 1; + } + return -1; + } + + public override string ToString() => ToString("s"); + + public string ToString(string format) => ToString(format, CultureInfo.CurrentCulture); + + /// + /// s - Default SemVer [1.2.3-beta.4] + /// f - Full SemVer [1.2.3-beta.4+5] + /// i - Informational SemVer [1.2.3-beta.4+5.Branch.main.BranchType.main.Sha.000000] + /// j - Just the SemVer part [1.2.3] + /// t - SemVer with the tag [1.2.3-beta.4] + /// + public string ToString(string? format, IFormatProvider? formatProvider) + { + if (format.IsNullOrEmpty()) + format = "s"; + + if (formatProvider?.GetFormat(GetType()) is ICustomFormatter formatter) + return formatter.Format(format, this, formatProvider); + + // Check for lp first because the param can vary + format = format.ToLower(); + switch (format) + { + case "j": + return $"{this.Major}.{this.Minor}.{this.Patch}"; + case "s": + return this.PreReleaseTag.HasTag() ? $"{ToString("j")}-{this.PreReleaseTag}" : ToString("j"); + case "t": + return this.PreReleaseTag.HasTag() ? $"{ToString("j")}-{this.PreReleaseTag:t}" : ToString("j"); + case "f": + { + var buildMetadata = this.BuildMetaData.ToString(); + + return !buildMetadata.IsNullOrEmpty() ? $"{ToString("s")}+{buildMetadata}" : ToString("s"); + } + case "i": + { + var buildMetadata = this.BuildMetaData.ToString("f"); + + return !buildMetadata.IsNullOrEmpty() ? $"{ToString("s")}+{buildMetadata}" : ToString("s"); + } + default: + throw new FormatException($"Unknown format '{format}'."); + } + } + + public SemanticVersion WithLabel(string? label) => Increment(VersionField.None, label, mode: IncrementMode.Standard); + + public SemanticVersion Increment( + VersionField increment, string? label, params SemanticVersion?[] alternativeSemanticVersions) + => Increment(increment, label, mode: IncrementMode.Standard, alternativeSemanticVersions); + + public SemanticVersion Increment( + VersionField increment, string? label, bool forceIncrement, params SemanticVersion?[] alternativeSemanticVersions) + => Increment(increment, label, mode: forceIncrement ? IncrementMode.Force : IncrementMode.Standard, alternativeSemanticVersions); + + public SemanticVersion Increment( + VersionField increment, string? label, IncrementMode mode, params SemanticVersion?[] alternativeSemanticVersions) + { + var major = Major; + var minor = Minor; + var patch = Patch; + var preReleaseNumber = PreReleaseTag.Number; + + var hasPreReleaseTag = PreReleaseTag.HasTag(); + + switch (increment) + { + case VersionField.None: + preReleaseNumber++; + break; + + case VersionField.Patch: + if (hasPreReleaseTag && (mode == IncrementMode.Standard + || (mode == IncrementMode.EnsureIntegrity && patch != 0))) + { + preReleaseNumber++; + } + else + { + patch++; + if (preReleaseNumber.HasValue) preReleaseNumber = 1; + } + break; + + case VersionField.Minor: + if (hasPreReleaseTag && (mode == IncrementMode.Standard + || (mode == IncrementMode.EnsureIntegrity && minor != 0 && patch == 0))) + { + preReleaseNumber++; + } + else + { + minor++; + patch = 0; + if (preReleaseNumber.HasValue) preReleaseNumber = 1; + } + break; + + case VersionField.Major: + if (hasPreReleaseTag && (mode == IncrementMode.Standard + || (mode == IncrementMode.EnsureIntegrity && major != 0 && minor == 0 && patch == 0))) + { + preReleaseNumber++; + } + else + { + major++; + minor = 0; + patch = 0; + if (preReleaseNumber.HasValue) preReleaseNumber = 1; + } + break; + + default: + throw new ArgumentOutOfRangeException(nameof(increment)); + } + + SemanticVersion semanticVersion = new(major, minor, patch); + + var foundAlternativeSemanticVersion = false; + foreach (var alternativeSemanticVersion in alternativeSemanticVersions) + { + if (!semanticVersion.IsLessThan(alternativeSemanticVersion, includePreRelease: false)) continue; + semanticVersion = alternativeSemanticVersion!; + foundAlternativeSemanticVersion = true; + } + + major = semanticVersion.Major; + minor = semanticVersion.Minor; + patch = semanticVersion.Patch; + + if (foundAlternativeSemanticVersion && increment == VersionField.None) + { + preReleaseNumber = 1; + } + + string preReleaseTagName; + if (hasPreReleaseTag) + { + preReleaseTagName = PreReleaseTag.Name; + } + else + { + preReleaseNumber = 1; + preReleaseTagName = string.Empty; + } + + if (label is null || preReleaseTagName == label) + { + return new SemanticVersion(this) { Major = major, Minor = minor, Patch = patch, PreReleaseTag = new SemanticVersionPreReleaseTag(preReleaseTagName, preReleaseNumber, true) }; + } + + preReleaseNumber = 1; + preReleaseTagName = label; + + return new SemanticVersion(this) + { + Major = major, + Minor = minor, + Patch = patch, + PreReleaseTag = new SemanticVersionPreReleaseTag(preReleaseTagName, preReleaseNumber, true) + }; + } + + public enum IncrementMode + { + Standard, + + Force, + + EnsureIntegrity + } +} diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionBuildMetaData.cs b/src/GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs similarity index 55% rename from src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionBuildMetaData.cs rename to src/GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs index 895acb092c..88f2fc658a 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionBuildMetaData.cs +++ b/src/GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs @@ -1,5 +1,5 @@ using System.Globalization; -using System.Text.RegularExpressions; +using GitVersion.Core; using GitVersion.Extensions; using GitVersion.Helpers; @@ -7,28 +7,35 @@ namespace GitVersion; public class SemanticVersionBuildMetaData : IFormattable, IEquatable { - private static readonly Regex ParseRegex = new( - @"(?\d+)?(\.?Branch(Name)?\.(?[^\.]+))?(\.?Sha?\.(?[^\.]+))?(?.*)", - RegexOptions.Compiled | RegexOptions.IgnoreCase); + public static readonly SemanticVersionBuildMetaData Empty = new(); private static readonly LambdaEqualityHelper EqualityHelper = new(x => x.CommitsSinceTag, x => x.Branch, x => x.Sha); - public long? CommitsSinceTag; - public string? Branch; - public string? Sha; - public string? ShortSha; - public string? OtherMetaData; - public DateTimeOffset? CommitDate; - public string? VersionSourceSha; - public long? CommitsSinceVersionSource; - public long UncommittedChanges; + public long? CommitsSinceTag { get; init; } + + public string? Branch { get; init; } + + public string? Sha { get; init; } + + public string? ShortSha { get; init; } + + public string? OtherMetaData { get; init; } + + public DateTimeOffset? CommitDate { get; init; } + + public string? VersionSourceSha { get; init; } + + public long CommitsSinceVersionSource { get; init; } + + public long UncommittedChanges { get; init; } public SemanticVersionBuildMetaData() { } - public SemanticVersionBuildMetaData(string? versionSourceSha, int? commitsSinceTag, string? branch, string? commitSha, string? commitShortSha, DateTimeOffset? commitDate, int numberOfUnCommittedChanges, string? otherMetadata = null) + public SemanticVersionBuildMetaData(string? versionSourceSha, long? commitsSinceTag, string? branch, string? commitSha, + string? commitShortSha, DateTimeOffset? commitDate, long numberOfUnCommittedChanges, string? otherMetadata = null) { this.Sha = commitSha; this.ShortSha = commitShortSha; @@ -41,20 +48,22 @@ public SemanticVersionBuildMetaData(string? versionSourceSha, int? commitsSinceT this.UncommittedChanges = numberOfUnCommittedChanges; } - public SemanticVersionBuildMetaData(SemanticVersionBuildMetaData? buildMetaData) + public SemanticVersionBuildMetaData(SemanticVersionBuildMetaData buildMetaData) { - this.Sha = buildMetaData?.Sha; - this.ShortSha = buildMetaData?.ShortSha; - this.CommitsSinceTag = buildMetaData?.CommitsSinceTag; - this.Branch = buildMetaData?.Branch; - this.CommitDate = buildMetaData?.CommitDate; - this.OtherMetaData = buildMetaData?.OtherMetaData; - this.VersionSourceSha = buildMetaData?.VersionSourceSha; - this.CommitsSinceVersionSource = buildMetaData?.CommitsSinceVersionSource; - this.UncommittedChanges = buildMetaData?.UncommittedChanges ?? 0; + buildMetaData.NotNull(); + + this.Sha = buildMetaData.Sha; + this.ShortSha = buildMetaData.ShortSha; + this.CommitsSinceTag = buildMetaData.CommitsSinceTag; + this.Branch = buildMetaData.Branch; + this.CommitDate = buildMetaData.CommitDate; + this.OtherMetaData = buildMetaData.OtherMetaData; + this.VersionSourceSha = buildMetaData.VersionSourceSha; + this.CommitsSinceVersionSource = buildMetaData.CommitsSinceVersionSource; + this.UncommittedChanges = buildMetaData.UncommittedChanges; } - public override bool Equals(object obj) => Equals(obj as SemanticVersionBuildMetaData); + public override bool Equals(object? obj) => Equals(obj as SemanticVersionBuildMetaData); public bool Equals(SemanticVersionBuildMetaData? other) => EqualityHelper.Equals(this, other); @@ -68,7 +77,6 @@ public SemanticVersionBuildMetaData(SemanticVersionBuildMetaData? buildMetaData) /// b - Formats just the build number /// s - Formats the build number and the Git Sha /// f - Formats the full build metadata - /// p - Formats the padded build number. Can specify an integer for padding, default is 4. (i.e., p5) /// public string ToString(string? format, IFormatProvider? formatProvider) { @@ -79,25 +87,9 @@ public string ToString(string? format, IFormatProvider? formatProvider) format = "b"; format = format.ToLower(); - if (format.StartsWith("p", StringComparison.Ordinal)) - { - // Handle format - var padding = 4; - if (format.Length > 1) - { - // try to parse - if (int.TryParse(format.Substring(1), out var p)) - { - padding = p; - } - } - - return this.CommitsSinceTag != null ? this.CommitsSinceTag.Value.ToString("D" + padding) : string.Empty; - } - return format.ToLower() switch { - "b" => this.CommitsSinceTag.ToString(), + "b" => $"{this.CommitsSinceTag}", "s" => $"{this.CommitsSinceTag}{(this.Sha.IsNullOrEmpty() ? null : ".Sha." + this.Sha)}".TrimStart('.'), "f" => $"{this.CommitsSinceTag}{(this.Branch.IsNullOrEmpty() ? null : ".Branch." + FormatMetaDataPart(this.Branch))}{(this.Sha.IsNullOrEmpty() ? null : ".Sha." + this.Sha)}{(this.OtherMetaData.IsNullOrEmpty() ? null : "." + FormatMetaDataPart(this.OtherMetaData))}".TrimStart('.'), _ => throw new FormatException($"Unknown format '{format}'.") @@ -116,34 +108,46 @@ public string ToString(string? format, IFormatProvider? formatProvider) public static SemanticVersionBuildMetaData Parse(string? buildMetaData) { - var semanticVersionBuildMetaData = new SemanticVersionBuildMetaData(); if (buildMetaData.IsNullOrEmpty()) - return semanticVersionBuildMetaData; + return Empty; - var parsed = ParseRegex.Match(buildMetaData); + var parsed = RegexPatterns.SemanticVersion.ParseBuildMetaDataRegex().Match(buildMetaData); + long? buildMetaDataCommitsSinceTag = null; + long? buildMetaDataCommitsSinceVersionSource = null; if (parsed.Groups["BuildNumber"].Success) { - semanticVersionBuildMetaData.CommitsSinceTag = long.Parse(parsed.Groups["BuildNumber"].Value); - semanticVersionBuildMetaData.CommitsSinceVersionSource = semanticVersionBuildMetaData.CommitsSinceTag ?? 0; + if (long.TryParse(parsed.Groups["BuildNumber"].Value, out var buildNumber)) + buildMetaDataCommitsSinceTag = buildNumber; + buildMetaDataCommitsSinceVersionSource = buildMetaDataCommitsSinceTag ?? 0; } + string? buildMetaDataBranch = null; if (parsed.Groups["BranchName"].Success) - semanticVersionBuildMetaData.Branch = parsed.Groups["BranchName"].Value; + buildMetaDataBranch = parsed.Groups["BranchName"].Value; + string? buildMetaDataSha = null; if (parsed.Groups["Sha"].Success) - semanticVersionBuildMetaData.Sha = parsed.Groups["Sha"].Value; + buildMetaDataSha = parsed.Groups["Sha"].Value; + string? buildMetaDataOtherMetaData = null; if (parsed.Groups["Other"].Success && !parsed.Groups["Other"].Value.IsNullOrEmpty()) - semanticVersionBuildMetaData.OtherMetaData = parsed.Groups["Other"].Value.TrimStart('.'); + buildMetaDataOtherMetaData = parsed.Groups["Other"].Value.TrimStart('.'); - return semanticVersionBuildMetaData; + return new() + { + CommitsSinceTag = buildMetaDataCommitsSinceTag, + CommitsSinceVersionSource = buildMetaDataCommitsSinceVersionSource ?? 0, + Branch = buildMetaDataBranch, + Sha = buildMetaDataSha, + OtherMetaData = buildMetaDataOtherMetaData + }; } private static string FormatMetaDataPart(string value) { if (!value.IsNullOrEmpty()) - value = Regex.Replace(value, "[^0-9A-Za-z-.]", "-"); + value = RegexPatterns.SemanticVersion.FormatBuildMetaDataRegex().Replace(value, "-"); return value; } } diff --git a/src/GitVersion.Core/SemVer/SemanticVersionFormat.cs b/src/GitVersion.Core/SemVer/SemanticVersionFormat.cs new file mode 100644 index 0000000000..ec228defde --- /dev/null +++ b/src/GitVersion.Core/SemVer/SemanticVersionFormat.cs @@ -0,0 +1,7 @@ +namespace GitVersion; + +public enum SemanticVersionFormat +{ + Strict, + Loose +} diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionPreReleaseTag.cs b/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs similarity index 56% rename from src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionPreReleaseTag.cs rename to src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs index c9132d3fe3..30dc819449 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionPreReleaseTag.cs +++ b/src/GitVersion.Core/SemVer/SemanticVersionPreReleaseTag.cs @@ -1,36 +1,42 @@ using System.Globalization; -using System.Text.RegularExpressions; +using GitVersion.Core; using GitVersion.Extensions; using GitVersion.Helpers; namespace GitVersion; -public class SemanticVersionPreReleaseTag : +public sealed class SemanticVersionPreReleaseTag : IFormattable, IComparable, IEquatable { + private static readonly StringComparer IgnoreCaseComparer = StringComparer.InvariantCultureIgnoreCase; + public static readonly SemanticVersionPreReleaseTag Empty = new(); + private static readonly LambdaEqualityHelper EqualityHelper = new(x => x.Name, x => x.Number); - public SemanticVersionPreReleaseTag() - { - } + public string Name { get; init; } + + public long? Number { get; init; } + + public bool PromoteTagEvenIfNameIsEmpty { get; init; } + + public SemanticVersionPreReleaseTag() => Name = string.Empty; - public SemanticVersionPreReleaseTag(string? name, long? number) + public SemanticVersionPreReleaseTag(string name, long? number, bool promoteTagEvenIfNameIsEmpty) { - Name = name; + Name = name.NotNull(); Number = number; + PromoteTagEvenIfNameIsEmpty = promoteTagEvenIfNameIsEmpty; } - public SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag? preReleaseTag) + public SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag preReleaseTag) { - Name = preReleaseTag?.Name; - Number = preReleaseTag?.Number; - PromotedFromCommits = preReleaseTag?.PromotedFromCommits; - } + preReleaseTag.NotNull(); - public string? Name { get; set; } - public long? Number { get; set; } - public bool? PromotedFromCommits { get; set; } + Name = preReleaseTag.Name; + Number = preReleaseTag.Number; + PromoteTagEvenIfNameIsEmpty = preReleaseTag.PromoteTagEvenIfNameIsEmpty; + } public override bool Equals(object? obj) => Equals(obj as SemanticVersionPreReleaseTag); @@ -54,7 +60,7 @@ public SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag? preReleaseTag) left?.CompareTo(right) >= 0; public static bool operator <=(SemanticVersionPreReleaseTag? left, SemanticVersionPreReleaseTag? right) => - StringComparerUtils.IgnoreCaseComparer.Compare(left?.Name, right?.Name) != 1; + IgnoreCaseComparer.Compare(left?.Name, right?.Name) != 1; public static implicit operator string?(SemanticVersionPreReleaseTag? preReleaseTag) => preReleaseTag?.ToString(); @@ -62,24 +68,21 @@ public SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag? preReleaseTag) public static SemanticVersionPreReleaseTag Parse(string? preReleaseTag) { - if (preReleaseTag.IsNullOrEmpty()) - { - return new SemanticVersionPreReleaseTag(); - } + if (preReleaseTag.IsNullOrEmpty()) return Empty; - var match = Regex.Match(preReleaseTag, @"(?.*?)\.?(?\d+)?$"); + var match = RegexPatterns.SemanticVersion.ParsePreReleaseTagRegex().Match(preReleaseTag); if (!match.Success) { // TODO check how to log this Console.WriteLine($"Unable to successfully parse semver tag {preReleaseTag}"); - return new SemanticVersionPreReleaseTag(); + return Empty; } var value = match.Groups["name"].Value; var number = match.Groups["number"].Success ? long.Parse(match.Groups["number"].Value) : (long?)null; - return value.EndsWith("-") - ? new SemanticVersionPreReleaseTag(preReleaseTag, null) - : new SemanticVersionPreReleaseTag(value, number); + return value.EndsWith('-') + ? new SemanticVersionPreReleaseTag(preReleaseTag, null, true) + : new SemanticVersionPreReleaseTag(value, number, true); } public int CompareTo(SemanticVersionPreReleaseTag? other) @@ -93,7 +96,7 @@ public int CompareTo(SemanticVersionPreReleaseTag? other) return -1; } - var nameComparison = StringComparerUtils.IgnoreCaseComparer.Compare(Name, other?.Name); + var nameComparison = IgnoreCaseComparer.Compare(Name, other?.Name); return nameComparison != 0 ? nameComparison : Nullable.Compare(Number, other?.Number); } @@ -104,8 +107,6 @@ public int CompareTo(SemanticVersionPreReleaseTag? other) /// /// Default formats: /// t - SemVer 2.0 formatted tag [beta.1] - /// l - Legacy SemVer tag with the tag number padded. [beta1] - /// lp - Legacy SemVer tag with the tag number padded. [beta0001]. Can specify an integer to control padding (i.e., lp5) /// public string ToString(string? format, IFormatProvider? formatProvider) { @@ -116,49 +117,13 @@ public string ToString(string? format, IFormatProvider? formatProvider) format = "t"; format = format.ToLower(); - if (format.StartsWith("lp", StringComparison.Ordinal)) - { - // Handle format - var padding = 4; - if (format.Length > 2) - { - // try to parse - if (int.TryParse(format.Substring(2), out var p)) - { - padding = p; - } - } - - return Number.HasValue ? FormatLegacy(GetLegacyName(), Number.Value.ToString("D" + padding)) : FormatLegacy(GetLegacyName()); - } return format switch { - "t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name ?? string.Empty), - "l" => (Number.HasValue ? FormatLegacy(GetLegacyName(), Number.Value.ToString()) : FormatLegacy(GetLegacyName())), + "t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name), _ => throw new FormatException($"Unknown format '{format}'.") }; } - private static string FormatLegacy(string tag, string number = "") - { - var tagEndsWithANumber = char.IsNumber(tag.LastOrDefault()); - if (tagEndsWithANumber && number.Length > 0) - number = "-" + number; - - return tag.Length + number.Length > 20 ? $"{tag.Substring(0, 20 - number.Length)}{number}" : $"{tag}{number}"; - } - - private string GetLegacyName() - { - if (Name.IsNullOrEmpty()) - { - return string.Empty; - } - var firstPart = Name.Split('_')[0]; - return firstPart.Replace(".", string.Empty); - } - - public bool HasTag() => - !Name.IsNullOrEmpty() || (Number.HasValue && PromotedFromCommits != true); + public bool HasTag() => !Name.IsNullOrEmpty() || (Number.HasValue && PromoteTagEvenIfNameIsEmpty); } diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs b/src/GitVersion.Core/SemVer/VersionField.cs similarity index 100% rename from src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs rename to src/GitVersion.Core/SemVer/VersionField.cs diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IBaseVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IBaseVersionCalculator.cs deleted file mode 100644 index 7ed1497cd6..0000000000 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IBaseVersionCalculator.cs +++ /dev/null @@ -1,8 +0,0 @@ -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -public interface IBaseVersionCalculator -{ - (BaseVersion, EffectiveBranchConfiguration) GetBaseVersion(); -} diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IDeploymentModeCalculator.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IDeploymentModeCalculator.cs new file mode 100644 index 0000000000..28c6cec386 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IDeploymentModeCalculator.cs @@ -0,0 +1,8 @@ +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public interface IDeploymentModeCalculator +{ + SemanticVersion Calculate(SemanticVersion semanticVersion, ICommit? baseVersionSource); +} diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IEffectiveBranchConfigurationFinder.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IEffectiveBranchConfigurationFinder.cs new file mode 100644 index 0000000000..12a44ceb4d --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IEffectiveBranchConfigurationFinder.cs @@ -0,0 +1,9 @@ +using GitVersion.Configuration; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public interface IEffectiveBranchConfigurationFinder +{ + IEnumerable GetConfigurations(IBranch branch, IGitVersionConfiguration configuration); +} diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IIncrementStrategyFinder.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IIncrementStrategyFinder.cs index 5616a13286..6331be284d 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IIncrementStrategyFinder.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IIncrementStrategyFinder.cs @@ -1,10 +1,14 @@ -using GitVersion.Model.Configuration; +using GitVersion.Configuration; +using GitVersion.Git; namespace GitVersion.VersionCalculation; public interface IIncrementStrategyFinder { - VersionField DetermineIncrementedField(GitVersionContext context, BaseVersion baseVersion, EffectiveConfiguration configuration); + VersionField DetermineIncrementedField( + ICommit currentCommit, ICommit? baseVersionSource, bool shouldIncrement, EffectiveConfiguration configuration, string? label); - VersionField? GetIncrementForCommits(Config configuration, IEnumerable commits); + IEnumerable GetMergedCommits(ICommit mergeCommit, int index, IIgnoreConfiguration ignore); + + VersionField GetIncrementForcedByCommit(ICommit commit, IGitVersionConfiguration configuration); } diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IMainlineVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IMainlineVersionCalculator.cs deleted file mode 100644 index 7c230aec39..0000000000 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IMainlineVersionCalculator.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace GitVersion.VersionCalculation; - -public interface IMainlineVersionCalculator -{ - SemanticVersion FindMainlineModeVersion(BaseVersion baseVersion); - SemanticVersionBuildMetaData CreateVersionBuildMetaData(ICommit? baseVersionSource); -} diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/INextVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/INextVersionCalculator.cs index b1ee00577d..03bc8082db 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/INextVersionCalculator.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/INextVersionCalculator.cs @@ -2,5 +2,5 @@ namespace GitVersion.VersionCalculation; public interface INextVersionCalculator { - NextVersion FindVersion(); + SemanticVersion FindVersion(); } diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs index 05500e8e7f..cb848efc23 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs @@ -1,9 +1,10 @@ -using GitVersion.Model.Configuration; +using GitVersion.Configuration; using GitVersion.OutputVariables; namespace GitVersion.VersionCalculation; public interface IVariableProvider { - VersionVariables GetVariablesFor(SemanticVersion semanticVersion, EffectiveConfiguration config, bool isCurrentCommitTagged); + GitVersionVariables GetVariablesFor( + SemanticVersion semanticVersion, IGitVersionConfiguration configuration, int preReleaseWeight); } diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionFilter.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionFilter.cs index f0b08c2216..f6de404af0 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionFilter.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionFilter.cs @@ -1,6 +1,9 @@ +using GitVersion.Git; + namespace GitVersion.VersionCalculation; public interface IVersionFilter { - bool Exclude(BaseVersion version, out string? reason); + bool Exclude(IBaseVersion baseVersion, out string? reason); + bool Exclude(ICommit? commit, out string? reason); } diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionStrategy.cs index a3b27fbc10..1fcddaee17 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IVersionStrategy.cs @@ -1,14 +1,8 @@ -using GitVersion.Model.Configuration; +using GitVersion.Configuration; namespace GitVersion.VersionCalculation; public interface IVersionStrategy { - /// - /// Calculates the values. - /// - /// - /// An of the base version values found by the strategy. - /// IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration); } diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculator.cs deleted file mode 100644 index c7af4273c3..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculator.cs +++ /dev/null @@ -1,197 +0,0 @@ -using GitVersion.Common; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -public class BaseVersionCalculator : IBaseVersionCalculator -{ - private readonly ILog log; - private readonly IRepositoryStore repositoryStore; - private readonly IBranchConfigurationCalculator branchConfigurationCalculator; - private readonly IIncrementStrategyFinder incrementStrategyFinder; - private readonly IVersionStrategy[] strategies; - private readonly Lazy versionContext; - private GitVersionContext context => this.versionContext.Value; - - public BaseVersionCalculator(ILog log, IRepositoryStore repositoryStore, - IBranchConfigurationCalculator branchConfigurationCalculator, IIncrementStrategyFinder incrementStrategyFinder, Lazy versionContext, IEnumerable strategies) - { - this.log = log.NotNull(); - this.repositoryStore = repositoryStore.NotNull(); - this.branchConfigurationCalculator = branchConfigurationCalculator.NotNull(); - this.incrementStrategyFinder = incrementStrategyFinder.NotNull(); - this.strategies = strategies.ToArray(); - this.versionContext = versionContext.NotNull(); - } - - public (BaseVersion, EffectiveBranchConfiguration) GetBaseVersion() - { - using (this.log.IndentLog("Calculating base versions")) - { - if (this.context.CurrentBranch.Tip == null) - throw new GitVersionException("No commits found on the current branch."); - - var currentBranchConfig = this.branchConfigurationCalculator.GetBranchConfiguration( - targetBranch: this.context.CurrentBranch, - currentCommit: this.context.CurrentCommit, - configuration: this.context.FullConfiguration - ); - var effectiveConfiguration = new EffectiveConfiguration(this.context.FullConfiguration, currentBranchConfig); - var effectiveBranchConfiguration = new EffectiveBranchConfiguration(this.context.CurrentBranch, effectiveConfiguration); - - var allVersions = new List(); - foreach (var strategy in this.strategies) - { - var baseVersions = GetBaseVersions(strategy, effectiveBranchConfiguration).ToList(); - allVersions.AddRange(baseVersions); - } - - var versions = allVersions - .Select(baseVersion => new Versions { IncrementedVersion = MaybeIncrement(baseVersion, effectiveConfiguration), Version = baseVersion }) - .ToList(); - - FixTheBaseVersionSourceOfMergeMessageStrategyIfReleaseBranchWasMergedAndDeleted(versions); - - if (context.FullConfiguration.VersioningMode == VersioningMode.Mainline) - { - versions = versions - .Where(b => b.IncrementedVersion.PreReleaseTag?.HasTag() != true) - .ToList(); - } - - var maxVersion = versions.Aggregate((v1, v2) => v1.IncrementedVersion > v2.IncrementedVersion ? v1 : v2); - var matchingVersionsOnceIncremented = versions - .Where(b => b.Version.BaseVersionSource != null && b.IncrementedVersion == maxVersion.IncrementedVersion) - .ToList(); - BaseVersion baseVersionWithOldestSource; - - if (matchingVersionsOnceIncremented.Any()) - { - static Versions CompareVersions(Versions versions1, Versions version2) - { - if (versions1.Version.BaseVersionSource == null) - { - return version2; - } - if (version2.Version.BaseVersionSource == null) - { - return versions1; - } - - return versions1.Version.BaseVersionSource.When < version2.Version.BaseVersionSource.When ? versions1 : version2; - } - - var oldest = matchingVersionsOnceIncremented.Aggregate(CompareVersions); - baseVersionWithOldestSource = oldest.Version; - maxVersion = oldest; - this.log.Info($"Found multiple base versions which will produce the same SemVer ({maxVersion.IncrementedVersion}), taking oldest source for commit counting ({baseVersionWithOldestSource.Source})"); - } - else - { - baseVersionWithOldestSource = versions - .Where(v => v.Version.BaseVersionSource != null) - .OrderByDescending(v => v.IncrementedVersion) - .ThenByDescending(v => v.Version.BaseVersionSource?.When) - .First() - .Version; - } - - if (baseVersionWithOldestSource.BaseVersionSource == null) - throw new Exception("Base version should not be null"); - - var calculatedBase = new BaseVersion( - maxVersion.Version.Source, - maxVersion.Version.ShouldIncrement, - maxVersion.Version.SemanticVersion, - baseVersionWithOldestSource.BaseVersionSource, - maxVersion.Version.BranchNameOverride); - - this.log.Info($"Base version used: {calculatedBase}"); - - return new(calculatedBase, effectiveBranchConfiguration); - } - } - - private SemanticVersion MaybeIncrement(BaseVersion baseVersion, EffectiveConfiguration configuration) - { - var incrementStrategy = this.incrementStrategyFinder.DetermineIncrementedField( - context: context, - baseVersion: baseVersion, - configuration: configuration - ); - return incrementStrategy == VersionField.None - ? baseVersion.SemanticVersion - : baseVersion.SemanticVersion.IncrementVersion(incrementStrategy); - } - - private IEnumerable GetBaseVersions(IVersionStrategy strategy, EffectiveBranchConfiguration configuration) - { - foreach (var version in strategy.GetBaseVersions(configuration)) - { - if (version == null) continue; - - this.log.Info(version.ToString()); - if (strategy is FallbackVersionStrategy || IncludeVersion(version)) - { - yield return version; - } - } - } - private bool IncludeVersion(BaseVersion version) - { - foreach (var filter in context.FullConfiguration.Ignore.ToFilters()) - { - if (filter.Exclude(version, out var reason)) - { - if (reason != null) - { - this.log.Info(reason); - } - return false; - } - } - return true; - } - - private void FixTheBaseVersionSourceOfMergeMessageStrategyIfReleaseBranchWasMergedAndDeleted(IEnumerable baseVersions) - { - if (ReleaseBranchExistsInRepo()) return; - - foreach (var baseVersion in baseVersions) - { - if (baseVersion.Version.Source.Contains(MergeMessageVersionStrategy.MergeMessageStrategyPrefix) - && baseVersion.Version.Source.Contains("Merge branch") - && baseVersion.Version.Source.Contains("release")) - { - if (baseVersion.Version.BaseVersionSource != null) - { - var parents = baseVersion.Version.BaseVersionSource.Parents.ToList(); - baseVersion.Version = new BaseVersion( - baseVersion.Version.Source, - baseVersion.Version.ShouldIncrement, - baseVersion.Version.SemanticVersion, - this.repositoryStore.FindMergeBase(parents[0], parents[1]), - baseVersion.Version.BranchNameOverride); - } - } - } - } - - private bool ReleaseBranchExistsInRepo() - { - var releaseBranchConfig = context.FullConfiguration.GetReleaseBranchConfig(); - var releaseBranches = this.repositoryStore.GetReleaseBranches(releaseBranchConfig); - return releaseBranches.Any(); - } - - private class Versions - { - public SemanticVersion IncrementedVersion { get; set; } - public BaseVersion Version { get; set; } - - public override string ToString() => $"{Version} | {IncrementedVersion}"; - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/BaseVersion.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/BaseVersion.cs deleted file mode 100644 index 2c9cfabe3b..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/BaseVersion.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace GitVersion.VersionCalculation; - -public class BaseVersion -{ - public BaseVersion(string source, bool shouldIncrement, SemanticVersion semanticVersion, ICommit? baseVersionSource, string? branchNameOverride) - { - Source = source; - ShouldIncrement = shouldIncrement; - SemanticVersion = semanticVersion; - BaseVersionSource = baseVersionSource; - BranchNameOverride = branchNameOverride; - } - - public string Source { get; } - - public bool ShouldIncrement { get; } - - public SemanticVersion SemanticVersion { get; } - - public ICommit? BaseVersionSource { get; } - - public string? BranchNameOverride { get; } - - public override string ToString() - { - var externalSource = BaseVersionSource == null ? "External Source" : BaseVersionSource.Sha; - return $"{Source}: {SemanticVersion.ToString("f")} with commit count source {externalSource}"; - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs deleted file mode 100644 index f0945ecb35..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs +++ /dev/null @@ -1,26 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Version is from NextVersion (the configuration value), unless the current commit is tagged. -/// BaseVersionSource is null. -/// Does not increment. -/// -public class ConfigNextVersionVersionStrategy : VersionStrategyBase -{ - public ConfigNextVersionVersionStrategy(Lazy versionContext) : base(versionContext) - { - } - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - var nextVersion = Context.FullConfiguration.NextVersion; - if (!nextVersion.IsNullOrEmpty() && !Context.IsCurrentCommitTagged) - { - var semanticVersion = SemanticVersion.Parse(nextVersion, Context.FullConfiguration.TagPrefix); - yield return new BaseVersion("NextVersion in GitVersion configuration file", false, semanticVersion, null, null); - } - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs deleted file mode 100644 index e1e7f5ad46..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/FallbackVersionStrategy.cs +++ /dev/null @@ -1,29 +0,0 @@ -using GitVersion.Common; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Version is 0.1.0. -/// BaseVersionSource is the "root" commit reachable from the current commit. -/// Does not increment. -/// -public class FallbackVersionStrategy : VersionStrategyBase -{ - private readonly IRepositoryStore repositoryStore; - - public FallbackVersionStrategy(IRepositoryStore repositoryStore, Lazy versionContext) : base(versionContext) => this.repositoryStore = repositoryStore; - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - var currentBranchTip = Context.CurrentBranch.Tip; - if (currentBranchTip == null) - { - throw new GitVersionException("No commits found on the current branch."); - } - - var baseVersionSource = this.repositoryStore.GetBaseVersionSource(currentBranchTip); - - yield return new BaseVersion("Fallback base version", false, new SemanticVersion(minor: 1), baseVersionSource, null); - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs deleted file mode 100644 index 12ae7565eb..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.RegularExpressions; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Version is extracted from older commits' merge messages. -/// BaseVersionSource is the commit where the message was found. -/// Increments if PreventIncrementOfMergedBranchVersion (from the branch config) is false. -/// -public class MergeMessageVersionStrategy : VersionStrategyBase -{ - private readonly ILog log; - - public MergeMessageVersionStrategy(ILog log, Lazy versionContext) - : base(versionContext) => this.log = log.NotNull(); - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - if (Context.CurrentBranch.Commits == null || Context.CurrentCommit == null) - return Enumerable.Empty(); - - var commitsPriorToThan = Context.CurrentBranch.Commits.GetCommitsPriorTo(Context.CurrentCommit.When); - var baseVersions = commitsPriorToThan - .SelectMany(c => - { - if (TryParse(c, Context, out var mergeMessage) && - mergeMessage.Version != null && - Context.FullConfiguration.IsReleaseBranch(TrimRemote(mergeMessage.MergedBranch))) - { - this.log.Info($"Found commit [{Context.CurrentCommit}] matching merge message format: {mergeMessage.FormatName}"); - var shouldIncrement = !configuration.Value.PreventIncrementOfMergedBranchVersion; - return new[] - { - new BaseVersion($"{MergeMessageStrategyPrefix} '{c.Message.Trim()}'", shouldIncrement, mergeMessage.Version, c, null) - }; - } - return Enumerable.Empty(); - }) - .Take(5) - .ToList(); - return baseVersions; - } - - public const string MergeMessageStrategyPrefix = "Merge message"; - - private static bool TryParse(ICommit mergeCommit, GitVersionContext context, [NotNullWhen(true)] out MergeMessage? mergeMessage) - { - mergeMessage = Inner(mergeCommit, context); - return mergeMessage != null; - } - - private static MergeMessage? Inner(ICommit mergeCommit, GitVersionContext context) - { - if (mergeCommit.Parents.Count() < 2) - { - return null; - } - - var mergeMessage = new MergeMessage(mergeCommit.Message, context.FullConfiguration); - return mergeMessage; - } - - private static string TrimRemote(string branchName) => branchName - .RegexReplace("^refs/remotes/", string.Empty, RegexOptions.IgnoreCase) - .RegexReplace("^origin/", string.Empty, RegexOptions.IgnoreCase); -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs deleted file mode 100644 index 9157b4a2a8..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs +++ /dev/null @@ -1,63 +0,0 @@ -using GitVersion.Common; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Version is extracted from all tags on the branch which are valid, and not newer than the current commit. -/// BaseVersionSource is the tag's commit. -/// Increments if the tag is not the current commit. -/// -public class TaggedCommitVersionStrategy : VersionStrategyBase -{ - private readonly IRepositoryStore repositoryStore; - - public TaggedCommitVersionStrategy(IRepositoryStore repositoryStore, Lazy versionContext) - : base(versionContext) => this.repositoryStore = repositoryStore.NotNull(); - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) => - GetTaggedVersions(Context.CurrentBranch, Context.CurrentCommit?.When); - - internal IEnumerable GetTaggedVersions(IBranch currentBranch, DateTimeOffset? olderThan) - { - if (currentBranch is null) - return Enumerable.Empty(); - var versionTags = this.repositoryStore.GetValidVersionTags(Context.FullConfiguration.TagPrefix, olderThan); - var versionTagsByCommit = versionTags.ToLookup(vt => vt.Item3.Id.Sha); - var commitsOnBranch = currentBranch.Commits; - if (commitsOnBranch == null) - return Enumerable.Empty(); - - var versionTagsOnBranch = commitsOnBranch.SelectMany(commit => versionTagsByCommit[commit.Id.Sha]); - var versionTaggedCommits = versionTagsOnBranch.Select(t => new VersionTaggedCommit(t.Item3, t.Item2, t.Item1.Name.Friendly)); - var taggedVersions = versionTaggedCommits.Select(versionTaggedCommit => CreateBaseVersion(Context, versionTaggedCommit)).ToList(); - var taggedVersionsOnCurrentCommit = taggedVersions.Where(version => !version.ShouldIncrement).ToList(); - return taggedVersionsOnCurrentCommit.Any() ? taggedVersionsOnCurrentCommit : taggedVersions; - } - - private BaseVersion CreateBaseVersion(GitVersionContext context, VersionTaggedCommit version) - { - var shouldUpdateVersion = version.Commit.Sha != context.CurrentCommit?.Sha; - var baseVersion = new BaseVersion(FormatSource(version), shouldUpdateVersion, version.SemVer, version.Commit, null); - return baseVersion; - } - - protected virtual string FormatSource(VersionTaggedCommit version) => $"Git tag '{version.Tag}'"; - - protected class VersionTaggedCommit - { - public string Tag; - public ICommit Commit; - public SemanticVersion SemVer; - - public VersionTaggedCommit(ICommit commit, SemanticVersion semVer, string tag) - { - this.Tag = tag; - this.Commit = commit; - this.SemVer = semVer; - } - - public override string ToString() => $"{this.Tag} | {this.Commit} | {this.SemVer}"; - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs deleted file mode 100644 index 2053c2aaa8..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs +++ /dev/null @@ -1,91 +0,0 @@ -using GitVersion.Common; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Active only when the branch is marked as IsDevelop. -/// Two different algorithms (results are merged): -/// -/// Using : -/// Version is that of any child branches marked with IsReleaseBranch (except if they have no commits of their own). -/// BaseVersionSource is the commit where the child branch was created. -/// Always increments. -/// -/// -/// Using : -/// Version is extracted from all tags on the main branch which are valid. -/// BaseVersionSource is the tag's commit (same as base strategy). -/// Increments if the tag is not the current commit (same as base strategy). -/// -/// -public class TrackReleaseBranchesVersionStrategy : VersionStrategyBase -{ - private readonly VersionInBranchNameVersionStrategy releaseVersionStrategy; - private readonly TaggedCommitVersionStrategy taggedCommitVersionStrategy; - - private readonly IRepositoryStore repositoryStore; - - public TrackReleaseBranchesVersionStrategy(IRepositoryStore repositoryStore, Lazy versionContext) - : base(versionContext) - { - this.repositoryStore = repositoryStore.NotNull(); - this.releaseVersionStrategy = new VersionInBranchNameVersionStrategy(repositoryStore, versionContext); - this.taggedCommitVersionStrategy = new TaggedCommitVersionStrategy(repositoryStore, versionContext); - } - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) => - configuration.Value.TracksReleaseBranches ? ReleaseBranchBaseVersions().Union(MainTagsVersions()) : Array.Empty(); - - private IEnumerable MainTagsVersions() - { - var configuration = Context.FullConfiguration; - var mainBranch = this.repositoryStore.FindMainBranch(configuration); - - return mainBranch != null - ? this.taggedCommitVersionStrategy.GetTaggedVersions(mainBranch, null) - : Array.Empty(); - } - - private IEnumerable ReleaseBranchBaseVersions() - { - var releaseBranchConfig = Context.FullConfiguration.GetReleaseBranchConfig(); - if (!releaseBranchConfig.Any()) - return Array.Empty(); - - var releaseBranches = this.repositoryStore.GetReleaseBranches(releaseBranchConfig); - - return releaseBranches - .SelectMany(b => GetReleaseVersion(b)) - .Select(baseVersion => - { - // Need to drop branch overrides and give a bit more context about - // where this version came from - var source1 = "Release branch exists -> " + baseVersion.Source; - return new BaseVersion(source1, - baseVersion.ShouldIncrement, - baseVersion.SemanticVersion, - baseVersion.BaseVersionSource, - null); - }) - .ToList(); - } - - private IEnumerable GetReleaseVersion(IBranch releaseBranch) - { - // Find the commit where the child branch was created. - var baseSource = this.repositoryStore.FindMergeBase(releaseBranch, Context.CurrentBranch); - if (Equals(baseSource, Context.CurrentCommit)) - { - // Ignore the branch if it has no commits. - return Array.Empty(); - } - - var configuration = Context.GetEffectiveConfiguration(releaseBranch); - return this.releaseVersionStrategy - .GetBaseVersions(new(releaseBranch, configuration)) - .Select(b => new BaseVersion(b.Source, true, b.SemanticVersion, baseSource, b.BranchNameOverride)); - } -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs deleted file mode 100644 index 85fb716945..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs +++ /dev/null @@ -1,52 +0,0 @@ -using GitVersion.Common; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -/// -/// Version is extracted from the name of the branch. -/// BaseVersionSource is the commit where the branch was branched from its parent. -/// Does not increment. -/// -public class VersionInBranchNameVersionStrategy : VersionStrategyBase -{ - private readonly IRepositoryStore repositoryStore; - - public VersionInBranchNameVersionStrategy(IRepositoryStore repositoryStore, Lazy versionContext) - : base(versionContext) => this.repositoryStore = repositoryStore.NotNull(); - - public override IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) - { - string nameWithoutOrigin = NameWithoutOrigin(configuration.Branch); - if (Context.FullConfiguration.IsReleaseBranch(nameWithoutOrigin)) - { - var versionInBranch = GetVersionInBranch(configuration.Branch.Name.Friendly, Context.FullConfiguration.TagPrefix); - if (versionInBranch != null) - { - var commitBranchWasBranchedFrom = this.repositoryStore.FindCommitBranchWasBranchedFrom(configuration.Branch, Context.FullConfiguration); - var branchNameOverride = Context.CurrentBranch.Name.Friendly.RegexReplace("[-/]" + versionInBranch.Item1, string.Empty); - yield return new BaseVersion("Version in branch name", false, versionInBranch.Item2, commitBranchWasBranchedFrom.Commit, branchNameOverride); - } - } - } - - private static Tuple? GetVersionInBranch(string branchName, string? tagPrefixRegex) - { - var branchParts = branchName.Split('/', '-'); - foreach (var part in branchParts) - { - if (SemanticVersion.TryParse(part, tagPrefixRegex, out var semanticVersion)) - { - return Tuple.Create(part, semanticVersion); - } - } - - return null; - } - - private static string NameWithoutOrigin(IBranch branch) => branch.IsRemote && branch.Name.Friendly.StartsWith("origin/") - ? branch.Name.Friendly.Substring("origin/".Length) - : branch.Name.Friendly; -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyBase.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyBase.cs deleted file mode 100644 index 8161fdb518..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyBase.cs +++ /dev/null @@ -1,15 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -public abstract class VersionStrategyBase : IVersionStrategy -{ - private readonly Lazy versionContext; - - protected GitVersionContext Context => this.versionContext.Value; - - protected VersionStrategyBase(Lazy versionContext) => this.versionContext = versionContext.NotNull(); - - public abstract IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration); -} diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs deleted file mode 100644 index aa5b8a6d26..0000000000 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.VersionCalculation; - -public class VersionStrategyModule : GitVersionModule -{ - public override void RegisterTypes(IServiceCollection services) - { - var versionStrategies = FindAllDerivedTypes(Assembly.GetAssembly(GetType())) - .Where(x => !x.IsAbstract && !x.IsInterface); - - foreach (var versionStrategy in versionStrategies) - { - services.AddSingleton(typeof(IVersionStrategy), versionStrategy); - } - } -} diff --git a/src/GitVersion.Core/VersionCalculation/Cache/GitVersionCache.cs b/src/GitVersion.Core/VersionCalculation/Cache/GitVersionCache.cs deleted file mode 100644 index 598da5bb65..0000000000 --- a/src/GitVersion.Core/VersionCalculation/Cache/GitVersionCache.cs +++ /dev/null @@ -1,107 +0,0 @@ -using GitVersion.Cache; -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.OutputVariables; -using YamlDotNet.Serialization; - -namespace GitVersion.VersionCalculation.Cache; - -public class GitVersionCache : IGitVersionCache -{ - private readonly IFileSystem fileSystem; - private readonly ILog log; - private readonly IGitRepositoryInfo repositoryInfo; - - public GitVersionCache(IFileSystem fileSystem, ILog log, IGitRepositoryInfo repositoryInfo) - { - this.fileSystem = fileSystem.NotNull(); - this.log = log.NotNull(); - this.repositoryInfo = repositoryInfo.NotNull(); - } - - public void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, VersionVariables variablesFromCache) - { - var cacheDir = PrepareCacheDirectory(); - var cacheFileName = GetCacheFileName(cacheKey, cacheDir); - - variablesFromCache.FileName = cacheFileName; - - Dictionary dictionary; - using (this.log.IndentLog("Creating dictionary")) - { - dictionary = variablesFromCache.ToDictionary(x => x.Key, x => x.Value); - } - - void WriteCacheOperation() - { - using var stream = this.fileSystem.OpenWrite(cacheFileName); - using var sw = new StreamWriter(stream); - using (this.log.IndentLog("Storing version variables to cache file " + cacheFileName)) - { - var serializer = new Serializer(); - serializer.Serialize(sw, dictionary); - } - } - - var retryOperation = new RetryAction(6); - retryOperation.Execute(WriteCacheOperation); - } - - public string GetCacheDirectory() - { - var gitDir = this.repositoryInfo.DotGitDirectory; - return PathHelper.Combine(gitDir, "gitversion_cache"); - } - - public VersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key) - { - using (this.log.IndentLog("Loading version variables from disk cache")) - { - var cacheDir = PrepareCacheDirectory(); - - var cacheFileName = GetCacheFileName(key, cacheDir); - if (!this.fileSystem.Exists(cacheFileName)) - { - this.log.Info("Cache file " + cacheFileName + " not found."); - return null; - } - - using (this.log.IndentLog("Deserializing version variables from cache file " + cacheFileName)) - { - try - { - var loadedVariables = VersionVariables.FromFile(cacheFileName, this.fileSystem); - return loadedVariables; - } - catch (Exception ex) - { - this.log.Warning("Unable to read cache file " + cacheFileName + ", deleting it."); - this.log.Info(ex.ToString()); - try - { - this.fileSystem.Delete(cacheFileName); - } - catch (Exception deleteEx) - { - this.log.Warning($"Unable to delete corrupted version cache file {cacheFileName}. Got {deleteEx.GetType().FullName} exception."); - } - - return null; - } - } - } - } - - private string PrepareCacheDirectory() - { - var cacheDir = GetCacheDirectory(); - - // If the cacheDir already exists, CreateDirectory just won't do anything (it won't fail). @asbjornu - this.fileSystem.CreateDirectory(cacheDir); - - return cacheDir; - } - - private static string GetCacheFileName(GitVersionCacheKey key, string cacheDir) => PathHelper.Combine(cacheDir, string.Concat(key.Value, ".yml")); -} diff --git a/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCache.cs b/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCache.cs deleted file mode 100644 index 33e275f90f..0000000000 --- a/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCache.cs +++ /dev/null @@ -1,11 +0,0 @@ -using GitVersion.Cache; -using GitVersion.OutputVariables; - -namespace GitVersion.VersionCalculation.Cache; - -public interface IGitVersionCache -{ - void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, VersionVariables variablesFromCache); - string GetCacheDirectory(); - VersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key); -} diff --git a/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCacheKeyFactory.cs b/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCacheKeyFactory.cs deleted file mode 100644 index 812676962d..0000000000 --- a/src/GitVersion.Core/VersionCalculation/Cache/IGitVersionCacheKeyFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using GitVersion.Cache; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation.Cache; - -public interface IGitVersionCacheKeyFactory -{ - GitVersionCacheKey Create(Config? overrideConfig); -} diff --git a/src/GitVersion.Core/VersionCalculation/Cache/GitVersionCacheKeyFactory.cs b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs similarity index 61% rename from src/GitVersion.Core/VersionCalculation/Cache/GitVersionCacheKeyFactory.cs rename to src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs index cf07e84f73..368713f464 100644 --- a/src/GitVersion.Core/VersionCalculation/Cache/GitVersionCacheKeyFactory.cs +++ b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs @@ -1,44 +1,42 @@ +using System.IO.Abstractions; using System.Security.Cryptography; -using GitVersion.Cache; +using GitVersion.Common; using GitVersion.Configuration; using GitVersion.Extensions; +using GitVersion.Git; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model.Configuration; using Microsoft.Extensions.Options; -namespace GitVersion.VersionCalculation.Cache; - -public class GitVersionCacheKeyFactory : IGitVersionCacheKeyFactory +namespace GitVersion.VersionCalculation.Caching; + +internal class GitVersionCacheKeyFactory( + IFileSystem fileSystem, + ILog log, + IOptions options, + IConfigurationFileLocator configFileLocator, + IConfigurationSerializer configurationSerializer, + IRepositoryStore repositoryStore, + IGitRepositoryInfo repositoryInfo) + : IGitVersionCacheKeyFactory { - private readonly IFileSystem fileSystem; - private readonly ILog log; - private readonly IOptions options; - private readonly IConfigFileLocator configFileLocator; - private readonly IGitRepository gitRepository; - private readonly IGitRepositoryInfo repositoryInfo; - - public GitVersionCacheKeyFactory(IFileSystem fileSystem, ILog log, - IOptions options, IConfigFileLocator configFileLocator, - IGitRepository gitRepository, IGitRepositoryInfo repositoryInfo) - { - this.fileSystem = fileSystem.NotNull(); - this.log = log.NotNull(); - this.options = options.NotNull(); - this.configFileLocator = configFileLocator.NotNull(); - this.gitRepository = gitRepository.NotNull(); - this.repositoryInfo = repositoryInfo.NotNull(); - } - - public GitVersionCacheKey Create(Config? overrideConfig) + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ILog log = log.NotNull(); + private readonly IOptions options = options.NotNull(); + private readonly IConfigurationFileLocator configFileLocator = configFileLocator.NotNull(); + private readonly IConfigurationSerializer configurationSerializer = configurationSerializer.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly IGitRepositoryInfo repositoryInfo = repositoryInfo.NotNull(); + + public GitVersionCacheKey Create(IReadOnlyDictionary? overrideConfiguration) { var gitSystemHash = GetGitSystemHash(); var configFileHash = GetConfigFileHash(); var repositorySnapshotHash = GetRepositorySnapshotHash(); - var overrideConfigHash = GetOverrideConfigHash(overrideConfig); + var overrideConfigHash = GetOverrideConfigHash(overrideConfiguration); var compositeHash = GetHash(gitSystemHash, configFileHash, repositorySnapshotHash, overrideConfigHash); - return new GitVersionCacheKey(compositeHash); + return new(compositeHash); } private string GetGitSystemHash() @@ -46,9 +44,9 @@ private string GetGitSystemHash() var dotGitDirectory = this.repositoryInfo.DotGitDirectory; // traverse the directory and get a list of files, use that for GetHash - var contents = CalculateDirectoryContents(PathHelper.Combine(dotGitDirectory, "refs")); + var contents = CalculateDirectoryContents(FileSystemHelper.Path.Combine(dotGitDirectory, "refs")); - return GetHash(contents.ToArray()); + return GetHash([.. contents]); } // based on https://msdn.microsoft.com/en-us/library/bb513869.aspx @@ -60,24 +58,24 @@ private List CalculateDirectoryContents(string root) // examined for files. var dirs = new Stack(); - if (!Directory.Exists(root)) + if (!this.fileSystem.Directory.Exists(root)) { throw new DirectoryNotFoundException($"Root directory does not exist: {root}"); } dirs.Push(root); - while (dirs.Any()) + while (dirs.Count != 0) { var currentDir = dirs.Pop(); - var di = new DirectoryInfo(currentDir); + var di = this.fileSystem.DirectoryInfo.New(currentDir); result.Add(di.Name); string[] subDirs; try { - subDirs = Directory.GetDirectories(currentDir); + subDirs = this.fileSystem.Directory.GetDirectories(currentDir); } // An UnauthorizedAccessException exception will be thrown if we do not have // discovery permission on a folder or file. It may or may not be acceptable @@ -102,7 +100,7 @@ private List CalculateDirectoryContents(string root) string[] files; try { - files = Directory.GetFiles(currentDir); + files = this.fileSystem.Directory.GetFiles(currentDir); } catch (UnauthorizedAccessException e) { @@ -119,9 +117,9 @@ private List CalculateDirectoryContents(string root) { try { - var fi = new FileInfo(file); - result.Add(fi.Name); - result.Add(File.ReadAllText(file)); + if (!this.fileSystem.File.Exists(file)) continue; + result.Add(FileSystemHelper.Path.GetFileName(file)); + result.Add(this.fileSystem.File.ReadAllText(file)); } catch (IOException e) { @@ -143,46 +141,42 @@ private List CalculateDirectoryContents(string root) private string GetRepositorySnapshotHash() { - var head = this.gitRepository.Head; + var head = this.repositoryStore.Head; if (head.Tip == null) { return head.Name.Canonical; } + var hash = string.Join(":", head.Name.Canonical, head.Tip.Sha); return GetHash(hash); } - private static string GetOverrideConfigHash(Config? overrideConfig) + private string GetOverrideConfigHash(IReadOnlyDictionary? overrideConfiguration) { - if (overrideConfig == null) + if (overrideConfiguration?.Any() != true) { return string.Empty; } // Doesn't depend on command line representation and // includes possible changes in default values of Config per se. - var stringBuilder = new StringBuilder(); - using (var stream = new StringWriter(stringBuilder)) - { - ConfigSerializer.Write(overrideConfig, stream); - stream.Flush(); - } - var configContent = stringBuilder.ToString(); + var configContent = configurationSerializer.Serialize(overrideConfiguration); return GetHash(configContent); } private string GetConfigFileHash() { - // will return the same hash even when config file will be moved - // from workingDirectory to rootProjectDirectory. It's OK. Config essentially is the same. - var configFilePath = this.configFileLocator.SelectConfigFilePath(this.options.Value, this.repositoryInfo); - if (configFilePath == null || !this.fileSystem.Exists(configFilePath)) - { - return string.Empty; - } + // will return the same hash even when configuration file will be moved + // from workingDirectory to rootProjectDirectory. It's OK. Configuration essentially is the same. + var workingDirectory = this.options.Value.WorkingDirectory; + var projectRootDirectory = this.repositoryInfo.ProjectRootDirectory; + + var configFilePath = this.configFileLocator.GetConfigurationFile(workingDirectory) + ?? this.configFileLocator.GetConfigurationFile(projectRootDirectory); + if (configFilePath == null || !this.fileSystem.File.Exists(configFilePath)) return string.Empty; - var configFileContent = this.fileSystem.ReadAllText(configFilePath); + var configFileContent = this.fileSystem.File.ReadAllText(configFilePath); return GetHash(configFileContent); } @@ -199,9 +193,8 @@ private static string GetHash(string textToHash) return string.Empty; } - using var sha1 = SHA1.Create(); var bytes = Encoding.UTF8.GetBytes(textToHash); - var hashedBytes = sha1.ComputeHash(bytes); + var hashedBytes = SHA1.HashData(bytes); var hashedString = BitConverter.ToString(hashedBytes); return hashedString.Replace("-", ""); } diff --git a/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheProvider.cs b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheProvider.cs new file mode 100644 index 0000000000..d80979db7a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheProvider.cs @@ -0,0 +1,108 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.OutputVariables; +using Microsoft.Extensions.Options; + +namespace GitVersion.VersionCalculation.Caching; + +internal class GitVersionCacheProvider( + IFileSystem fileSystem, + ILog log, + IOptions options, + IVersionVariableSerializer serializer, + IGitVersionCacheKeyFactory cacheKeyFactory, + IGitRepositoryInfo repositoryInfo) + : IGitVersionCacheProvider +{ + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ILog log = log.NotNull(); + private readonly IOptions options = options.NotNull(); + private readonly IVersionVariableSerializer serializer = serializer.NotNull(); + private readonly IGitVersionCacheKeyFactory cacheKeyFactory = cacheKeyFactory.NotNull(); + private readonly IGitRepositoryInfo repositoryInfo = repositoryInfo.NotNull(); + + public void WriteVariablesToDiskCache(GitVersionVariables versionVariables) + { + var cacheKey = GetCacheKey(); + var cacheFileName = GetCacheFileName(cacheKey); + using (this.log.IndentLog($"Write version variables to cache file {cacheFileName}")) + { + try + { + serializer.ToFile(versionVariables, cacheFileName); + } + catch (Exception ex) + { + this.log.Error($"Unable to write cache file {cacheFileName}. Got {ex.GetType().FullName} exception."); + } + } + } + + public GitVersionVariables? LoadVersionVariablesFromDiskCache() + { + var cacheKey = GetCacheKey(); + var cacheFileName = GetCacheFileName(cacheKey); + using (this.log.IndentLog($"Loading version variables from disk cache file {cacheFileName}")) + { + if (!this.fileSystem.File.Exists(cacheFileName)) + { + this.log.Info($"Cache file {cacheFileName} not found."); + return null; + } + + try + { + var loadedVariables = serializer.FromFile(cacheFileName); + return loadedVariables; + } + catch (Exception ex) + { + this.log.Warning($"Unable to read cache file {cacheFileName}, deleting it."); + this.log.Info(ex.ToString()); + try + { + this.fileSystem.File.Delete(cacheFileName); + } + catch (Exception deleteEx) + { + this.log.Warning($"Unable to delete corrupted version cache file {cacheFileName}. Got {deleteEx.GetType().FullName} exception."); + } + + return null; + } + } + } + + internal string GetCacheFileName(GitVersionCacheKey cacheKey) + { + var cacheDir = PrepareCacheDirectory(); + return GetCacheFileName(cacheKey, cacheDir); + } + + internal string GetCacheDirectory() + { + var gitDir = this.repositoryInfo.DotGitDirectory; + return FileSystemHelper.Path.Combine(gitDir, "gitversion_cache"); + } + + private string PrepareCacheDirectory() + { + var cacheDir = GetCacheDirectory(); + + // If the cacheDir already exists, CreateDirectory just won't do anything (it won't fail). @asbjornu + this.fileSystem.Directory.CreateDirectory(cacheDir); + + return cacheDir; + } + + private GitVersionCacheKey GetCacheKey() + { + var cacheKey = this.cacheKeyFactory.Create(options.Value.ConfigurationInfo.OverrideConfiguration); + return cacheKey; + } + + private static string GetCacheFileName(GitVersionCacheKey key, string cacheDir) => FileSystemHelper.Path.Combine(cacheDir, key.Value); +} diff --git a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs new file mode 100644 index 0000000000..29ae72d8b4 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs @@ -0,0 +1,7 @@ +namespace GitVersion.VersionCalculation.Caching; + +public record GitVersionCacheKey(string Value); +internal interface IGitVersionCacheKeyFactory +{ + GitVersionCacheKey Create(IReadOnlyDictionary? overrideConfiguration); +} diff --git a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheProvider.cs b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheProvider.cs new file mode 100644 index 0000000000..a25909892e --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheProvider.cs @@ -0,0 +1,9 @@ +using GitVersion.OutputVariables; + +namespace GitVersion.VersionCalculation.Caching; + +public interface IGitVersionCacheProvider +{ + void WriteVariablesToDiskCache(GitVersionVariables versionVariables); + GitVersionVariables? LoadVersionVariablesFromDiskCache(); +} diff --git a/src/GitVersion.Core/VersionCalculation/DeploymentMode.cs b/src/GitVersion.Core/VersionCalculation/DeploymentMode.cs new file mode 100644 index 0000000000..e6fa322591 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/DeploymentMode.cs @@ -0,0 +1,8 @@ +namespace GitVersion.VersionCalculation; + +public enum DeploymentMode +{ + ManualDeployment, + ContinuousDelivery, + ContinuousDeployment +} diff --git a/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs b/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs new file mode 100644 index 0000000000..7d9fc16476 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs @@ -0,0 +1,67 @@ +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal sealed class EffectiveBranchConfigurationFinder(ILog log, IRepositoryStore repositoryStore) : IEffectiveBranchConfigurationFinder +{ + private readonly ILog log = log.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + + public IEnumerable GetConfigurations(IBranch branch, IGitVersionConfiguration configuration) + { + branch.NotNull(); + configuration.NotNull(); + + return GetEffectiveConfigurationsRecursive(branch, configuration, null, []); + } + + private IEnumerable GetEffectiveConfigurationsRecursive( + IBranch branch, IGitVersionConfiguration configuration, IBranchConfiguration? childBranchConfiguration, HashSet traversedBranches) + { + if (!traversedBranches.Add(branch)) yield break; // This should never happen!! But it is good to have a circuit breaker. + + var branchConfiguration = configuration.GetBranchConfiguration(branch.Name); + if (childBranchConfiguration != null) + { + branchConfiguration = childBranchConfiguration.Inherit(branchConfiguration); + } + + IBranch[] sourceBranches = []; + if (branchConfiguration.Increment == IncrementStrategy.Inherit) + { + // At this point we need to check if source branches are available. + sourceBranches = [.. this.repositoryStore.GetSourceBranches(branch, configuration, traversedBranches)]; + + if (sourceBranches.Length == 0) + { + // Because the actual branch is marked with the inherit increment strategy we need to either skip the iteration or go further + // while inheriting from the fallback branch configuration. This behavior is configurable via the increment settings of the configuration. + var skipTraversingOfOrphanedBranches = configuration.Increment == IncrementStrategy.Inherit; + this.log.Info( + $"An orphaned branch '{branch}' has been detected and will be skipped={skipTraversingOfOrphanedBranches}." + ); + if (skipTraversingOfOrphanedBranches) yield break; + } + } + + if (branchConfiguration.Increment == IncrementStrategy.Inherit && sourceBranches.Length != 0) + { + foreach (var sourceBranch in sourceBranches) + { + foreach (var effectiveConfiguration + in GetEffectiveConfigurationsRecursive(sourceBranch, configuration, branchConfiguration, traversedBranches)) + { + yield return effectiveConfiguration; + } + } + } + else + { + yield return new(new(configuration, branchConfiguration), branch); + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/IncrementStrategy.cs b/src/GitVersion.Core/VersionCalculation/IncrementStrategy.cs index 45aa90e5c5..aa2be5fd26 100644 --- a/src/GitVersion.Core/VersionCalculation/IncrementStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/IncrementStrategy.cs @@ -1,5 +1,3 @@ -using GitVersion.Model.Configuration; - namespace GitVersion; public enum IncrementStrategy @@ -8,21 +6,5 @@ public enum IncrementStrategy Major, Minor, Patch, - /// - /// Uses the , and - /// of the "parent" branch (i.e. the branch where the current branch was branched from). - /// Inherit } - -public static class IncrementStrategyExtensions -{ - public static VersionField ToVersionField(this IncrementStrategy strategy) => strategy switch - { - IncrementStrategy.None => VersionField.None, - IncrementStrategy.Major => VersionField.Major, - IncrementStrategy.Minor => VersionField.Minor, - IncrementStrategy.Patch => VersionField.Patch, - _ => throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null) - }; -} diff --git a/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs b/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs index 35c04cb59c..7a941b13d6 100644 --- a/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs +++ b/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs @@ -1,54 +1,43 @@ -using System.Collections.Concurrent; using System.Text.RegularExpressions; +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; -using GitVersion.Model.Configuration; +using GitVersion.Git; namespace GitVersion.VersionCalculation; -public class IncrementStrategyFinder : IIncrementStrategyFinder +internal class IncrementStrategyFinder( + IRepositoryStore repositoryStore, + ITaggedSemanticVersionRepository taggedSemanticVersionRepository) + : IIncrementStrategyFinder { - public const string DefaultMajorPattern = @"\+semver:\s?(breaking|major)"; - public const string DefaultMinorPattern = @"\+semver:\s?(feature|minor)"; - public const string DefaultPatchPattern = @"\+semver:\s?(fix|patch)"; - public const string DefaultNoBumpPattern = @"\+semver:\s?(none|skip)"; + private readonly Dictionary commitIncrementCache = []; + private readonly Dictionary> headCommitsMapCache = []; + private readonly Dictionary headCommitsCache = []; - private static readonly ConcurrentDictionary CompiledRegexCache = new(); - private readonly Dictionary commitIncrementCache = new(); - private readonly Dictionary> headCommitsMapCache = new(); - private readonly Dictionary headCommitsCache = new(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly ITaggedSemanticVersionRepository taggedSemanticVersionRepository = taggedSemanticVersionRepository.NotNull(); - private static readonly Regex DefaultMajorPatternRegex = new(DefaultMajorPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex DefaultMinorPatternRegex = new(DefaultMinorPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex DefaultPatchPatternRegex = new(DefaultPatchPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex DefaultNoBumpPatternRegex = new(DefaultNoBumpPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - - private readonly IGitRepository repository; - - public IncrementStrategyFinder(IGitRepository repository) => this.repository = repository.NotNull(); - - public VersionField DetermineIncrementedField(GitVersionContext context, BaseVersion baseVersion, EffectiveConfiguration configuration) + public VersionField DetermineIncrementedField( + ICommit currentCommit, ICommit? baseVersionSource, bool shouldIncrement, EffectiveConfiguration configuration, string? label) { + currentCommit.NotNull(); configuration.NotNull(); - var commitMessageIncrement = FindCommitMessageIncrement(this.repository, context, configuration, baseVersion.BaseVersionSource); + var commitMessageIncrement = FindCommitMessageIncrement(configuration, baseVersionSource, currentCommit, label); var defaultIncrement = configuration.Increment.ToVersionField(); - // use the default branch config increment strategy if there are no commit message overrides + // use the default branch configuration increment strategy if there are no commit message overrides if (commitMessageIncrement == null) { - return baseVersion.ShouldIncrement ? defaultIncrement : VersionField.None; + return shouldIncrement ? defaultIncrement : VersionField.None; } - // cap the commit message severity to minor for alpha versions - if (baseVersion.SemanticVersion < new SemanticVersion(1) && commitMessageIncrement > VersionField.Minor) - { - commitMessageIncrement = VersionField.Minor; - } - - // don't increment for less than the branch config increment, if the absence of commit messages would have + // don't increment for less than the branch configuration increment, if the absence of commit messages would have // still resulted in an increment of configuration.Increment - if (baseVersion.ShouldIncrement && commitMessageIncrement < defaultIncrement) + if (shouldIncrement && commitMessageIncrement < defaultIncrement) { return defaultIncrement; } @@ -56,111 +45,175 @@ public VersionField DetermineIncrementedField(GitVersionContext context, BaseVer return commitMessageIncrement.Value; } - public VersionField? GetIncrementForCommits(Config configuration, IEnumerable commits) + private VersionField? GetIncrementForCommits(EffectiveConfiguration configuration, ICommit[] commits) { - var majorRegex = TryGetRegexOrDefault(configuration.MajorVersionBumpMessage, DefaultMajorPatternRegex); - var minorRegex = TryGetRegexOrDefault(configuration.MinorVersionBumpMessage, DefaultMinorPatternRegex); - var patchRegex = TryGetRegexOrDefault(configuration.PatchVersionBumpMessage, DefaultPatchPatternRegex); - var none = TryGetRegexOrDefault(configuration.NoBumpMessage, DefaultNoBumpPatternRegex); + commits.NotNull(); + + var majorRegex = TryGetRegexOrDefault(configuration.MajorVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultMajorRegex()); + var minorRegex = TryGetRegexOrDefault(configuration.MinorVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultMinorRegex()); + var patchRegex = TryGetRegexOrDefault(configuration.PatchVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultPatchRegex()); + var noBumpRegex = TryGetRegexOrDefault(configuration.NoBumpMessage, RegexPatterns.VersionCalculation.DefaultNoBumpRegex()); var increments = commits - .Select(c => GetIncrementFromCommit(c, majorRegex, minorRegex, patchRegex, none)) + .Select(c => GetIncrementFromCommit(c, majorRegex, minorRegex, patchRegex, noBumpRegex)) .Where(v => v != null) .ToList(); - return increments.Any() + return increments.Count != 0 ? increments.Max() : null; } - private VersionField? FindCommitMessageIncrement(IGitRepository repository, GitVersionContext context, - EffectiveConfiguration configuration, ICommit? baseCommit) + private VersionField? FindCommitMessageIncrement( + EffectiveConfiguration configuration, ICommit? baseVersionSource, ICommit currentCommit, string? label) { - if (baseCommit == null) return null; - if (configuration.CommitMessageIncrementing == CommitMessageIncrementMode.Disabled) { return null; } - var commits = GetIntermediateCommits(repository, baseCommit, context.CurrentCommit); - - // consider commit messages since latest tag only (see #3071) - var tags = new HashSet(repository.Tags.Select(t => t.TargetSha)); - commits = commits - .Reverse() - .TakeWhile(x => !tags.Contains(x.Sha)) - .Reverse(); + IEnumerable commits = GetCommitHistory( + tagPrefix: configuration.TagPrefix, + semanticVersionFormat: configuration.SemanticVersionFormat, + baseVersionSource: baseVersionSource, + currentCommit: currentCommit, + label: label, + ignore: configuration.Ignore + ); if (configuration.CommitMessageIncrementing == CommitMessageIncrementMode.MergeMessageOnly) { - commits = commits.Where(c => c.Parents.Count() > 1); + commits = commits.Where(c => c.Parents.Count > 1); } - return GetIncrementForCommits(context.FullConfiguration, commits); + return GetIncrementForCommits(configuration, + commits: [.. commits] + ); } private static Regex TryGetRegexOrDefault(string? messageRegex, Regex defaultRegex) => messageRegex == null ? defaultRegex - : CompiledRegexCache.GetOrAdd(messageRegex, pattern => new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase)); + : RegexPatterns.Cache.GetOrAdd(messageRegex); + + private Dictionary.ValueCollection GetCommitHistory(string? tagPrefix, SemanticVersionFormat semanticVersionFormat, + ICommit? baseVersionSource, ICommit currentCommit, string? label, IIgnoreConfiguration ignore) + { + var targetShas = new Lazy>(() => + [.. taggedSemanticVersionRepository + .GetTaggedSemanticVersions(tagPrefix, semanticVersionFormat, ignore) + .SelectMany(versionWithTags => versionWithTags) + .Where(versionWithTag => versionWithTag.Value.IsMatchForBranchSpecificLabel(label)) + .Select(versionWithTag => versionWithTag.Tag.TargetSha)] + ); + + var intermediateCommits = this.repositoryStore.GetCommitLog(baseVersionSource, currentCommit, ignore); + var commitLog = intermediateCommits.ToDictionary(element => element.Id.Sha); + + foreach (var intermediateCommit in intermediateCommits.Reverse()) + { + if (!targetShas.Value.Contains(intermediateCommit.Sha) || !commitLog.Remove(intermediateCommit.Sha)) continue; + var parentCommits = intermediateCommit.Parents.ToList(); + while (parentCommits.Count != 0) + { + List temporaryList = []; + foreach (var parentCommit in parentCommits.Where(parentCommit => commitLog.Remove(parentCommit.Sha))) + { + temporaryList.AddRange(parentCommit.Parents); + } + parentCommits = temporaryList; + } + } + + return commitLog.Values; + } /// - /// Get the sequence of commits in a between a (exclusive) + /// Get the sequence of commits in a repository between a (exclusive) /// and a particular (inclusive) /// - private IEnumerable GetIntermediateCommits(IGitRepository repository, IGitObject baseCommit, ICommit? headCommit) + private ArraySegment GetIntermediateCommits(ICommit? baseCommit, ICommit headCommit, IIgnoreConfiguration ignore) { - var map = GetHeadCommitsMap(repository, headCommit); - if (!map.TryGetValue(baseCommit.Sha, out var baseIndex)) return Enumerable.Empty(); - var commitAfterBaseIndex = baseIndex + 1; - var headCommits = GetHeadCommits(repository, headCommit); + var map = GetHeadCommitsMap(headCommit, ignore); + + var commitAfterBaseIndex = 0; + if (baseCommit != null) + { + if (!map.TryGetValue(baseCommit.Sha, out var baseIndex)) return []; + commitAfterBaseIndex = baseIndex + 1; + } + + var headCommits = GetHeadCommits(headCommit, ignore); return new ArraySegment(headCommits, commitAfterBaseIndex, headCommits.Length - commitAfterBaseIndex); } /// /// Get a mapping of commit shas to their zero-based position in the sequence of commits from the beginning of a - /// to a particular + /// repository to a particular /// - private Dictionary GetHeadCommitsMap(IGitRepository repository, ICommit? headCommit) => + private Dictionary GetHeadCommitsMap(ICommit? headCommit, IIgnoreConfiguration ignore) => this.headCommitsMapCache.GetOrAdd(headCommit?.Sha ?? "NULL", () => - GetHeadCommits(repository, headCommit) + GetHeadCommits(headCommit, ignore) .Select((commit, index) => (commit.Sha, Index: index)) .ToDictionary(t => t.Sha, t => t.Index)); /// - /// Get the sequence of commits from the beginning of a to a particular + /// Get the sequence of commits from the beginning of a repository to a particular /// (inclusive) /// - private ICommit[] GetHeadCommits(IGitRepository repository, ICommit? headCommit) => + private ICommit[] GetHeadCommits(ICommit? headCommit, IIgnoreConfiguration ignore) => this.headCommitsCache.GetOrAdd(headCommit?.Sha ?? "NULL", () => - GetCommitsReacheableFromHead(repository, headCommit).ToArray()); + [.. this.repositoryStore.GetCommitsReacheableFromHead(headCommit, ignore)]); - private VersionField? GetIncrementFromCommit(ICommit commit, Regex majorRegex, Regex minorRegex, Regex patchRegex, Regex none) => + private VersionField? GetIncrementFromCommit(ICommit commit, Regex majorRegex, Regex minorRegex, Regex patchRegex, Regex noBumpRegex) => this.commitIncrementCache.GetOrAdd(commit.Sha, () => - GetIncrementFromMessage(commit.Message, majorRegex, minorRegex, patchRegex, none)); + GetIncrementFromMessage(commit.Message, majorRegex, minorRegex, patchRegex, noBumpRegex)); - private static VersionField? GetIncrementFromMessage(string message, Regex majorRegex, Regex minorRegex, Regex patchRegex, Regex none) + private static VersionField? GetIncrementFromMessage(string message, Regex majorRegex, Regex minorRegex, Regex patchRegex, Regex noBumpRegex) { + if (noBumpRegex.IsMatch(message)) return VersionField.None; if (majorRegex.IsMatch(message)) return VersionField.Major; if (minorRegex.IsMatch(message)) return VersionField.Minor; if (patchRegex.IsMatch(message)) return VersionField.Patch; - if (none.IsMatch(message)) return VersionField.None; return null; } - /// - /// Query a for the sequence of commits from the beginning to a particular - /// (inclusive) - /// - private static IEnumerable GetCommitsReacheableFromHead(IGitRepository repo, ICommit? headCommit) + public IEnumerable GetMergedCommits(ICommit mergeCommit, int index, IIgnoreConfiguration ignore) { - var filter = new CommitFilter + mergeCommit.NotNull(); + + if (!mergeCommit.IsMergeCommit()) { - IncludeReachableFrom = headCommit, - SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Reverse - }; + throw new ArgumentException("The parameter is not a merge commit.", nameof(mergeCommit)); + } + + var baseCommit = mergeCommit.Parents[0]; + var mergedCommit = GetMergedHead(mergeCommit); + if (index == 0) (mergedCommit, baseCommit) = (baseCommit, mergedCommit); + + var findMergeBase = this.repositoryStore.FindMergeBase(baseCommit, mergedCommit) + ?? throw new InvalidOperationException("Cannot find the base commit of merged branch."); + return GetIntermediateCommits(findMergeBase, mergedCommit, ignore); + } + + private static ICommit GetMergedHead(ICommit mergeCommit) + { + var parents = mergeCommit.Parents.Skip(1).ToList(); + if (parents.Count > 1) + throw new NotSupportedException("GitVersion does not support more than one merge source in a single commit yet"); + return parents.Single(); + } + + public VersionField GetIncrementForcedByCommit(ICommit commit, IGitVersionConfiguration configuration) + { + commit.NotNull(); + configuration.NotNull(); + + var majorRegex = TryGetRegexOrDefault(configuration.MajorVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultMajorRegex()); + var minorRegex = TryGetRegexOrDefault(configuration.MinorVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultMinorRegex()); + var patchRegex = TryGetRegexOrDefault(configuration.PatchVersionBumpMessage, RegexPatterns.VersionCalculation.DefaultPatchRegex()); + var none = TryGetRegexOrDefault(configuration.NoBumpMessage, RegexPatterns.VersionCalculation.DefaultNoBumpRegex()); - return repo.Commits.QueryBy(filter); + return GetIncrementFromCommit(commit, majorRegex, minorRegex, patchRegex, none) ?? VersionField.None; } } diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/EnrichIncrement.cs b/src/GitVersion.Core/VersionCalculation/Mainline/EnrichIncrement.cs new file mode 100644 index 0000000000..91ad98cdd9 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/EnrichIncrement.cs @@ -0,0 +1,48 @@ +using System.ComponentModel; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation.Mainline; + +internal sealed class EnrichIncrement : IContextPreEnricher +{ + public void Enrich(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + var incrementForcedByBranch = effectiveConfiguration.Increment.ToVersionField(); + var incrementForcedByCommit = commit.IsDummy + ? VersionField.None + : GetIncrementForcedByCommit(context, commit.Value, effectiveConfiguration); + commit.Increment = incrementForcedByCommit; + context.Increment = context.Increment.Consolidate(incrementForcedByBranch, incrementForcedByCommit); + + if (commit.Predecessor is not null && commit.Predecessor.BranchName != commit.BranchName) + context.Label = null; + context.Label ??= effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + + if (effectiveConfiguration.IsMainBranch) + context.BaseVersionSource = commit.Predecessor?.Value; + context.ForceIncrement |= effectiveConfiguration.IsMainBranch || commit.IsPredecessorTheLastCommitOnTrunk(context.Configuration); + } + + private static VersionField GetIncrementForcedByCommit( + MainlineContext context, ICommit commit, EffectiveConfiguration configuration) + { + context.NotNull(); + commit.NotNull(); + configuration.NotNull(); + + return configuration.CommitMessageIncrementing switch + { + CommitMessageIncrementMode.Enabled + => context.IncrementStrategyFinder.GetIncrementForcedByCommit(commit, context.Configuration), + CommitMessageIncrementMode.Disabled => VersionField.None, + CommitMessageIncrementMode.MergeMessageOnly => commit.IsMergeCommit() + ? context.IncrementStrategyFinder.GetIncrementForcedByCommit(commit, context.Configuration) : VersionField.None, + _ => throw new InvalidEnumArgumentException( + nameof(configuration.CommitMessageIncrementing), (int)configuration.CommitMessageIncrementing, typeof(CommitMessageIncrementMode) + ) + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/EnrichSemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/Mainline/EnrichSemanticVersion.cs new file mode 100644 index 0000000000..ec0efc946b --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/EnrichSemanticVersion.cs @@ -0,0 +1,22 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline; + +internal sealed class EnrichSemanticVersion : IContextPreEnricher +{ + public void Enrich(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + var branchSpecificLabel = context.TargetLabel; + branchSpecificLabel ??= iteration.GetEffectiveConfiguration(context.Configuration) + .GetBranchSpecificLabel(commit.BranchName, null); + branchSpecificLabel ??= commit.GetEffectiveConfiguration(context.Configuration) + .GetBranchSpecificLabel(commit.BranchName, null); + + var semanticVersions = commit.SemanticVersions.Where( + element => element.IsMatchForBranchSpecificLabel(branchSpecificLabel) + ).ToList(); + context.AlternativeSemanticVersions.AddRange(commit.SemanticVersions.Except(semanticVersions)); + context.SemanticVersion = semanticVersions.Max(); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/IContextPostEnricher.cs b/src/GitVersion.Core/VersionCalculation/Mainline/IContextPostEnricher.cs new file mode 100644 index 0000000000..060740bf25 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/IContextPostEnricher.cs @@ -0,0 +1,6 @@ +namespace GitVersion.VersionCalculation.Mainline; + +internal interface IContextPostEnricher +{ + void Enrich(MainlineCommit commit, MainlineContext context); +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/IContextPreEnricher.cs b/src/GitVersion.Core/VersionCalculation/Mainline/IContextPreEnricher.cs new file mode 100644 index 0000000000..cff057cc93 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/IContextPreEnricher.cs @@ -0,0 +1,6 @@ +namespace GitVersion.VersionCalculation.Mainline; + +internal interface IContextPreEnricher +{ + void Enrich(MainlineIteration iteration, MainlineCommit commit, MainlineContext context); +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/IIncrementer.cs b/src/GitVersion.Core/VersionCalculation/Mainline/IIncrementer.cs new file mode 100644 index 0000000000..eeb2ef0a9c --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/IIncrementer.cs @@ -0,0 +1,9 @@ +namespace GitVersion.VersionCalculation.Mainline; + +internal interface IIncrementer +{ + bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context); + + IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context); +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/MainlineCommit.cs b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineCommit.cs new file mode 100644 index 0000000000..2340fa42f6 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineCommit.cs @@ -0,0 +1,117 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation.Mainline; + +[DebuggerDisplay( + @"\{ BranchName = {" + nameof(BranchName) + "}, Increment = {" + nameof(Increment) + "}, " + + "HasSuccessor = {" + nameof(HasSuccessor) + "}, HasPredecessor = {" + nameof(HasPredecessor) + "}, " + + "HasChildIteration = {" + nameof(HasChildIteration) + "}, Message = {" + nameof(Message) + @"} \}" +)] +internal record MainlineCommit(MainlineIteration Iteration, ICommit? value, ReferenceName BranchName, IBranchConfiguration Configuration) +{ + public bool IsPredecessorTheLastCommitOnTrunk(IGitVersionConfiguration configuration) + => !GetEffectiveConfiguration(configuration).IsMainBranch && Predecessor?.GetEffectiveConfiguration(configuration).IsMainBranch == true; + + public VersionField Increment { get; set; } + + public MainlineIteration Iteration { get; } = Iteration.NotNull(); + + public ReferenceName BranchName { get; } = BranchName.NotNull(); + + private IBranchConfiguration Configuration { get; } = Configuration.NotNull(); + + public bool HasSuccessor => Successor is not null; + + public MainlineCommit? Successor { get; private set; } + + public bool HasPredecessor => Predecessor is not null; + + public MainlineCommit? Predecessor { get; private set; } + + public ICommit Value => IsDummy ? (Successor?.Value)! : value!; + + [MemberNotNullWhen(false, nameof(Value))] + public bool IsDummy => value is null; + + public string Message => IsDummy ? "<>" : Value.Message; + + public MainlineIteration? ChildIteration { get; private set; } + + [MemberNotNullWhen(true, nameof(ChildIteration))] + public bool HasChildIteration => ChildIteration is not null && ChildIteration.Commits.Count != 0; + + public MainlineIteration? ParentIteration => Iteration.ParentIteration; + + public MainlineCommit? ParentCommit => Iteration.ParentCommit; + + [MemberNotNullWhen(true, nameof(ParentIteration), nameof(ParentCommit))] + private bool HasParentIteration => Iteration.ParentIteration is not null && Iteration.ParentCommit is not null; + + public IReadOnlyCollection SemanticVersions => semanticVersions; + + private readonly HashSet semanticVersions = []; + + private EffectiveConfiguration? effectiveConfiguration; + + public EffectiveConfiguration GetEffectiveConfiguration(IGitVersionConfiguration configuration) + { + if (effectiveConfiguration is not null) return effectiveConfiguration; + + var branchConfiguration = Configuration; + + var last = Configuration; + for (var i = this; i is not null; i = i.Predecessor) + { + if (branchConfiguration.Increment != IncrementStrategy.Inherit) break; + + if (i.Configuration != last) + { + branchConfiguration = branchConfiguration.Inherit(i.Configuration); + } + + last = i.Configuration; + } + + if (branchConfiguration.Increment != IncrementStrategy.Inherit || !HasParentIteration) + return this.effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); + + var parentConfiguration = ParentCommit.GetEffectiveConfiguration(configuration); + branchConfiguration = branchConfiguration.Inherit(parentConfiguration); + + return effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); + } + + public VersionField GetIncrementForcedByBranch(IGitVersionConfiguration configuration) + { + var result = GetEffectiveConfiguration(configuration); + return result.Increment.ToVersionField(); + } + + public void AddSemanticVersions(params SemanticVersion[] values) + => AddSemanticVersions((IEnumerable)values); + + public void AddSemanticVersions(IEnumerable values) + { + foreach (var semanticVersion in values.NotNull()) + { + semanticVersions.Add(semanticVersion); + } + } + + public void AddChildIteration(MainlineIteration iteration) => ChildIteration = iteration.NotNull(); + + public MainlineCommit Append( + ICommit? referenceValue, ReferenceName branchName, IBranchConfiguration configuration) + { + if (HasPredecessor) throw new InvalidOperationException(); + + MainlineCommit commit = new(Iteration, referenceValue, branchName, configuration); + Predecessor = commit; + commit.Successor = this; + + return commit; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/MainlineContext.cs b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineContext.cs new file mode 100644 index 0000000000..3657484b37 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineContext.cs @@ -0,0 +1,26 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation.Mainline; + +internal record MainlineContext(IIncrementStrategyFinder IncrementStrategyFinder, IGitVersionConfiguration Configuration) +{ + public IIncrementStrategyFinder IncrementStrategyFinder { get; } = IncrementStrategyFinder.NotNull(); + + public IGitVersionConfiguration Configuration { get; } = Configuration.NotNull(); + + public string? TargetLabel { get; init; } + + public SemanticVersion? SemanticVersion { get; set; } + + public string? Label { get; set; } + + public VersionField Increment { get; set; } + + public ICommit? BaseVersionSource { get; set; } + + public HashSet AlternativeSemanticVersions { get; } = []; + + public bool ForceIncrement { get; set; } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/MainlineIteration.cs b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineIteration.cs new file mode 100644 index 0000000000..efae207281 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/MainlineIteration.cs @@ -0,0 +1,88 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation.Mainline; + +[DebuggerDisplay( + @"\{ Id = {" + nameof(Id) + "}, " + + "BranchName = {" + nameof(BranchName) + "}, " + + "Depth = {" + nameof(Depth) + "}, " + + "NumberOfCommits = {" + nameof(NumberOfCommits) + "}" + @"} \}" +)] +internal record MainlineIteration +{ + public IBranchConfiguration Configuration { get; } + + private EffectiveConfiguration? effectiveConfiguration; + + public EffectiveConfiguration GetEffectiveConfiguration(IGitVersionConfiguration configuration) + { + if (this.effectiveConfiguration is not null) + { + return this.effectiveConfiguration; + } + + var branchConfiguration = Configuration; + + if (branchConfiguration.Increment != IncrementStrategy.Inherit || Commits.FirstOrDefault() is not { } commit) + return this.effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); + + var parentConfiguration = commit.GetEffectiveConfiguration(configuration); + branchConfiguration = branchConfiguration.Inherit(parentConfiguration); + + return this.effectiveConfiguration = new EffectiveConfiguration(configuration, branchConfiguration); + } + + public MainlineIteration? ParentIteration { get; } + + public MainlineCommit? ParentCommit { get; } + + public string Id { get; } + + public ReferenceName BranchName { get; } + + public int Depth { get; } + + public int NumberOfCommits => commits.Count; + + public IReadOnlyCollection Commits => commits; + private readonly Stack commits = new(); + + private readonly Dictionary commitLookup = []; + + public MainlineIteration(string id, ReferenceName branchName, IBranchConfiguration configuration, + MainlineIteration? parentIteration, MainlineCommit? parentCommit) + { + Id = id.NotNullOrEmpty(); + Depth = parentIteration?.Depth ?? 0 + 1; + BranchName = branchName.NotNull(); + Configuration = configuration.NotNull(); + ParentIteration = parentIteration; + ParentCommit = parentCommit; + } + + public MainlineCommit CreateCommit( + ICommit? value, ReferenceName branchName, IBranchConfiguration configuration) + { + var commit = this.commits.Count != 0 + ? this.commits.Peek().Append(value, branchName, configuration) + : new MainlineCommit(this, value, branchName, configuration); + commits.Push(commit); + + if (value is not null) + { + commitLookup.Add(value, commit); + } + + return commit; + } + + public MainlineCommit? FindCommit(ICommit commit) + { + commit.NotNull(); + + commitLookup.TryGetValue(commit, out var result); + return result; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunk.cs new file mode 100644 index 0000000000..d50f955a35 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunk.cs @@ -0,0 +1,41 @@ +using GitVersion.Configuration; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class CommitOnNonTrunk : IIncrementer +{ + // B 57 minutes ago (HEAD -> feature/foo) + // A 58 minutes ago <<-- + + // B 57 minutes ago (HEAD -> feature/foo) <<-- + // A 58 minutes ago + + public bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.HasChildIteration + && !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && context.SemanticVersion is null; + + public IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + if (commit.Predecessor is not null && commit.Predecessor.BranchName != commit.BranchName) + context.Label = null; + + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label ??= effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + + if (commit.Successor is not null) yield break; + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + + context.BaseVersionSource = commit.Value; + context.ForceIncrement = false; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedBase.cs new file mode 100644 index 0000000000..371cf513d6 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedBase.cs @@ -0,0 +1,37 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal abstract class CommitOnNonTrunkBranchedBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && commit.BranchName != iteration.BranchName + && commit.Successor is null; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + var incrementForcedByBranch = iteration.Configuration.Increment == IncrementStrategy.Inherit + ? commit.GetIncrementForcedByBranch(context.Configuration) + : iteration.Configuration.Increment.ToVersionField(); + context.Increment = context.Increment.Consolidate(incrementForcedByBranch); + + var iterationEffectiveConfiguration = iteration.GetEffectiveConfiguration(context.Configuration); + context.Label = iterationEffectiveConfiguration.GetBranchSpecificLabel(iteration.BranchName, null) ?? context.Label; + context.ForceIncrement = true; + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = null, + Increment = VersionField.None, + ForceIncrement = false, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToNonTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToNonTrunk.cs new file mode 100644 index 0000000000..265a0682e1 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToNonTrunk.cs @@ -0,0 +1,19 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class CommitOnNonTrunkBranchedToNonTrunk : CommitOnNonTrunkBranchedBase +{ + // B 51 minutes ago (HEAD -> feature/foo, main) <<-- + // A 59 minutes ago + + // B 58 minutes ago (main) + // A 59 minutes ago (HEAD -> feature/foo) <<-- + + // * 54 minutes ago (main) + // | B 56 minutes ago (HEAD -> feature/foo) + // |/ + // A 58 minutes ago <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) + && !iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToTrunk.cs new file mode 100644 index 0000000000..0b69a31024 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkBranchedToTrunk.cs @@ -0,0 +1,19 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class CommitOnNonTrunkBranchedToTrunk : CommitOnNonTrunkBranchedBase +{ + // B 51 minutes ago (HEAD -> release/1.0.x, main) <<-- + // A 59 minutes ago + + // B 58 minutes ago (main) + // A 59 minutes ago (HEAD -> release/1.0.x) <<-- + + // * 54 minutes ago (main) + // | B 56 minutes ago (HEAD -> release/1.0.x) + // |/ + // A 58 minutes ago <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) + && iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTag.cs new file mode 100644 index 0000000000..d829bdec15 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTag.cs @@ -0,0 +1,10 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class CommitOnNonTrunkWithPreReleaseTag : CommitOnNonTrunkWithPreReleaseTagBase +{ + // B 57 minutes ago (HEAD -> feature/foo) + // A 58 minutes ago (tag 1.2.3-1) <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTagBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTagBase.cs new file mode 100644 index 0000000000..7c1c5c841a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithPreReleaseTagBase.cs @@ -0,0 +1,30 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal abstract class CommitOnNonTrunkWithPreReleaseTagBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.HasChildIteration + && !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && context.SemanticVersion?.IsPreRelease == true; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + yield return new BaseVersionOperand + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + SemanticVersion = context.SemanticVersion.NotNull() + }; + + context.Increment = commit.GetIncrementForcedByBranch(context.Configuration); + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label = effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + context.ForceIncrement = false; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTag.cs new file mode 100644 index 0000000000..ec2fdae507 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTag.cs @@ -0,0 +1,10 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class CommitOnNonTrunkWithStableTag : CommitOnNonTrunkWithStableTagBase +{ + // B 57 minutes ago (HEAD -> feature/foo) + // A 58 minutes ago (tag 1.2.3) <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTagBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTagBase.cs new file mode 100644 index 0000000000..37e3b68a49 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/CommitOnNonTrunkWithStableTagBase.cs @@ -0,0 +1,29 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal abstract class CommitOnNonTrunkWithStableTagBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && !commit.HasChildIteration + && context.SemanticVersion?.IsPreRelease == false; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + yield return new BaseVersionOperand + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + SemanticVersion = context.SemanticVersion.NotNull() + }; + + context.Increment = commit.GetIncrementForcedByBranch(context.Configuration); + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label = effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/FirstCommitOnRelease.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/FirstCommitOnRelease.cs new file mode 100644 index 0000000000..7fec472353 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/FirstCommitOnRelease.cs @@ -0,0 +1,36 @@ +using GitVersion.Configuration; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +/// +/// This incrementer identifies the first commit on a branch marked with IsReleaseBranch true and appends the version number for +/// instance 1.0.0 (extracted from the branch name) as an alternative semantic version to the context. This information will be +/// used later to bump the version number to a higher value if necessary. +/// +internal sealed class FirstCommitOnRelease : IIncrementer +{ + // B 57 minutes ago (HEAD -> release/1.0.0) + // A 58 minutes ago <<-- + + // A 58 minutes ago (HEAD -> release/1.0.0) <<-- + + // C 56 minutes ago (HEAD -> release/1.0.0) + // B 57 minutes ago <<-- + // A 58 minutes ago (main) + + public bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.HasChildIteration + && !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && commit.GetEffectiveConfiguration(context.Configuration).IsReleaseBranch + && context.SemanticVersion is null + && (commit.Predecessor is null + || commit.BranchName != commit.Predecessor?.BranchName); + + public IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + if (!commit.BranchName.TryGetSemanticVersion(out var element, effectiveConfiguration)) yield break; + context.AlternativeSemanticVersions.Add(element.Value); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithPreReleaseTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithPreReleaseTag.cs new file mode 100644 index 0000000000..5555fa3d93 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithPreReleaseTag.cs @@ -0,0 +1,29 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class LastCommitOnNonTrunkWithPreReleaseTag : CommitOnNonTrunkWithPreReleaseTagBase +{ + // B 57 minutes ago (HEAD -> feature/foo) (tag 1.2.3-1) <<-- + // A 58 minutes ago + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; + + public override IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + foreach (var item in base.GetIncrements(iteration, commit, context)) + { + yield return item; + } + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = false, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithStableTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithStableTag.cs new file mode 100644 index 0000000000..a9eeff4b76 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastCommitOnNonTrunkWithStableTag.cs @@ -0,0 +1,29 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class LastCommitOnNonTrunkWithStableTag : CommitOnNonTrunkWithStableTagBase +{ + // B 57 minutes ago (HEAD -> feature/foo) (tag 1.2.3) <<-- + // A 58 minutes ago + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; + + public override IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + foreach (var item in base.GetIncrements(iteration, commit, context)) + { + yield return item; + } + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = true, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastMergeCommitOnNonTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastMergeCommitOnNonTrunk.cs new file mode 100644 index 0000000000..4069f79444 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/LastMergeCommitOnNonTrunk.cs @@ -0,0 +1,30 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class LastMergeCommitOnNonTrunk : MergeCommitOnNonTrunkBase +{ + // * 55 minutes ago (HEAD -> develop) <<-- + // |\ + // | B 56 minutes ago (feature/foo) + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; + + public override IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + foreach (var item in base.GetIncrements(iteration, commit, context)) + { + yield return item; + } + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.TargetLabel ?? context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunk.cs new file mode 100644 index 0000000000..8fca598267 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunk.cs @@ -0,0 +1,12 @@ +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal sealed class MergeCommitOnNonTrunk : MergeCommitOnNonTrunkBase +{ + // C 53 minutes ago (HEAD -> develop) + // * 55 minutes ago <<-- + // |\ + // | B 56 minutes ago (feature/foo) + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunkBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunkBase.cs new file mode 100644 index 0000000000..ce2c089aae --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/NonTrunk/MergeCommitOnNonTrunkBase.cs @@ -0,0 +1,69 @@ +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.NonTrunk; + +internal abstract class MergeCommitOnNonTrunkBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => commit.HasChildIteration + && !commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && context.SemanticVersion is null; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + if (commit.ChildIteration is null) throw new InvalidOperationException("The commit child iteration is null."); + + return GetIncrementsInternal(); + + IEnumerable GetIncrementsInternal() + { + var baseVersion = MainlineVersionStrategy.DetermineBaseVersionRecursive( + iteration: commit.ChildIteration, + targetLabel: context.TargetLabel, + incrementStrategyFinder: context.IncrementStrategyFinder, + configuration: context.Configuration + ); + + context.Label ??= baseVersion.Operator?.Label; + + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + var increment = VersionField.None; + if (!effectiveConfiguration.PreventIncrementOfMergedBranch) + { + increment = increment.Consolidate(context.Increment); + } + + if (!effectiveConfiguration.PreventIncrementWhenBranchMerged) + { + increment = increment.Consolidate(baseVersion.Operator?.Increment); + } + + if (effectiveConfiguration.CommitMessageIncrementing != CommitMessageIncrementMode.Disabled) + { + increment = increment.Consolidate(commit.Increment); + } + context.Increment = increment; + + if (baseVersion.BaseVersionSource is not null) + { + context.BaseVersionSource = baseVersion.BaseVersionSource; + context.SemanticVersion = baseVersion.SemanticVersion; + } + else + { + if (baseVersion.SemanticVersion != SemanticVersion.Empty) + { + context.AlternativeSemanticVersions.Add(baseVersion.SemanticVersion); + } + + if (baseVersion.Operator?.AlternativeSemanticVersion is not null) + { + context.AlternativeSemanticVersions.Add(baseVersion.Operator.AlternativeSemanticVersion); + } + } + + yield break; + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/RemoveIncrement.cs b/src/GitVersion.Core/VersionCalculation/Mainline/RemoveIncrement.cs new file mode 100644 index 0000000000..51f445aafb --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/RemoveIncrement.cs @@ -0,0 +1,12 @@ +namespace GitVersion.VersionCalculation.Mainline; + +internal sealed class RemoveIncrement : IContextPostEnricher +{ + public void Enrich(MainlineCommit commit, MainlineContext context) + { + if (!commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch) return; + context.Increment = VersionField.None; + context.Label = null; + context.AlternativeSemanticVersions.Clear(); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/RemoveSemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/Mainline/RemoveSemanticVersion.cs new file mode 100644 index 0000000000..f0825a4498 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/RemoveSemanticVersion.cs @@ -0,0 +1,6 @@ +namespace GitVersion.VersionCalculation.Mainline; + +internal sealed class RemoveSemanticVersion : IContextPostEnricher +{ + public void Enrich(MainlineCommit commit, MainlineContext context) => context.SemanticVersion = null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunk.cs new file mode 100644 index 0000000000..152b81577e --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunk.cs @@ -0,0 +1,39 @@ +using GitVersion.Configuration; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class CommitOnTrunk : IIncrementer +{ + // B 57 minutes ago (HEAD -> main) <<-- + // A 58 minutes ago + + // B 57 minutes ago (HEAD -> main) + // A 58 minutes ago <<-- + + public bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => !commit.HasChildIteration + && commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch && context.SemanticVersion is null; + + public IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + if (commit.Predecessor is not null && commit.Predecessor.BranchName != commit.BranchName) + context.Label = null; + + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label ??= effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + context.ForceIncrement = true; + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + + context.BaseVersionSource = commit.Value; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedBase.cs new file mode 100644 index 0000000000..ac2afa04a0 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedBase.cs @@ -0,0 +1,44 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal abstract class CommitOnTrunkBranchedBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch + && commit.BranchName != iteration.BranchName + && commit.Successor is null; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + var effectiveConfiguration = iteration.GetEffectiveConfiguration(context.Configuration); + if (iteration.GetEffectiveConfiguration(context.Configuration).IsReleaseBranch + && iteration.BranchName.TryGetSemanticVersion(out var element, effectiveConfiguration)) + { + context.AlternativeSemanticVersions.Add(element.Value); + } + + var incrementForcedByBranch = iteration.Configuration.Increment == IncrementStrategy.Inherit + ? commit.GetIncrementForcedByBranch(context.Configuration) + : iteration.Configuration.Increment.ToVersionField(); + context.Increment = incrementForcedByBranch; + + var iterationEffectiveConfiguration = iteration.GetEffectiveConfiguration(context.Configuration); + context.Label = iterationEffectiveConfiguration.GetBranchSpecificLabel(iteration.BranchName, null) ?? context.Label; + context.ForceIncrement = true; + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToNonTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToNonTrunk.cs new file mode 100644 index 0000000000..9ad2d1664e --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToNonTrunk.cs @@ -0,0 +1,19 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class CommitOnTrunkBranchedToNonTrunk : CommitOnTrunkBranchedBase +{ + // B 51 minutes ago (HEAD -> feature/foo, main) <<-- + // A 59 minutes ago + + // B 58 minutes ago (main) + // A 59 minutes ago (HEAD -> feature/foo) <<-- + + // * 54 minutes ago (main) + // | B 56 minutes ago (HEAD -> feature/foo) + // |/ + // A 58 minutes ago <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) + && !iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToTrunk.cs new file mode 100644 index 0000000000..2963a6e01e --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkBranchedToTrunk.cs @@ -0,0 +1,19 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class CommitOnTrunkBranchedToTrunk : CommitOnTrunkBranchedBase +{ + // B 51 minutes ago (HEAD -> release/1.0.x, main) <<-- + // A 59 minutes ago + + // B 58 minutes ago (main) + // A 59 minutes ago (HEAD -> release/1.0.x) <<-- + + // * 54 minutes ago (main) + // | B 56 minutes ago (HEAD -> release/1.0.x) + // |/ + // A 58 minutes ago <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) + && iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTag.cs new file mode 100644 index 0000000000..41a4d56f2a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTag.cs @@ -0,0 +1,10 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class CommitOnTrunkWithPreReleaseTag : CommitOnTrunkWithPreReleaseTagBase +{ + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.2.0-1) <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTagBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTagBase.cs new file mode 100644 index 0000000000..b47e21886d --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithPreReleaseTagBase.cs @@ -0,0 +1,23 @@ +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal abstract class CommitOnTrunkWithPreReleaseTagBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch && !commit.HasChildIteration + && context.SemanticVersion?.IsPreRelease == true; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + yield return new BaseVersionOperand + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + SemanticVersion = context.SemanticVersion.NotNull() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTag.cs new file mode 100644 index 0000000000..c75a6d2f60 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTag.cs @@ -0,0 +1,10 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class CommitOnTrunkWithStableTag : CommitOnTrunkWithStableTagBase +{ + // B 58 minutes ago (HEAD -> main) + // A 59 minutes ago (tag 0.2.0) <<-- + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTagBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTagBase.cs new file mode 100644 index 0000000000..f9ca1a445b --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/CommitOnTrunkWithStableTagBase.cs @@ -0,0 +1,27 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal abstract class CommitOnTrunkWithStableTagBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch && !commit.HasChildIteration + && context.SemanticVersion?.IsPreRelease == false; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + context.BaseVersionSource = commit.Value; + + yield return new BaseVersionOperand + { + Source = GetType().Name, + SemanticVersion = context.SemanticVersion.NotNull(), + BaseVersionSource = context.BaseVersionSource + }; + + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label = effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithPreReleaseTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithPreReleaseTag.cs new file mode 100644 index 0000000000..97316952f6 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithPreReleaseTag.cs @@ -0,0 +1,38 @@ +using GitVersion.Configuration; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class LastCommitOnTrunkWithPreReleaseTag : CommitOnTrunkWithPreReleaseTagBase +{ + // B 58 minutes ago (HEAD -> main) (tag 0.2.0-1) <<-- + // A 59 minutes ago + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; + + public override IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + foreach (var item in base.GetIncrements(iteration, commit, context)) + { + yield return item; + } + + if (!iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch) yield break; + context.Increment = commit.GetIncrementForcedByBranch(context.Configuration); + + var effectiveConfiguration = commit.GetEffectiveConfiguration(context.Configuration); + context.Label = effectiveConfiguration.GetBranchSpecificLabel(commit.BranchName, null); + context.ForceIncrement = false; + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithStableTag.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithStableTag.cs new file mode 100644 index 0000000000..d894a13c01 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastCommitOnTrunkWithStableTag.cs @@ -0,0 +1,32 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class LastCommitOnTrunkWithStableTag : CommitOnTrunkWithStableTagBase +{ + // B 58 minutes ago (HEAD -> main) (tag 0.2.0) <<-- + // A 59 minutes ago + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; + + public override IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + foreach (var item in base.GetIncrements(iteration, commit, context)) + { + yield return item; + } + + if (!iteration.GetEffectiveConfiguration(context.Configuration).IsMainBranch) yield break; + context.ForceIncrement = true; + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastMergeCommitOnTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastMergeCommitOnTrunk.cs new file mode 100644 index 0000000000..54d034fda9 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/LastMergeCommitOnTrunk.cs @@ -0,0 +1,12 @@ + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class LastMergeCommitOnTrunk : MergeCommitOnTrunkBase +{ + // * 55 minutes ago (HEAD -> main) <<-- + // |\ + // | B 56 minutes ago (feature/foo) + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunk.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunk.cs new file mode 100644 index 0000000000..eafd1086a3 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunk.cs @@ -0,0 +1,12 @@ +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal sealed class MergeCommitOnTrunk : MergeCommitOnTrunkBase +{ + // C 53 minutes ago (HEAD -> main) + // * 55 minutes ago <<-- + // |\ + // | B 56 minutes ago (feature/foo) + + public override bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => base.MatchPrecondition(iteration, commit, context) && commit.Successor is not null; +} diff --git a/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunkBase.cs b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunkBase.cs new file mode 100644 index 0000000000..26170a710c --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/Mainline/Trunk/MergeCommitOnTrunkBase.cs @@ -0,0 +1,80 @@ +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation.Mainline.Trunk; + +internal abstract class MergeCommitOnTrunkBase : IIncrementer +{ + public virtual bool MatchPrecondition(MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + => commit.HasChildIteration && commit.GetEffectiveConfiguration(context.Configuration).IsMainBranch && context.SemanticVersion is null; + + public virtual IEnumerable GetIncrements( + MainlineIteration iteration, MainlineCommit commit, MainlineContext context) + { + if (commit.ChildIteration is null) throw new InvalidOperationException("The commit child iteration is null."); + + return GetIncrementsInternal(); + + IEnumerable GetIncrementsInternal() + { + var baseVersion = MainlineVersionStrategy.DetermineBaseVersionRecursive( + iteration: commit.ChildIteration!, + targetLabel: context.TargetLabel, + incrementStrategyFinder: context.IncrementStrategyFinder, + configuration: context.Configuration + ); + + context.Label ??= baseVersion.Operator?.Label; + + var increment = VersionField.None; + + if (!commit.GetEffectiveConfiguration(context.Configuration).PreventIncrementOfMergedBranch) + { + increment = increment.Consolidate(context.Increment); + } + + if (!commit.ChildIteration.GetEffectiveConfiguration(context.Configuration).PreventIncrementWhenBranchMerged) + { + increment = increment.Consolidate(baseVersion.Operator?.Increment); + } + + if (commit.GetEffectiveConfiguration(context.Configuration).CommitMessageIncrementing != CommitMessageIncrementMode.Disabled) + { + increment = increment.Consolidate(commit.Increment); + } + context.Increment = increment; + + if (baseVersion.BaseVersionSource is not null) + { + context.BaseVersionSource = baseVersion.BaseVersionSource; + context.SemanticVersion = baseVersion.SemanticVersion; + context.ForceIncrement = baseVersion.Operator?.ForceIncrement ?? false; + } + else if (baseVersion.Operator?.AlternativeSemanticVersion is not null) + { + context.AlternativeSemanticVersions.Add(baseVersion.Operator.AlternativeSemanticVersion); + } + + if (context.SemanticVersion is not null) + { + yield return new BaseVersionOperand + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + SemanticVersion = context.SemanticVersion.NotNull() + }; + } + + yield return new BaseVersionOperator + { + Source = GetType().Name, + BaseVersionSource = context.BaseVersionSource, + Increment = context.Increment, + ForceIncrement = context.ForceIncrement, + Label = context.Label, + AlternativeSemanticVersion = context.AlternativeSemanticVersions.Max() + }; + + context.BaseVersionSource = commit.Value; + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/MainlineVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/MainlineVersionCalculator.cs deleted file mode 100644 index fd1c9d8b15..0000000000 --- a/src/GitVersion.Core/VersionCalculation/MainlineVersionCalculator.cs +++ /dev/null @@ -1,313 +0,0 @@ -using GitVersion.Common; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Logging; - -namespace GitVersion.VersionCalculation; - -internal class MainlineVersionCalculator : IMainlineVersionCalculator -{ - private readonly ILog log; - private readonly IRepositoryStore repositoryStore; - private readonly Lazy versionContext; - private readonly IIncrementStrategyFinder incrementStrategyFinder; - private GitVersionContext context => this.versionContext.Value; - - public MainlineVersionCalculator(ILog log, IRepositoryStore repositoryStore, Lazy versionContext, IIncrementStrategyFinder incrementStrategyFinder) - { - this.log = log.NotNull(); - this.repositoryStore = repositoryStore.NotNull(); - this.versionContext = versionContext.NotNull(); - this.incrementStrategyFinder = incrementStrategyFinder.NotNull(); - } - - public SemanticVersion FindMainlineModeVersion(BaseVersion baseVersion) - { - if (baseVersion.SemanticVersion.PreReleaseTag?.HasTag() == true) - { - throw new NotSupportedException("Mainline development mode doesn't yet support pre-release tags on main"); - } - - using (this.log.IndentLog("Using mainline development mode to calculate current version")) - { - var mainlineVersion = baseVersion.SemanticVersion; - - // Forward merge / PR - // * feature/foo - // / | - // main * * - // - - var mergeBase = baseVersion.BaseVersionSource; - var mainline = GetMainline(baseVersion.BaseVersionSource); - var mainlineTip = mainline.Tip; - - // when the current branch is not mainline, find the effective mainline tip for versioning the branch - if (!context.CurrentBranch.Equals(mainline)) - { - (mergeBase, mainlineTip) = FindMergeBaseBeforeForwardMerge(baseVersion.BaseVersionSource, mainline); - this.log.Info($"Current branch ({context.CurrentBranch}) was branch from {mergeBase}"); - } - - var mainlineCommitLog = this.repositoryStore.GetMainlineCommitLog(baseVersion.BaseVersionSource, mainlineTip).ToList(); - var directCommits = new List(mainlineCommitLog.Count); - - var nextVersion = context.FullConfiguration.NextVersion; - if (nextVersion.IsNullOrEmpty()) - { - // Scans commit log in reverse, aggregating merge commits - foreach (var commit in mainlineCommitLog) - { - directCommits.Add(commit); - if (commit.Parents.Count() > 1) - { - mainlineVersion = AggregateMergeCommitIncrement(commit, directCommits, mainlineVersion, mainline); - } - } - - // This will increment for any direct commits on mainline - mainlineVersion = IncrementForEachCommit(directCommits, mainlineVersion, mainline); - } - - mainlineVersion.BuildMetaData = CreateVersionBuildMetaData(mergeBase); - - // branches other than main always get a bump for the act of branching - if (!context.CurrentBranch.Equals(mainline) && nextVersion.IsNullOrEmpty()) - { - var branchIncrement = FindMessageIncrement(null, context.CurrentCommit, mergeBase, mainlineCommitLog); - this.log.Info($"Performing {branchIncrement} increment for current branch "); - - mainlineVersion = mainlineVersion.IncrementVersion(branchIncrement); - } - - return mainlineVersion; - } - } - - public SemanticVersionBuildMetaData CreateVersionBuildMetaData(ICommit? baseVersionSource) - { - var commitLog = this.repositoryStore.GetCommitLog(baseVersionSource, context.CurrentCommit); - var commitsSinceTag = commitLog.Count(); - this.log.Info($"{commitsSinceTag} commits found between {baseVersionSource} and {context.CurrentCommit}"); - - var shortSha = context.CurrentCommit?.Id.ToString(7); - return new SemanticVersionBuildMetaData( - baseVersionSource?.Sha, - commitsSinceTag, - context.CurrentBranch.Name.Friendly, - context.CurrentCommit?.Sha, - shortSha, - context.CurrentCommit?.When, - context.NumberOfUncommittedChanges); - } - - - private SemanticVersion AggregateMergeCommitIncrement(ICommit commit, List directCommits, SemanticVersion mainlineVersion, IBranch mainline) - { - // Merge commit, process all merged commits as a batch - var mergeCommit = commit; - var mergedHead = GetMergedHead(mergeCommit); - var findMergeBase = this.repositoryStore.FindMergeBase(mergeCommit.Parents.First(), mergedHead); - var findMessageIncrement = FindMessageIncrement(mergeCommit, mergedHead, findMergeBase, directCommits); - - // If this collection is not empty there has been some direct commits against main - // Treat each commit as it's own 'release', we need to do this before we increment the branch - mainlineVersion = IncrementForEachCommit(directCommits, mainlineVersion, mainline); - directCommits.Clear(); - - // Finally increment for the branch - mainlineVersion = mainlineVersion.IncrementVersion(findMessageIncrement); - this.log.Info($"Merge commit {mergeCommit} incremented base versions {findMessageIncrement}, now {mainlineVersion}"); - return mainlineVersion; - } - - private IBranch GetMainline(ICommit? baseVersionSource) - { - var mainlineBranchConfigs = context.FullConfiguration.Branches.Where(b => b.Value?.IsMainline == true).ToList(); - - IDictionary> mainlineBranches = new Dictionary>(); - if (context.CurrentCommit != null) - { - mainlineBranches = this.repositoryStore.GetMainlineBranches(context.CurrentCommit, context.FullConfiguration, mainlineBranchConfigs); - } - - if (!mainlineBranches.Any()) - { - var mainlineBranchConfigsString = string.Join(", ", mainlineBranchConfigs.Where(x => x.Value != null).Select(b => b.Value?.Name)); - throw new WarningException($"No branches can be found matching the commit {context.CurrentCommit?.Sha} in the configured Mainline branches: {mainlineBranchConfigsString}"); - } - - var mainlineBranchNames = mainlineBranches.Values.SelectMany(branches => branches.Select(b => b.Name.Friendly)); - this.log.Info("Found possible mainline branches: " + string.Join(", ", mainlineBranchNames)); - - // Find closest mainline branch - var firstMatchingCommit = context.CurrentBranch.Commits?.FirstOrDefault(c => mainlineBranches.ContainsKey(c.Sha)); - if (firstMatchingCommit is null) - { - var mainlineBranchList = mainlineBranches.Values.SelectMany(x => x).ToList(); - return FindMainlineBranch(mainlineBranchList, baseVersionSource, context.CurrentCommit); - } - - var possibleMainlineBranches = mainlineBranches[firstMatchingCommit.Sha]; - return FindMainlineBranch(possibleMainlineBranches, baseVersionSource, firstMatchingCommit); - } - - private IBranch FindMainlineBranch(List possibleMainlineBranches, ICommit? baseVersionSource, ICommit? firstMatchingCommit) - { - if (possibleMainlineBranches.Count == 1) - { - var mainlineBranch = possibleMainlineBranches[0]; - this.log.Info($"Mainline for current branch is {mainlineBranch}"); - return mainlineBranch; - } - - // prefer current branch, if it is a mainline branch - if (possibleMainlineBranches.Any(context.CurrentBranch.Equals)) - { - this.log.Info($"Choosing {context.CurrentBranch} as mainline because it is the current branch"); - return context.CurrentBranch; - } - - // prefer a branch on which the merge base was a direct commit, if there is such a branch - var firstMatchingCommitBranch = firstMatchingCommit != null - ? possibleMainlineBranches.FirstOrDefault(b => this.repositoryStore.IsCommitOnBranch(baseVersionSource, b, firstMatchingCommit)) - : null; - - if (firstMatchingCommitBranch != null) - { - var message = string.Format( - "Choosing {0} as mainline because {1}'s merge base was a direct commit to {0}", - firstMatchingCommitBranch, - context.CurrentBranch); - this.log.Info(message); - - return firstMatchingCommitBranch; - } - - var chosenMainline = possibleMainlineBranches[0]; - this.log.Info($"Multiple mainlines ({string.Join(", ", possibleMainlineBranches.Select(b => b))}) have the same merge base for the current branch, choosing {chosenMainline} because we found that branch first..."); - return chosenMainline; - } - - - /// - /// Gets the commit on mainline at which was fully integrated. - /// - /// The collection of commits made directly to mainline, in reverse order. - /// The best possible merge base between and the current commit. - /// The tip of the mainline branch. - /// The commit on mainline at which was merged, if such a commit exists; otherwise, . - /// - /// This method gets the most recent commit on mainline that should be considered for versioning the current branch. - /// - private ICommit? GetEffectiveMainlineTip(IEnumerable mainlineCommitLog, ICommit mergeBase, ICommit? mainlineTip) - { - // find the commit that merged mergeBase into mainline - foreach (var commit in mainlineCommitLog) - { - if (Equals(commit, mergeBase) || commit.Parents.Contains(mergeBase)) - { - this.log.Info($"Found branch merge point; choosing {commit} as effective mainline tip"); - return commit; - } - } - - return mainlineTip; - } - - /// - /// Gets the best possible merge base between the current commit and that is not the child of a forward merge. - /// - /// The commit that establishes the contextual base version. - /// The mainline branch. - /// The best possible merge base between the current commit and that is not the child of a forward merge. - private (ICommit? mergeBase, ICommit? mainlineTip) FindMergeBaseBeforeForwardMerge(ICommit? baseVersionSource, IBranch mainline) - { - var mainlineTipCurrent = mainline.Tip; - var mainlineCommitLog = this.repositoryStore.GetMainlineCommitLog(baseVersionSource, mainlineTipCurrent).ToList(); - - // find the mainline commit effective for versioning the current branch - if (context.CurrentCommit != null && mainlineTipCurrent != null) - { - var mergeBase = this.repositoryStore.FindMergeBase(context.CurrentCommit, mainlineTipCurrent); - if (mergeBase != null) - { - var mainlineTip = GetEffectiveMainlineTip(mainlineCommitLog, mergeBase, mainlineTipCurrent); - - // detect forward merge and rewind mainlineTip to before it - if (Equals(mergeBase, context.CurrentCommit) && !mainlineCommitLog.Contains(mergeBase)) - { - var mainlineTipPrevious = mainlineTip?.Parents.FirstOrDefault(); - if (mainlineTipPrevious != null) - { - this.log.Info($"Detected forward merge at {mainlineTip}; rewinding mainline to previous commit {mainlineTipPrevious}"); - - // re-do mergeBase detection before the forward merge - mergeBase = this.repositoryStore.FindMergeBase(context.CurrentCommit, mainlineTipPrevious); - if (mergeBase != null) - mainlineTip = GetEffectiveMainlineTip(mainlineCommitLog, mergeBase, mainlineTipPrevious); - } - } - - return (mergeBase, mainlineTip); - } - } - return (null, null); - } - - private SemanticVersion IncrementForEachCommit(IEnumerable directCommits, SemanticVersion mainlineVersion, INamedReference mainline) - { - foreach (var directCommit in directCommits) - { - var directCommitIncrement = this.incrementStrategyFinder.GetIncrementForCommits(context.FullConfiguration, new[] { directCommit }) - ?? FindDefaultIncrementForBranch(context, mainline.Name.Friendly); - mainlineVersion = mainlineVersion.IncrementVersion(directCommitIncrement); - this.log.Info($"Direct commit on main {directCommit} incremented base versions {directCommitIncrement}, now {mainlineVersion}"); - } - - return mainlineVersion; - } - - private VersionField FindMessageIncrement(ICommit? mergeCommit, ICommit? mergedHead, ICommit? findMergeBase, List commitLog) - { - var commits = this.repositoryStore.GetMergeBaseCommits(mergeCommit, mergedHead, findMergeBase); - commitLog.RemoveAll(c => commits.Any(c1 => c1.Sha == c.Sha)); - return this.incrementStrategyFinder.GetIncrementForCommits(context.FullConfiguration, commits) ?? TryFindIncrementFromMergeMessage(mergeCommit); - } - - private VersionField TryFindIncrementFromMergeMessage(ICommit? mergeCommit) - { - if (mergeCommit != null) - { - var mergeMessage = new MergeMessage(mergeCommit.Message, context.FullConfiguration); - var config = context.FullConfiguration.GetBranchConfiguration(mergeMessage.MergedBranch); - if (config?.Increment != null && config.Increment != IncrementStrategy.Inherit) - { - return config.Increment.Value.ToVersionField(); - } - } - - // Fallback to config increment value - return FindDefaultIncrementForBranch(context); - } - - private static VersionField FindDefaultIncrementForBranch(GitVersionContext context, string? branchName = null) - { - var config = context.FullConfiguration.GetBranchConfiguration(branchName ?? context.CurrentBranch.Name.WithoutRemote); - if (config?.Increment != null && config.Increment != IncrementStrategy.Inherit) - { - return config.Increment.Value.ToVersionField(); - } - - // Fallback to patch - return VersionField.Patch; - } - - private static ICommit GetMergedHead(ICommit mergeCommit) - { - var parents = mergeCommit.Parents.Skip(1).ToList(); - if (parents.Count > 1) - throw new NotSupportedException("Mainline development does not support more than one merge source in a single commit yet"); - return parents.Single(); - } -} diff --git a/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs b/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs index 2e611b0c5d..1ea682c23e 100644 --- a/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs +++ b/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs @@ -1,20 +1,29 @@ using System.Diagnostics.CodeAnalysis; +using GitVersion.Extensions; +using GitVersion.Git; namespace GitVersion.VersionCalculation; -public class MinDateVersionFilter : IVersionFilter +internal class MinDateVersionFilter(DateTimeOffset minimum) : IVersionFilter { - private readonly DateTimeOffset minimum; + public bool Exclude(IBaseVersion baseVersion, [NotNullWhen(true)] out string? reason) + { + baseVersion.NotNull(); - public MinDateVersionFilter(DateTimeOffset minimum) => this.minimum = minimum; + reason = null; - public bool Exclude(BaseVersion version, [NotNullWhen(true)] out string? reason) - { - if (version == null) throw new ArgumentNullException(nameof(version)); + if (baseVersion.BaseVersionSource == null || baseVersion.BaseVersionSource.When >= minimum) + return false; + reason = "Source was ignored due to commit date being outside of configured range"; + return true; + } + + public bool Exclude(ICommit? commit, [NotNullWhen(true)] out string? reason) + { reason = null; - if (version.BaseVersionSource == null || version.BaseVersionSource.When >= this.minimum) + if (commit == null || commit.When >= minimum) return false; reason = "Source was ignored due to commit date being outside of configured range"; diff --git a/src/GitVersion.Core/VersionCalculation/NextVersion.cs b/src/GitVersion.Core/VersionCalculation/NextVersion.cs index 4d23c16e0d..fb21719cd9 100644 --- a/src/GitVersion.Core/VersionCalculation/NextVersion.cs +++ b/src/GitVersion.Core/VersionCalculation/NextVersion.cs @@ -1,30 +1,38 @@ +using GitVersion.Configuration; using GitVersion.Extensions; -using GitVersion.Model.Configuration; namespace GitVersion.VersionCalculation; -public class NextVersion +public class NextVersion(SemanticVersion incrementedVersion, IBaseVersion baseVersion, EffectiveBranchConfiguration configuration) + : IComparable, IEquatable { - public BaseVersion BaseVersion { get; set; } + public IBaseVersion BaseVersion { get; } = baseVersion.NotNull(); - public SemanticVersion IncrementedVersion { get; } + public SemanticVersion IncrementedVersion { get; } = incrementedVersion.NotNull(); - public IBranch Branch { get; } + public EffectiveBranchConfiguration BranchConfiguration { get; } = configuration; - public EffectiveConfiguration Configuration { get; } + public EffectiveConfiguration Configuration => BranchConfiguration.Value; - public NextVersion(SemanticVersion incrementedVersion, BaseVersion baseVersion, EffectiveBranchConfiguration configuration) - : this(incrementedVersion, baseVersion, configuration.NotNull().Branch, configuration.NotNull().Value) - { - } + public int CompareTo(NextVersion? other) => IncrementedVersion.CompareTo(other?.IncrementedVersion); - public NextVersion(SemanticVersion incrementedVersion, BaseVersion baseVersion, IBranch branch, EffectiveConfiguration configuration) - { - IncrementedVersion = incrementedVersion.NotNull(); - BaseVersion = baseVersion.NotNull(); - Configuration = configuration.NotNull(); - Branch = branch.NotNull(); - } + public static bool operator ==(NextVersion left, NextVersion? right) => left.CompareTo(right) == 0; + + public static bool operator !=(NextVersion left, NextVersion right) => left.CompareTo(right) != 0; + + public static bool operator <(NextVersion left, NextVersion right) => left.CompareTo(right) < 0; + + public static bool operator <=(NextVersion left, NextVersion right) => left.CompareTo(right) <= 0; + + public static bool operator >(NextVersion left, NextVersion right) => left.CompareTo(right) > 0; + + public static bool operator >=(NextVersion left, NextVersion right) => left.CompareTo(right) >= 0; + + public bool Equals(NextVersion? other) => this == other; + + public override bool Equals(object? other) => other is NextVersion nextVersion && Equals(nextVersion); public override string ToString() => $"{BaseVersion} | {IncrementedVersion}"; + + public override int GetHashCode() => ToString().GetHashCode(); } diff --git a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs deleted file mode 100644 index 7103ef1c08..0000000000 --- a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs +++ /dev/null @@ -1,161 +0,0 @@ -using GitVersion.Common; -using GitVersion.Configuration; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.Model.Configuration; - -namespace GitVersion.VersionCalculation; - -public class NextVersionCalculator : INextVersionCalculator -{ - private readonly ILog log; - private readonly IBaseVersionCalculator baseVersionCalculator; - private readonly IMainlineVersionCalculator mainlineVersionCalculator; - private readonly IRepositoryStore repositoryStore; - private readonly IIncrementStrategyFinder incrementStrategyFinder; - private readonly Lazy versionContext; - - private GitVersionContext Context => this.versionContext.Value; - - public NextVersionCalculator( - ILog log, - IBaseVersionCalculator baseVersionCalculator, - IMainlineVersionCalculator mainlineVersionCalculator, - IRepositoryStore repositoryStore, - IIncrementStrategyFinder incrementStrategyFinder, - Lazy versionContext) - { - this.log = log.NotNull(); - this.baseVersionCalculator = baseVersionCalculator.NotNull(); - this.mainlineVersionCalculator = mainlineVersionCalculator.NotNull(); - this.repositoryStore = repositoryStore.NotNull(); - this.incrementStrategyFinder = incrementStrategyFinder.NotNull(); - this.versionContext = versionContext.NotNull(); - } - - public NextVersion FindVersion() - { - this.log.Info($"Running against branch: {Context.CurrentBranch} ({Context.CurrentCommit?.ToString() ?? "-"})"); - if (Context.IsCurrentCommitTagged) - { - this.log.Info($"Current commit is tagged with version {Context.CurrentCommitTaggedVersion}, " + "version calculation is for metadata only."); - } - - SemanticVersion? taggedSemanticVersion = null; - - if (Context.IsCurrentCommitTagged) - { - // Will always be 0, don't bother with the +0 on tags - var semanticVersionBuildMetaData = this.mainlineVersionCalculator.CreateVersionBuildMetaData(Context.CurrentCommit); - semanticVersionBuildMetaData.CommitsSinceTag = null; - - var semanticVersion = new SemanticVersion(Context.CurrentCommitTaggedVersion) { BuildMetaData = semanticVersionBuildMetaData }; - taggedSemanticVersion = semanticVersion; - } - - var (baseVersion, configuration) = this.baseVersionCalculator.GetBaseVersion(); - baseVersion.SemanticVersion.BuildMetaData = this.mainlineVersionCalculator.CreateVersionBuildMetaData(baseVersion.BaseVersionSource); - SemanticVersion semver; - if (Context.FullConfiguration.VersioningMode == VersioningMode.Mainline) - { - semver = this.mainlineVersionCalculator.FindMainlineModeVersion(baseVersion); - } - else - { - if (taggedSemanticVersion?.BuildMetaData == null || (taggedSemanticVersion.BuildMetaData?.Sha != baseVersion.SemanticVersion.BuildMetaData.Sha)) - { - semver = PerformIncrement(baseVersion, configuration.Value); - semver.BuildMetaData = this.mainlineVersionCalculator.CreateVersionBuildMetaData(baseVersion.BaseVersionSource); - } - else - { - semver = baseVersion.SemanticVersion; - } - } - - var hasPreReleaseTag = semver.PreReleaseTag?.HasTag() == true; - var tag = configuration.Value.Tag; - var branchConfigHasPreReleaseTagConfigured = !tag.IsNullOrEmpty(); - var branchConfigIsMainlineAndHasEmptyPreReleaseTagConfigured = configuration.Value.IsMainline && tag.IsEmpty(); - var preReleaseTagDoesNotMatchConfiguration = hasPreReleaseTag - && (branchConfigHasPreReleaseTagConfigured || branchConfigIsMainlineAndHasEmptyPreReleaseTagConfigured) - && semver.PreReleaseTag?.Name != tag; - var preReleaseTagOnlyInBranchConfig = !hasPreReleaseTag && branchConfigHasPreReleaseTagConfigured; - if (preReleaseTagOnlyInBranchConfig || preReleaseTagDoesNotMatchConfiguration) - { - UpdatePreReleaseTag(configuration.Value, semver, baseVersion.BranchNameOverride); - } - - if (taggedSemanticVersion != null) - { - // replace calculated version with tagged version only if tagged version greater or equal to calculated version - if (semver.CompareTo(taggedSemanticVersion, false) > 0) - { - taggedSemanticVersion = null; - } - else if (taggedSemanticVersion.BuildMetaData != null) - { - // set the commit count on the tagged ver - taggedSemanticVersion.BuildMetaData.CommitsSinceVersionSource = semver.BuildMetaData?.CommitsSinceVersionSource; - - // set the updated prerelease tag when it doesn't match with prerelease tag defined in branch configuration - if (preReleaseTagDoesNotMatchConfiguration) - { - taggedSemanticVersion.PreReleaseTag = semver.PreReleaseTag; - } - } - } - - var incrementedVersion = taggedSemanticVersion ?? semver; - return new(incrementedVersion, baseVersion, configuration); - } - - private SemanticVersion PerformIncrement(BaseVersion baseVersion, EffectiveConfiguration configuration) - { - var semver = baseVersion.SemanticVersion; - var increment = this.incrementStrategyFinder.DetermineIncrementedField(Context, baseVersion, configuration); - semver = semver.IncrementVersion(increment); - return semver; - } - - private void UpdatePreReleaseTag(EffectiveConfiguration configuration, SemanticVersion semanticVersion, string? branchNameOverride) - { - var tagToUse = configuration.GetBranchSpecificTag(this.log, Context.CurrentBranch.Name.Friendly, branchNameOverride); - - if (configuration.IsMainline && tagToUse.IsEmpty()) - { - semanticVersion.PreReleaseTag = new SemanticVersionPreReleaseTag(tagToUse, null); - return; - } - - long? number = null; - - var lastTag = this.repositoryStore - .GetVersionTagsOnBranch(Context.CurrentBranch, Context.FullConfiguration.TagPrefix) - .FirstOrDefault(v => v.PreReleaseTag?.Name?.IsEquivalentTo(tagToUse) == true); - - if (lastTag != null && MajorMinorPatchEqual(lastTag, semanticVersion) && lastTag.PreReleaseTag?.HasTag() == true) - { - number = lastTag.PreReleaseTag.Number + 1; - } - - number ??= 1; - - semanticVersion.PreReleaseTag = new SemanticVersionPreReleaseTag(tagToUse, number); - } - - private static void EnsureHeadIsNotDetached(GitVersionContext context) - { - if (context.CurrentBranch.IsDetachedHead != true) - { - return; - } - - var message = string.Format( - "It looks like the branch being examined is a detached Head pointing to commit '{0}'. " + "Without a proper branch name GitVersion cannot determine the build version.", - context.CurrentCommit?.Id.ToString(7)); - throw new WarningException(message); - } - - private static bool MajorMinorPatchEqual(SemanticVersion lastTag, SemanticVersion baseVersion) => lastTag.Major == baseVersion.Major && lastTag.Minor == baseVersion.Minor && lastTag.Patch == baseVersion.Patch; -} diff --git a/src/GitVersion.Core/VersionCalculation/PathFilter.cs b/src/GitVersion.Core/VersionCalculation/PathFilter.cs new file mode 100644 index 0000000000..75c93fbf13 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/PathFilter.cs @@ -0,0 +1,58 @@ +using System.Collections.Concurrent; +using System.Diagnostics.CodeAnalysis; +using System.Text.RegularExpressions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +internal enum PathFilterMode +{ + Inclusive, // All commit paths must match for commit to be excluded + //Exclusive // Any commit path must match for commit to be excluded +} + +internal class PathFilter(IReadOnlyList paths, PathFilterMode mode = PathFilterMode.Inclusive) : IVersionFilter +{ + private readonly IReadOnlyList pathsRegexes = [.. paths.Select(path => new Regex(path, RegexOptions.Compiled))]; + private readonly ConcurrentDictionary pathMatchCache = []; + + public bool Exclude(IBaseVersion baseVersion, [NotNullWhen(true)] out string? reason) + { + ArgumentNullException.ThrowIfNull(baseVersion); + return Exclude(baseVersion.BaseVersionSource, out reason); + } + + private bool IsMatch(string path) + { + if (!pathMatchCache.TryGetValue(path, out var isMatch)) + { + isMatch = this.pathsRegexes.Any(regex => regex.IsMatch(path)); + pathMatchCache[path] = isMatch; + } + return isMatch; + } + + public bool Exclude(ICommit? commit, [NotNullWhen(true)] out string? reason) + { + reason = null; + if (commit == null) + { + return false; + } + + switch (mode) + { + case PathFilterMode.Inclusive: + { + if (commit.DiffPaths.All(this.IsMatch)) + { + reason = "Source was ignored due to all commit paths matching ignore regex"; + return true; + } + break; + } + } + + return false; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs deleted file mode 100644 index a16317b618..0000000000 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs +++ /dev/null @@ -1,309 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Text.RegularExpressions; -using GitVersion.Extensions; - -namespace GitVersion; - -public class SemanticVersion : IFormattable, IComparable, IEquatable -{ - private static readonly SemanticVersion Empty = new(); - - private static readonly Regex ParseSemVer = new( - @"^(?(?\d+)(\.(?\d+))?(\.(?\d+))?)(\.(?\d+))?(-(?[^\+]*))?(\+(?.*))?$", - RegexOptions.Compiled); - - public long Major; - public long Minor; - public long Patch; - public SemanticVersionPreReleaseTag? PreReleaseTag; - public SemanticVersionBuildMetaData? BuildMetaData; - - public SemanticVersion(long major = 0, long minor = 0, long patch = 0) - { - this.Major = major; - this.Minor = minor; - this.Patch = patch; - this.PreReleaseTag = new SemanticVersionPreReleaseTag(); - this.BuildMetaData = new SemanticVersionBuildMetaData(); - } - - public SemanticVersion(SemanticVersion? semanticVersion) - { - this.Major = semanticVersion?.Major ?? 0; - this.Minor = semanticVersion?.Minor ?? 0; - this.Patch = semanticVersion?.Patch ?? 0; - - this.PreReleaseTag = new SemanticVersionPreReleaseTag(semanticVersion?.PreReleaseTag); - this.BuildMetaData = new SemanticVersionBuildMetaData(semanticVersion?.BuildMetaData); - } - - public bool Equals(SemanticVersion? obj) - { - if (obj == null) - { - return false; - } - return this.Major == obj.Major && - this.Minor == obj.Minor && - this.Patch == obj.Patch && - this.PreReleaseTag == obj.PreReleaseTag && - this.BuildMetaData == obj.BuildMetaData; - } - - public bool IsEmpty() => Equals(Empty); - - public override bool Equals(object? obj) - { - if (obj is null) - { - return false; - } - if (ReferenceEquals(this, obj)) - { - return true; - } - return obj.GetType() == GetType() && Equals((SemanticVersion)obj); - } - - public override int GetHashCode() - { - unchecked - { - var hashCode = this.Major.GetHashCode(); - hashCode = (hashCode * 397) ^ this.Minor.GetHashCode(); - hashCode = (hashCode * 397) ^ this.Patch.GetHashCode(); - hashCode = (hashCode * 397) ^ (this.PreReleaseTag != null ? this.PreReleaseTag.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (this.BuildMetaData != null ? this.BuildMetaData.GetHashCode() : 0); - return hashCode; - } - } - - public static bool operator ==(SemanticVersion? v1, SemanticVersion? v2) - { - if (v1 is null) - { - return v2 is null; - } - return v1.Equals(v2); - } - - public static bool operator !=(SemanticVersion? v1, SemanticVersion? v2) => !(v1 == v2); - - public static bool operator >(SemanticVersion v1, SemanticVersion v2) - { - if (v1 == null) - throw new ArgumentNullException(nameof(v1)); - if (v2 == null) - throw new ArgumentNullException(nameof(v2)); - return v1.CompareTo(v2) > 0; - } - - public static bool operator >=(SemanticVersion v1, SemanticVersion v2) - { - if (v1 == null) - throw new ArgumentNullException(nameof(v1)); - if (v2 == null) - throw new ArgumentNullException(nameof(v2)); - return v1.CompareTo(v2) >= 0; - } - - public static bool operator <=(SemanticVersion v1, SemanticVersion v2) - { - if (v1 == null) - throw new ArgumentNullException(nameof(v1)); - if (v2 == null) - throw new ArgumentNullException(nameof(v2)); - - return v1.CompareTo(v2) <= 0; - } - - public static bool operator <(SemanticVersion v1, SemanticVersion v2) - { - if (v1 == null) - throw new ArgumentNullException(nameof(v1)); - if (v2 == null) - throw new ArgumentNullException(nameof(v2)); - - return v1.CompareTo(v2) < 0; - } - - public static SemanticVersion Parse(string version, string? tagPrefixRegex) - { - if (!TryParse(version, tagPrefixRegex, out var semanticVersion)) - throw new WarningException($"Failed to parse {version} into a Semantic Version"); - - return semanticVersion; - } - - public static bool TryParse(string version, string? tagPrefixRegex, [NotNullWhen(true)] out SemanticVersion? semanticVersion) - { - var match = Regex.Match(version, $"^({tagPrefixRegex})?(?.*)$"); - - if (!match.Success) - { - semanticVersion = null; - return false; - } - - version = match.Groups["version"].Value; - var parsed = ParseSemVer.Match(version); - - if (!parsed.Success) - { - semanticVersion = null; - return false; - } - - var semanticVersionBuildMetaData = SemanticVersionBuildMetaData.Parse(parsed.Groups["BuildMetaData"].Value); - var fourthPart = parsed.Groups["FourthPart"]; - if (fourthPart.Success && semanticVersionBuildMetaData.CommitsSinceTag == null) - { - semanticVersionBuildMetaData.CommitsSinceTag = int.Parse(fourthPart.Value); - } - - semanticVersion = new SemanticVersion - { - Major = long.Parse(parsed.Groups["Major"].Value), - Minor = parsed.Groups["Minor"].Success ? long.Parse(parsed.Groups["Minor"].Value) : 0, - Patch = parsed.Groups["Patch"].Success ? long.Parse(parsed.Groups["Patch"].Value) : 0, - PreReleaseTag = SemanticVersionPreReleaseTag.Parse(parsed.Groups["Tag"].Value), - BuildMetaData = semanticVersionBuildMetaData - }; - - return true; - } - - public int CompareTo(SemanticVersion value) => CompareTo(value, true); - - public int CompareTo(SemanticVersion? value, bool includePrerelease) - { - if (value == null) - { - return 1; - } - if (this.Major != value.Major) - { - if (this.Major > value.Major) - { - return 1; - } - return -1; - } - if (this.Minor != value.Minor) - { - if (this.Minor > value.Minor) - { - return 1; - } - return -1; - } - if (this.Patch != value.Patch) - { - if (this.Patch > value.Patch) - { - return 1; - } - return -1; - } - if (includePrerelease && this.PreReleaseTag != value.PreReleaseTag) - { - if (this.PreReleaseTag > value.PreReleaseTag) - { - return 1; - } - return -1; - } - - return 0; - } - - public override string ToString() => ToString("s"); - - public string ToString(string format) => ToString(format, CultureInfo.CurrentCulture); - - /// - /// s - Default SemVer [1.2.3-beta.4] - /// f - Full SemVer [1.2.3-beta.4+5] - /// i - Informational SemVer [1.2.3-beta.4+5.Branch.main.BranchType.main.Sha.000000] - /// j - Just the SemVer part [1.2.3] - /// t - SemVer with the tag [1.2.3-beta.4] - /// l - Legacy SemVer tag for systems which do not support SemVer 2.0 properly [1.2.3-beta4] - /// lp - Legacy SemVer tag for systems which do not support SemVer 2.0 properly (padded) [1.2.3-beta0004] - /// - public string ToString(string? format, IFormatProvider? formatProvider) - { - if (format.IsNullOrEmpty()) - format = "s"; - - if (formatProvider?.GetFormat(GetType()) is ICustomFormatter formatter) - return formatter.Format(format, this, formatProvider); - - // Check for lp first because the param can vary - format = format.ToLower(); - if (format.StartsWith("lp", StringComparison.Ordinal)) - { - // handle the padding - return this.PreReleaseTag?.HasTag() == true ? $"{ToString("j")}-{this.PreReleaseTag.ToString(format)}" : ToString("j"); - } - - switch (format) - { - case "j": - return $"{this.Major}.{this.Minor}.{this.Patch}"; - case "s": - return this.PreReleaseTag?.HasTag() == true ? $"{ToString("j")}-{this.PreReleaseTag}" : ToString("j"); - case "t": - return this.PreReleaseTag?.HasTag() == true ? $"{ToString("j")}-{this.PreReleaseTag.ToString("t")}" : ToString("j"); - case "l": - return this.PreReleaseTag?.HasTag() == true ? $"{ToString("j")}-{this.PreReleaseTag.ToString("l")}" : ToString("j"); - case "f": - { - var buildMetadata = this.BuildMetaData?.ToString(); - - return !buildMetadata.IsNullOrEmpty() ? $"{ToString("s")}+{buildMetadata}" : ToString("s"); - } - case "i": - { - var buildMetadata = this.BuildMetaData?.ToString("f"); - - return !buildMetadata.IsNullOrEmpty() ? $"{ToString("s")}+{buildMetadata}" : ToString("s"); - } - default: - throw new FormatException($"Unknown format '{format}'."); - } - } - - public SemanticVersion IncrementVersion(VersionField incrementStrategy) - { - var incremented = new SemanticVersion(this); - if (incremented.PreReleaseTag?.HasTag() != true) - { - switch (incrementStrategy) - { - case VersionField.None: - break; - case VersionField.Major: - incremented.Major++; - incremented.Minor = 0; - incremented.Patch = 0; - break; - case VersionField.Minor: - incremented.Minor++; - incremented.Patch = 0; - break; - case VersionField.Patch: - incremented.Patch++; - break; - default: - throw new ArgumentOutOfRangeException(nameof(incrementStrategy)); - } - } - else if (incremented.PreReleaseTag.Number != null) - { - incremented.PreReleaseTag.Number++; - } - - return incremented; - } -} diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs index ef809ab386..64913a061c 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs @@ -1,98 +1,60 @@ using System.Globalization; +using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; -using GitVersion.Model.Configuration; namespace GitVersion; -public class SemanticVersionFormatValues +public class SemanticVersionFormatValues(SemanticVersion semver, IGitVersionConfiguration configuration, int preReleaseWeight) { - private readonly SemanticVersion semver; - private readonly EffectiveConfiguration config; + public string Major => semver.Major.ToString(); - public SemanticVersionFormatValues(SemanticVersion semver, EffectiveConfiguration config) - { - this.semver = semver; - this.config = config; - } + public string Minor => semver.Minor.ToString(); - public string Major => this.semver.Major.ToString(); + public string Patch => semver.Patch.ToString(); - public string Minor => this.semver.Minor.ToString(); + public string PreReleaseTag => semver.PreReleaseTag.ToString(); - public string Patch => this.semver.Patch.ToString(); + public string PreReleaseTagWithDash => this.PreReleaseTag.WithPrefixIfNotNullOrEmpty("-"); - public string? PreReleaseTag => this.semver.PreReleaseTag; + public string PreReleaseLabel => semver.PreReleaseTag.Name; - public string? PreReleaseTagWithDash => this.semver.PreReleaseTag?.HasTag() == true ? "-" + this.semver.PreReleaseTag : null; + public string PreReleaseLabelWithDash => this.PreReleaseLabel.WithPrefixIfNotNullOrEmpty("-"); - public string? PreReleaseLabel => this.semver.PreReleaseTag?.HasTag() == true ? this.semver.PreReleaseTag.Name : null; + public string PreReleaseNumber => semver.PreReleaseTag.Number?.ToString() ?? string.Empty; - public string? PreReleaseLabelWithDash => this.semver.PreReleaseTag?.HasTag() == true ? "-" + this.semver.PreReleaseTag.Name : null; + public string WeightedPreReleaseNumber => semver.PreReleaseTag.Number.HasValue + ? $"{semver.PreReleaseTag.Number.Value + preReleaseWeight}" : $"{configuration.TagPreReleaseWeight}"; - public string? PreReleaseNumber => this.semver.PreReleaseTag?.HasTag() == true ? this.semver.PreReleaseTag.Number.ToString() : null; + public string BuildMetaData => semver.BuildMetaData.ToString(); - public string WeightedPreReleaseNumber => GetWeightedPreReleaseNumber(); + public string FullBuildMetaData => semver.BuildMetaData.ToString("f"); - public string? BuildMetaData => this.semver.BuildMetaData; + public string MajorMinorPatch => $"{semver.Major}.{semver.Minor}.{semver.Patch}"; - public string? BuildMetaDataPadded => this.semver.BuildMetaData?.ToString("p" + this.config.BuildMetaDataPadding); + public string SemVer => semver.ToString(); - public string? FullBuildMetaData => this.semver.BuildMetaData?.ToString("f"); + public string? AssemblySemVer => semver.GetAssemblyVersion(configuration.AssemblyVersioningScheme!.Value); - public string MajorMinorPatch => $"{this.semver.Major}.{this.semver.Minor}.{this.semver.Patch}"; + public string? AssemblyFileSemVer => semver.GetAssemblyFileVersion(configuration.AssemblyFileVersioningScheme!.Value); - public string SemVer => this.semver.ToString(); + public string FullSemVer => semver.ToString("f"); - public string LegacySemVer => this.semver.ToString("l"); + public string? BranchName => semver.BuildMetaData.Branch; - public string LegacySemVerPadded => this.semver.ToString("lp" + this.config.LegacySemVerPadding); + public string? EscapedBranchName => semver.BuildMetaData.Branch?.RegexReplace(RegexPatterns.Common.SanitizeNameRegexPattern, "-"); - public string? AssemblySemVer => this.semver.GetAssemblyVersion(this.config.AssemblyVersioningScheme); + public string? Sha => semver.BuildMetaData.Sha; - public string? AssemblyFileSemVer => this.semver.GetAssemblyFileVersion(this.config.AssemblyFileVersioningScheme); + public string? ShortSha => semver.BuildMetaData.ShortSha; - public string FullSemVer => this.semver.ToString("f"); + public string? CommitDate => semver.BuildMetaData.CommitDate?.UtcDateTime.ToString(configuration.CommitDateFormat, CultureInfo.InvariantCulture); - public string? BranchName => this.semver.BuildMetaData?.Branch; + public string InformationalVersion => semver.ToString("i"); - public string? EscapedBranchName => this.semver.BuildMetaData?.Branch?.RegexReplace("[^a-zA-Z0-9-]", "-"); + public string? VersionSourceSha => semver.BuildMetaData.VersionSourceSha; - public string? Sha => this.semver.BuildMetaData?.Sha; + public string CommitsSinceVersionSource => semver.BuildMetaData.CommitsSinceVersionSource.ToString(CultureInfo.InvariantCulture); - public string? ShortSha => this.semver.BuildMetaData?.ShortSha; - - public string? CommitDate => this.semver.BuildMetaData?.CommitDate?.UtcDateTime.ToString(this.config.CommitDateFormat, CultureInfo.InvariantCulture); - - // TODO When NuGet 3 is released: public string NuGetVersionV3 { get { return ??; } } - - public string NuGetVersionV2 => LegacySemVerPadded.ToLower(); - - public string NuGetVersion => NuGetVersionV2; - - public string? NuGetPreReleaseTagV2 => this.semver.PreReleaseTag?.HasTag() == true ? this.semver.PreReleaseTag?.ToString("lp").ToLower() : null; - - public string? NuGetPreReleaseTag => NuGetPreReleaseTagV2; - - public string InformationalVersion => this.semver.ToString("i"); - - [Obsolete("Use InformationalVersion instead")] - public string DefaultInformationalVersion => InformationalVersion; - - public string? VersionSourceSha => this.semver.BuildMetaData?.VersionSourceSha; - - public string? CommitsSinceVersionSource => this.semver.BuildMetaData?.CommitsSinceVersionSource?.ToString(CultureInfo.InvariantCulture); - - public string? CommitsSinceVersionSourcePadded => this.semver.BuildMetaData?.CommitsSinceVersionSource?.ToString(CultureInfo.InvariantCulture).PadLeft(this.config.CommitsSinceVersionSourcePadding, '0'); - - public string? UncommittedChanges => this.semver.BuildMetaData?.UncommittedChanges.ToString(CultureInfo.InvariantCulture); - - private string GetWeightedPreReleaseNumber() - { - var weightedPreReleaseNumber = - this.semver.PreReleaseTag?.HasTag() == true ? (this.semver.PreReleaseTag.Number + this.config.PreReleaseWeight).ToString() : null; - - return weightedPreReleaseNumber.IsNullOrEmpty() - ? $"{this.config.TagPreReleaseWeight}" - : weightedPreReleaseNumber; - } + public string UncommittedChanges => semver.BuildMetaData.UncommittedChanges.ToString(CultureInfo.InvariantCulture); } diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionWithTag.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionWithTag.cs new file mode 100644 index 0000000000..823c182244 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionWithTag.cs @@ -0,0 +1,10 @@ +using GitVersion.Git; + +namespace GitVersion; + +public sealed record SemanticVersionWithTag(SemanticVersion Value, ITag Tag) : IComparable +{ + public int CompareTo(SemanticVersionWithTag? other) => Value.CompareTo(other?.Value); + + public override string ToString() => $"{Tag} | {Tag.Commit} | {Value}"; +} diff --git a/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs b/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs index cf2d48ec26..7cfea684b1 100644 --- a/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs +++ b/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs @@ -1,25 +1,40 @@ using System.Diagnostics.CodeAnalysis; using GitVersion.Extensions; +using GitVersion.Git; namespace GitVersion.VersionCalculation; -public class ShaVersionFilter : IVersionFilter +internal class ShaVersionFilter(IEnumerable shaList) : IVersionFilter { - private readonly IEnumerable shas; + private readonly IEnumerable shaList = shaList.NotNull(); - public ShaVersionFilter(IEnumerable shas) => this.shas = shas.NotNull(); - - public bool Exclude(BaseVersion version, [NotNullWhen(true)] out string? reason) + public bool Exclude(IBaseVersion baseVersion, [NotNullWhen(true)] out string? reason) { - if (version == null) throw new ArgumentNullException(nameof(version)); + baseVersion.NotNull(); reason = null; - if (version.BaseVersionSource == null || !this.shas.Any(sha => version.BaseVersionSource.Sha.StartsWith(sha, StringComparison.OrdinalIgnoreCase))) + if (baseVersion.BaseVersionSource == null + || !this.shaList.Any(sha => baseVersion.BaseVersionSource.Sha.StartsWith(sha, StringComparison.OrdinalIgnoreCase))) + { return false; + } - reason = $"Sha {version.BaseVersionSource} was ignored due to commit having been excluded by configuration"; + reason = $"Sha {baseVersion.BaseVersionSource} was ignored due to commit having been excluded by configuration"; return true; + } + + public bool Exclude(ICommit? commit, [NotNullWhen(true)] out string? reason) + { + reason = null; + + if (commit == null + || !this.shaList.Any(sha => commit.Sha.StartsWith(sha, StringComparison.OrdinalIgnoreCase))) + { + return false; + } + reason = $"Sha {commit} was ignored due to commit having been excluded by configuration"; + return true; } } diff --git a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs index 1924666e1d..424c91711b 100644 --- a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs +++ b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs @@ -1,75 +1,49 @@ -using System.Text.RegularExpressions; using GitVersion.Configuration; +using GitVersion.Core; using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.Model.Configuration; +using GitVersion.Formatting; using GitVersion.OutputVariables; namespace GitVersion.VersionCalculation; -public class VariableProvider : IVariableProvider +internal sealed class VariableProvider(IEnvironment environment) : IVariableProvider { - private readonly IEnvironment environment; - private readonly ILog log; + private readonly IEnvironment environment = environment.NotNull(); - public VariableProvider(IEnvironment environment, ILog log) + public GitVersionVariables GetVariablesFor( + SemanticVersion semanticVersion, IGitVersionConfiguration configuration, int preReleaseWeight) { - this.environment = environment.NotNull(); - this.log = log.NotNull(); - } - - public VersionVariables GetVariablesFor(SemanticVersion semanticVersion, EffectiveConfiguration config, bool isCurrentCommitTagged) - { - var isContinuousDeploymentMode = config.VersioningMode == VersioningMode.ContinuousDeployment && !isCurrentCommitTagged; - if (isContinuousDeploymentMode) - { - semanticVersion = new SemanticVersion(semanticVersion); - // Continuous Deployment always requires a pre-release tag unless the commit is tagged - if (semanticVersion.PreReleaseTag != null && semanticVersion.PreReleaseTag.HasTag() != true) - { - semanticVersion.PreReleaseTag.Name = config.GetBranchSpecificTag(this.log, semanticVersion.BuildMetaData?.Branch, null); - if (semanticVersion.PreReleaseTag.Name.IsNullOrEmpty()) - { - semanticVersion.PreReleaseTag.Name = config.ContinuousDeploymentFallbackTag; - } - } - } - - // Evaluate tag number pattern and append to prerelease tag, preserving build metadata - var appendTagNumberPattern = !config.TagNumberPattern.IsNullOrEmpty() && semanticVersion.PreReleaseTag?.HasTag() == true; - if (appendTagNumberPattern) - { - if (semanticVersion.BuildMetaData?.Branch != null && config.TagNumberPattern != null) - { - var match = Regex.Match(semanticVersion.BuildMetaData.Branch, config.TagNumberPattern); - var numberGroup = match.Groups["number"]; - if (numberGroup.Success && semanticVersion.PreReleaseTag != null) - { - semanticVersion.PreReleaseTag.Name += numberGroup.Value.PadLeft(config.BuildMetaDataPadding, '0'); - } - } - } - - if (isContinuousDeploymentMode || appendTagNumberPattern || config.VersioningMode == VersioningMode.Mainline) - { - PromoteNumberOfCommitsToTagNumber(semanticVersion); - } - - var semverFormatValues = new SemanticVersionFormatValues(semanticVersion, config); - - var informationalVersion = CheckAndFormatString(config.AssemblyInformationalFormat, semverFormatValues, semverFormatValues.InformationalVersion, "AssemblyInformationalVersion"); - - var assemblyFileSemVer = CheckAndFormatString(config.AssemblyFileVersioningFormat, semverFormatValues, semverFormatValues.AssemblyFileSemVer, "AssemblyFileVersioningFormat"); - - var assemblySemVer = CheckAndFormatString(config.AssemblyVersioningFormat, semverFormatValues, semverFormatValues.AssemblySemVer, "AssemblyVersioningFormat"); - - var variables = new VersionVariables( + semanticVersion.NotNull(); + configuration.NotNull(); + + var semverFormatValues = new SemanticVersionFormatValues(semanticVersion, configuration, preReleaseWeight); + + var informationalVersion = CheckAndFormatString( + configuration.AssemblyInformationalFormat, + semverFormatValues, + semverFormatValues.InformationalVersion, + "AssemblyInformationalVersion" + ); + + var assemblyFileSemVer = CheckAndFormatString( + configuration.AssemblyFileVersioningFormat, + semverFormatValues, + semverFormatValues.AssemblyFileSemVer, + "AssemblyFileVersioningFormat" + ); + + var assemblySemVer = CheckAndFormatString( + configuration.AssemblyVersioningFormat, + semverFormatValues, + semverFormatValues.AssemblySemVer, + "AssemblyVersioningFormat" + ); + + return new( semverFormatValues.Major, semverFormatValues.Minor, semverFormatValues.Patch, semverFormatValues.BuildMetaData, - semverFormatValues.BuildMetaDataPadded, semverFormatValues.FullBuildMetaData, semverFormatValues.BranchName, semverFormatValues.EscapedBranchName, @@ -77,8 +51,6 @@ public VersionVariables GetVariablesFor(SemanticVersion semanticVersion, Effecti semverFormatValues.ShortSha, semverFormatValues.MajorMinorPatch, semverFormatValues.SemVer, - semverFormatValues.LegacySemVer, - semverFormatValues.LegacySemVerPadded, semverFormatValues.FullSemVer, assemblySemVer, assemblyFileSemVer, @@ -90,44 +62,10 @@ public VersionVariables GetVariablesFor(SemanticVersion semanticVersion, Effecti semverFormatValues.WeightedPreReleaseNumber, informationalVersion, semverFormatValues.CommitDate, - semverFormatValues.NuGetVersion, - semverFormatValues.NuGetVersionV2, - semverFormatValues.NuGetPreReleaseTag, - semverFormatValues.NuGetPreReleaseTagV2, semverFormatValues.VersionSourceSha, semverFormatValues.CommitsSinceVersionSource, - semverFormatValues.CommitsSinceVersionSourcePadded, - semverFormatValues.UncommittedChanges); - - return variables; - } - - private static void PromoteNumberOfCommitsToTagNumber(SemanticVersion semanticVersion) - { - if (semanticVersion.PreReleaseTag != null && semanticVersion.BuildMetaData != null) - { - // For continuous deployment the commits since tag gets promoted to the pre-release number - if (!semanticVersion.BuildMetaData.CommitsSinceTag.HasValue) - { - semanticVersion.PreReleaseTag.Number = null; - semanticVersion.BuildMetaData.CommitsSinceVersionSource = 0; - } - else - { - // Number of commits since last tag should be added to PreRelease number if given. Remember to deduct automatic version bump. - if (semanticVersion.PreReleaseTag.Number.HasValue) - { - semanticVersion.PreReleaseTag.Number += semanticVersion.BuildMetaData.CommitsSinceTag - 1; - } - else - { - semanticVersion.PreReleaseTag.Number = semanticVersion.BuildMetaData.CommitsSinceTag; - semanticVersion.PreReleaseTag.PromotedFromCommits = true; - } - semanticVersion.BuildMetaData.CommitsSinceVersionSource = semanticVersion.BuildMetaData.CommitsSinceTag.Value; - semanticVersion.BuildMetaData.CommitsSinceTag = null; // why is this set to null ? - } - } + semverFormatValues.UncommittedChanges + ); } private string? CheckAndFormatString(string? formatString, T source, string? defaultValue, string formatVarName) @@ -140,11 +78,10 @@ private static void PromoteNumberOfCommitsToTagNumber(SemanticVersion semanticVe } else { - WarnIfUsingObsoleteFormatValues(formatString); - try { - formattedString = formatString.FormatWith(source, this.environment).RegexReplace("[^0-9A-Za-z-.+]", "-"); + formattedString = formatString.FormatWith(source, this.environment) + .RegexReplace(RegexPatterns.Output.SanitizeAssemblyInfoRegexPattern, "-"); } catch (ArgumentException exception) { @@ -154,15 +91,4 @@ private static void PromoteNumberOfCommitsToTagNumber(SemanticVersion semanticVe return formattedString; } - - private void WarnIfUsingObsoleteFormatValues(string formatString) - { -#pragma warning disable CS0618 // Type or member is obsolete - const string obsoletePropertyName = nameof(SemanticVersionFormatValues.DefaultInformationalVersion); -#pragma warning restore CS0618 // Type or member is obsolete - if (formatString.Contains($"{{{obsoletePropertyName}}}")) - { - this.log.Write(LogLevel.Warn, $"Use format variable '{nameof(SemanticVersionFormatValues.InformationalVersion)}' instead of '{obsoletePropertyName}' which is obsolete and will be removed in a future release."); - } - } } diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculationModule.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculationModule.cs index 4b6f93e908..363f39584a 100644 --- a/src/GitVersion.Core/VersionCalculation/VersionCalculationModule.cs +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculationModule.cs @@ -10,9 +10,11 @@ public void RegisterTypes(IServiceCollection services) services.AddModule(new VersionStrategyModule()); services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); } } diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeliveryVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeliveryVersionCalculator.cs new file mode 100644 index 0000000000..91098dae31 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeliveryVersionCalculator.cs @@ -0,0 +1,42 @@ +using GitVersion.Common; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal sealed class ContinuousDeliveryVersionCalculator( + ILog log, IRepositoryStore repositoryStore, Lazy versionContext) + : VersionCalculatorBase(log, repositoryStore, versionContext), IDeploymentModeCalculator +{ + public SemanticVersion Calculate(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + using (this.log.IndentLog("Using continuous delivery workflow to calculate the incremented version.")) + { + var preReleaseTag = semanticVersion.PreReleaseTag; + if (!preReleaseTag.HasTag() || !preReleaseTag.Number.HasValue) + { + throw new WarningException("Continuous delivery requires a pre-release tag."); + } + + return CalculateInternal(semanticVersion, baseVersionSource); + } + } + + private SemanticVersion CalculateInternal(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + var buildMetaData = CreateVersionBuildMetaData(baseVersionSource); + + return new SemanticVersion(semanticVersion) + { + PreReleaseTag = new SemanticVersionPreReleaseTag(semanticVersion.PreReleaseTag) + { + Number = semanticVersion.PreReleaseTag.Number!.Value + buildMetaData.CommitsSinceTag - 1 + }, + BuildMetaData = new SemanticVersionBuildMetaData(buildMetaData) + { + CommitsSinceVersionSource = buildMetaData.CommitsSinceTag!.Value, + CommitsSinceTag = null + } + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeploymentVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeploymentVersionCalculator.cs new file mode 100644 index 0000000000..eb8bcc3acc --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ContinuousDeploymentVersionCalculator.cs @@ -0,0 +1,33 @@ +using GitVersion.Common; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal sealed class ContinuousDeploymentVersionCalculator( + ILog log, IRepositoryStore repositoryStore, Lazy versionContext) + : VersionCalculatorBase(log, repositoryStore, versionContext), IDeploymentModeCalculator +{ + public SemanticVersion Calculate(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + using (this.log.IndentLog("Using continuous deployment workflow to calculate the incremented version.")) + { + return CalculateInternal(semanticVersion, baseVersionSource); + } + } + + private SemanticVersion CalculateInternal(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + var buildMetaData = CreateVersionBuildMetaData(baseVersionSource); + + return new SemanticVersion(semanticVersion) + { + PreReleaseTag = SemanticVersionPreReleaseTag.Empty, + BuildMetaData = new SemanticVersionBuildMetaData(buildMetaData) + { + CommitsSinceVersionSource = buildMetaData.CommitsSinceTag!.Value, + CommitsSinceTag = null + } + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculators/ManualDeploymentVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ManualDeploymentVersionCalculator.cs new file mode 100644 index 0000000000..537ee7b360 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculators/ManualDeploymentVersionCalculator.cs @@ -0,0 +1,28 @@ +using GitVersion.Common; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal sealed class ManualDeploymentVersionCalculator( + ILog log, IRepositoryStore repositoryStore, Lazy versionContext) + : VersionCalculatorBase(log, repositoryStore, versionContext), IDeploymentModeCalculator +{ + public SemanticVersion Calculate(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + using (this.log.IndentLog("Using manual deployment workflow to calculate the incremented version.")) + { + return CalculateInternal(semanticVersion, baseVersionSource); + } + } + + private SemanticVersion CalculateInternal(SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + var buildMetaData = CreateVersionBuildMetaData(baseVersionSource); + + return new SemanticVersion(semanticVersion) + { + BuildMetaData = buildMetaData + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs new file mode 100644 index 0000000000..fc38d26801 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs @@ -0,0 +1,296 @@ +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal class NextVersionCalculator( + ILog log, + Lazy versionContext, + IEnumerable deploymentModeCalculators, + IEnumerable versionStrategies, + IEffectiveBranchConfigurationFinder effectiveBranchConfigurationFinder, + ITaggedSemanticVersionService taggedSemanticVersionService) + : INextVersionCalculator +{ + private readonly ILog log = log.NotNull(); + private readonly Lazy versionContext = versionContext.NotNull(); + private readonly IVersionStrategy[] versionStrategies = [.. versionStrategies.NotNull()]; + private readonly IEffectiveBranchConfigurationFinder effectiveBranchConfigurationFinder = effectiveBranchConfigurationFinder.NotNull(); + + private GitVersionContext Context => this.versionContext.Value; + + public virtual SemanticVersion FindVersion() + { + this.log.Info($"Running against branch: {Context.CurrentBranch} ({Context.CurrentCommit.ToString() ?? "-"})"); + + var branchConfiguration = Context.Configuration.GetBranchConfiguration(Context.CurrentBranch); + EffectiveConfiguration effectiveConfiguration = new(Context.Configuration, branchConfiguration); + + var someBranchRelatedPropertiesMightBeNotKnown = branchConfiguration.Increment == IncrementStrategy.Inherit; + + if (Context.IsCurrentCommitTagged && !someBranchRelatedPropertiesMightBeNotKnown && effectiveConfiguration.PreventIncrementWhenCurrentCommitTagged) + { + var allTaggedSemanticVersions = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: Context.CurrentBranch, + configuration: Context.Configuration, + label: null, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: effectiveConfiguration.GetTaggedSemanticVersion() + ); + var taggedSemanticVersionsOfCurrentCommit = allTaggedSemanticVersions[Context.CurrentCommit].ToList(); + + if (TryGetSemanticVersion(effectiveConfiguration, taggedSemanticVersionsOfCurrentCommit, out var value)) + { + return value; + } + } + + var nextVersion = CalculateNextVersion(Context.CurrentBranch, Context.Configuration); + + if (Context.IsCurrentCommitTagged && someBranchRelatedPropertiesMightBeNotKnown + && nextVersion.Configuration.PreventIncrementWhenCurrentCommitTagged) + { + var allTaggedSemanticVersions = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: Context.CurrentBranch, + configuration: Context.Configuration, + label: null, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: nextVersion.Configuration.GetTaggedSemanticVersion() + ); + var taggedSemanticVersionsOfCurrentCommit = allTaggedSemanticVersions[Context.CurrentCommit].ToList(); + + if (TryGetSemanticVersion(nextVersion.Configuration, taggedSemanticVersionsOfCurrentCommit, out var value)) + { + return value; + } + } + + var semanticVersion = CalculateSemanticVersion( + deploymentMode: nextVersion.Configuration.DeploymentMode, + semanticVersion: nextVersion.IncrementedVersion, + baseVersionSource: nextVersion.BaseVersion.BaseVersionSource + ); + + var ignore = Context.Configuration.Ignore; + var alternativeSemanticVersion = taggedSemanticVersionService.GetTaggedSemanticVersionsOfBranch( + branch: nextVersion.BranchConfiguration.Branch, + tagPrefix: Context.Configuration.TagPrefixPattern, + format: Context.Configuration.SemanticVersionFormat, + ignore: Context.Configuration.Ignore, + notOlderThan: Context.CurrentCommit.When + ).Where(element => element.Key.When <= Context.CurrentCommit.When + && !(element.Key.When <= ignore.Before) && !ignore.Shas.Contains(element.Key.Sha) + ).SelectMany(element => element).Max()?.Value; + + if (alternativeSemanticVersion is not null + && semanticVersion.IsLessThan(alternativeSemanticVersion, includePreRelease: false)) + { + semanticVersion = new SemanticVersion(semanticVersion) + { + Major = alternativeSemanticVersion.Major, + Minor = alternativeSemanticVersion.Minor, + Patch = alternativeSemanticVersion.Patch + }; + } + + return semanticVersion; + } + + private bool TryGetSemanticVersion( + EffectiveConfiguration effectiveConfiguration, + IReadOnlyCollection taggedSemanticVersionsOfCurrentCommit, + [NotNullWhen(true)] out SemanticVersion? result) + { + result = null; + + var label = effectiveConfiguration.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + var currentCommitTaggedVersion = taggedSemanticVersionsOfCurrentCommit + .Where(element => element.Value.IsMatchForBranchSpecificLabel(label)).Max(); + + if (currentCommitTaggedVersion is null) return result is not null; + SemanticVersionBuildMetaData semanticVersionBuildMetaData = new( + versionSourceSha: Context.CurrentCommit.Sha, + commitsSinceTag: null, + branch: Context.CurrentBranch.Name.Friendly, + commitSha: Context.CurrentCommit.Sha, + commitShortSha: Context.CurrentCommit.Id.ToString(7), + commitDate: Context.CurrentCommit.When, + numberOfUnCommittedChanges: Context.NumberOfUncommittedChanges + ); + + var preReleaseTag = currentCommitTaggedVersion.Value.PreReleaseTag; + if (effectiveConfiguration.DeploymentMode == DeploymentMode.ContinuousDeployment) + { + preReleaseTag = SemanticVersionPreReleaseTag.Empty; + } + + result = new SemanticVersion(currentCommitTaggedVersion.Value) + { + PreReleaseTag = preReleaseTag, + BuildMetaData = semanticVersionBuildMetaData + }; + + return true; + } + + private SemanticVersion CalculateSemanticVersion( + DeploymentMode deploymentMode, SemanticVersion semanticVersion, ICommit? baseVersionSource) + { + IDeploymentModeCalculator deploymentModeCalculator = deploymentMode switch + { + DeploymentMode.ManualDeployment => deploymentModeCalculators.SingleOfType(), + DeploymentMode.ContinuousDelivery => deploymentModeCalculators.SingleOfType(), + DeploymentMode.ContinuousDeployment => deploymentModeCalculators.SingleOfType(), + _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode)) + }; + return deploymentModeCalculator.Calculate(semanticVersion, baseVersionSource); + } + + private NextVersion CalculateNextVersion(IBranch branch, IGitVersionConfiguration configuration) + { + var nextVersions = GetNextVersions(branch, configuration); + log.Separator(); + + var maxVersion = nextVersions.Max() + ?? throw new GitVersionException("No base versions determined on the current branch."); + + ICommit? latestBaseVersionSource; + + var matchingVersionsOnceIncremented = nextVersions + .Where( + element => element.BaseVersion.BaseVersionSource != null + && element.IncrementedVersion == maxVersion.IncrementedVersion + ).ToArray(); + if (matchingVersionsOnceIncremented.Length > 1) + { + var latestVersion = matchingVersionsOnceIncremented.Aggregate(CompareVersions); + latestBaseVersionSource = latestVersion.BaseVersion.BaseVersionSource; + maxVersion = latestVersion; + log.Info( + $"Found multiple base versions which will produce the same SemVer ({maxVersion.IncrementedVersion}), " + + $"taking latest source for commit counting ({latestVersion.BaseVersion.Source})"); + } + else + { + IEnumerable filteredVersions = nextVersions; + if (!maxVersion.IncrementedVersion.PreReleaseTag.HasTag()) + { + // If the maximal version has no pre-release tag defined than we want to determine just the latest previous + // base source which are not coming from pre-release tag. + filteredVersions = filteredVersions.Where(v => !v.BaseVersion.SemanticVersion.PreReleaseTag.HasTag()); + } + + var versions = filteredVersions as NextVersion[] ?? [.. filteredVersions]; + var version = versions + .Where(v => v.BaseVersion.BaseVersionSource != null) + .OrderByDescending(v => v.IncrementedVersion) + .ThenByDescending(v => v.BaseVersion.BaseVersionSource?.When) + .FirstOrDefault(); + + version ??= versions.Where(v => v.BaseVersion.BaseVersionSource == null) + .OrderByDescending(v => v.IncrementedVersion) + .First(); + latestBaseVersionSource = version.BaseVersion.BaseVersionSource; + } + + BaseVersion calculatedBase = new() + { + Operand = new BaseVersionOperand + { + Source = maxVersion.BaseVersion.Source, + BaseVersionSource = latestBaseVersionSource, + SemanticVersion = maxVersion.BaseVersion.SemanticVersion + } + }; + + log.Info($"Base version used: {calculatedBase}"); + log.Separator(); + + return new(maxVersion.IncrementedVersion, calculatedBase, maxVersion.BranchConfiguration); + } + + private static NextVersion CompareVersions(NextVersion version1, NextVersion version2) + { + if (version1.BaseVersion.BaseVersionSource == null) + return version2; + + if (version2.BaseVersion.BaseVersionSource == null) + return version1; + + return version1.BaseVersion.BaseVersionSource.When >= version2.BaseVersion.BaseVersionSource.When + ? version1 + : version2; + } + + private List GetNextVersions(IBranch branch, IGitVersionConfiguration configuration) + { + using (log.IndentLog("Fetching the base versions for version calculation...")) + { + if (branch.Tip == null) + throw new GitVersionException("No commits found on the current branch."); + + return [.. GetNextVersionsInternal()]; + } + + IEnumerable GetNextVersionsInternal() + { + var effectiveBranchConfigurations = this.effectiveBranchConfigurationFinder.GetConfigurations(branch, configuration).ToArray(); + foreach (var effectiveBranchConfiguration in effectiveBranchConfigurations) + { + using (this.log.IndentLog($"Calculating base versions for '{effectiveBranchConfiguration.Branch.Name}'")) + { + var strategies = this.versionStrategies.ToList(); + var fallbackVersionStrategy = strategies.Find(element => element is FallbackVersionStrategy); + if (fallbackVersionStrategy is not null) + { + strategies.Remove(fallbackVersionStrategy); + strategies.Add(fallbackVersionStrategy); + } + + var atLeastOneBaseVersionReturned = false; + foreach (var versionStrategy in strategies) + { + if (atLeastOneBaseVersionReturned && versionStrategy is FallbackVersionStrategy) continue; + + using (this.log.IndentLog($"[Using '{versionStrategy.GetType().Name}' strategy]")) + { + foreach (var baseVersion in versionStrategy.GetBaseVersions(effectiveBranchConfiguration)) + { + log.Info(baseVersion.ToString()); + if (!IncludeVersion(baseVersion, configuration.Ignore)) continue; + atLeastOneBaseVersionReturned = true; + + yield return new NextVersion( + incrementedVersion: baseVersion.GetIncrementedVersion(), + baseVersion: baseVersion, + configuration: effectiveBranchConfiguration + ); + } + } + } + } + } + } + } + + private bool IncludeVersion(IBaseVersion baseVersion, IIgnoreConfiguration ignoreConfiguration) + { + foreach (var versionFilter in ignoreConfiguration.ToFilters()) + { + if (!versionFilter.Exclude(baseVersion, out var reason)) continue; + if (reason != null) + { + this.log.Info(reason); + } + + return false; + } + + return true; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs b/src/GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs new file mode 100644 index 0000000000..db6c3eb135 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionCalculators/VersionCalculatorBase.cs @@ -0,0 +1,39 @@ +using GitVersion.Common; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +internal abstract class VersionCalculatorBase( + ILog log, IRepositoryStore repositoryStore, Lazy versionContext) +{ + protected readonly ILog log = log.NotNull(); + protected readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly Lazy versionContext = versionContext.NotNull(); + + protected GitVersionContext Context => this.versionContext.Value; + + protected SemanticVersionBuildMetaData CreateVersionBuildMetaData(ICommit? baseVersionSource) + { + var commitLogs = this.repositoryStore.GetCommitLog( + baseVersionSource: baseVersionSource, + currentCommit: Context.CurrentCommit, + ignore: Context.Configuration.Ignore + ); + + var commitsSinceTag = commitLogs.Count; + this.log.Info($"{commitsSinceTag} commits found between {baseVersionSource} and {Context.CurrentCommit}"); + + var shortSha = Context.CurrentCommit.Id.ToString(7); + return new SemanticVersionBuildMetaData( + versionSourceSha: baseVersionSource?.Sha, + commitsSinceTag: commitsSinceTag, + branch: Context.CurrentBranch.Name.Friendly, + commitSha: Context.CurrentCommit.Sha, + commitShortSha: shortSha, + commitDate: Context.CurrentCommit.When, + numberOfUnCommittedChanges: Context.NumberOfUncommittedChanges + ); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersion.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersion.cs new file mode 100644 index 0000000000..28a574b6a0 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersion.cs @@ -0,0 +1,89 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public sealed record BaseVersion(BaseVersionOperand Operand) : IBaseVersion +{ + public BaseVersion() : this(new BaseVersionOperand()) + { + } + + public BaseVersion(string source, SemanticVersion semanticVersion, ICommit? baseVersionSource = null) + : this(new BaseVersionOperand(source, semanticVersion, baseVersionSource)) + { + } + + public string Source => (Operator?.Source).IsNullOrEmpty() ? Operand.Source : Operator.Source; + + public SemanticVersion SemanticVersion => Operand.SemanticVersion; + + public ICommit? BaseVersionSource => Operator?.BaseVersionSource ?? Operand.BaseVersionSource; + + [MemberNotNullWhen(true, nameof(Operator))] + public bool ShouldIncrement => Operator is not null; + + public BaseVersionOperand Operand { get; init; } = Operand.NotNull(); + + public BaseVersionOperator? Operator { get; init; } + + public SemanticVersion GetIncrementedVersion() + { + var result = SemanticVersion; + + if (ShouldIncrement) + { + result = result.Increment( + increment: Operator.Increment, + label: Operator.Label, + forceIncrement: Operator.ForceIncrement, + Operator.AlternativeSemanticVersion + ); + } + + return result; + } + + public override string ToString() + { + var commitSource = BaseVersionSource?.Id.ToString(7) ?? "External"; + + StringBuilder stringBuilder = new(); + if (ShouldIncrement) + { + stringBuilder.Append($"{Source}: "); + stringBuilder.Append(Operator.ForceIncrement ? "Force version increment " : "Version increment "); + + stringBuilder.Append($"'{SemanticVersion:f}' "); + stringBuilder.Append($"+semver '{Operator.Increment}'"); + + if (Operator.Label is null) + { + stringBuilder.Append(" with no label"); + } + else + { + stringBuilder.Append($" with label '{Operator.Label}'"); + } + } + else + { + stringBuilder.Append($"{Source}: Take '{SemanticVersion:f}'"); + } + + if (BaseVersionSource is not null) + stringBuilder.Append($" based on commit '{commitSource}'."); + return stringBuilder.ToString(); + } + + internal BaseVersion Apply(BaseVersionOperator baseVersionOperator) + { + baseVersionOperator.NotNull(); + + return new BaseVersion(Source, GetIncrementedVersion(), BaseVersionSource) + { + Operator = baseVersionOperator + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperand.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperand.cs new file mode 100644 index 0000000000..0a46368ba5 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperand.cs @@ -0,0 +1,28 @@ +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public sealed record BaseVersionOperand(string Source, SemanticVersion SemanticVersion, ICommit? BaseVersionSource = null) + : IBaseVersionIncrement +{ + public BaseVersionOperand() : this(string.Empty, SemanticVersion.Empty) + { + } + + public string Source { get; init; } = Source.NotNull(); + + public SemanticVersion SemanticVersion { get; init; } = SemanticVersion.NotNull(); + + public override string ToString() + { + StringBuilder stringBuilder = new(); + + stringBuilder.Append($"{Source}: Take '{SemanticVersion:f}'"); + + if (BaseVersionSource is not null) + stringBuilder.Append($" based on commit '{BaseVersionSource.Id.ToString(7)}'."); + + return stringBuilder.ToString(); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperator.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperator.cs new file mode 100644 index 0000000000..c76ce82d38 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperator.cs @@ -0,0 +1,42 @@ +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public sealed record BaseVersionOperator : IBaseVersionIncrement +{ + public string Source { get; init; } = string.Empty; + + public ICommit? BaseVersionSource { get; init; } + + public VersionField Increment { get; init; } + + public bool ForceIncrement { get; init; } + + public string? Label { get; init; } + + public SemanticVersion? AlternativeSemanticVersion { get; init; } + + public override string ToString() + { + StringBuilder stringBuilder = new(); + + stringBuilder.Append($"{Source}: "); + stringBuilder.Append(ForceIncrement ? "Force version increment " : "Version increment "); + + stringBuilder.Append($"+semver '{Increment}'"); + + if (Label is null) + { + stringBuilder.Append(" with no label"); + } + else + { + stringBuilder.Append($" with label '{Label}'"); + } + + if (BaseVersionSource is not null) + stringBuilder.Append($" based on commit '{BaseVersionSource.Id.ToString(7)}'."); + + return stringBuilder.ToString(); + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/ConfiguredNextVersionVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/ConfiguredNextVersionVersionStrategy.cs new file mode 100644 index 0000000000..275aee185a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/ConfiguredNextVersionVersionStrategy.cs @@ -0,0 +1,48 @@ +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation; + +/// +/// Version is from NextVersion (the configuration value), unless the current commit is tagged. +/// BaseVersionSource is null. +/// Does not increment. +/// +internal sealed class ConfiguredNextVersionVersionStrategy(Lazy contextLazy) : IVersionStrategy +{ + private readonly Lazy contextLazy = contextLazy.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.ConfiguredNextVersion)) + yield break; + + var nextVersion = Context.Configuration.NextVersion; + if (nextVersion.IsNullOrEmpty()) yield break; + var semanticVersion = SemanticVersion.Parse( + nextVersion, Context.Configuration.TagPrefixPattern, Context.Configuration.SemanticVersionFormat + ); + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + + if (!semanticVersion.IsMatchForBranchSpecificLabel(label)) yield break; + BaseVersionOperator? operation = null; + if (!semanticVersion.IsPreRelease || (label is not null && semanticVersion.PreReleaseTag.Name != label)) + { + operation = new BaseVersionOperator + { + Increment = VersionField.None, + ForceIncrement = false, + Label = label + }; + } + + yield return new BaseVersion("NextVersion in GitVersion configuration file", semanticVersion) + { + Operator = operation + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/FallbacktVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/FallbacktVersionStrategy.cs new file mode 100644 index 0000000000..31858d5a4d --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/FallbacktVersionStrategy.cs @@ -0,0 +1,64 @@ +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation; + +/// +/// Version is extracted from all tags on the branch which are valid, and not newer than the current commit. +/// BaseVersionSource is the tag's commit. +/// Increments if the tag is not the current commit. +/// +internal sealed class FallbackVersionStrategy( + Lazy contextLazy, + IIncrementStrategyFinder incrementStrategyFinder, + ITaggedSemanticVersionService taggedSemanticVersionService) + : IVersionStrategy +{ + private readonly Lazy contextLazy = contextLazy.NotNull(); + private readonly IIncrementStrategyFinder incrementStrategyFinder = incrementStrategyFinder.NotNull(); + private readonly ITaggedSemanticVersionService taggedSemanticVersionService = taggedSemanticVersionService.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + => GetBaseVersionsInternal(configuration); + + private IEnumerable GetBaseVersionsInternal(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.Fallback)) + yield break; + + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + + var baseVersionSource = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: Context.CurrentBranch, + configuration: Context.Configuration, + label: label, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: configuration.Value.GetTaggedSemanticVersion() + ).Select(element => element.Key).FirstOrDefault(); + + var increment = incrementStrategyFinder.DetermineIncrementedField( + currentCommit: Context.CurrentCommit, + baseVersionSource: baseVersionSource, + shouldIncrement: true, + configuration: configuration.Value, + label: label + ); + + yield return new BaseVersion + { + Operator = new BaseVersionOperator + { + Source = "Fallback base version", + BaseVersionSource = baseVersionSource, + Increment = increment, + ForceIncrement = false, + Label = label + } + }; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersion.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersion.cs new file mode 100644 index 0000000000..d8c2c1c8f4 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersion.cs @@ -0,0 +1,6 @@ +namespace GitVersion.VersionCalculation; + +public interface IBaseVersion : IBaseVersionIncrement +{ + SemanticVersion SemanticVersion { get; } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersionIncrement.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersionIncrement.cs new file mode 100644 index 0000000000..02f53b7cd1 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/IBaseVersionIncrement.cs @@ -0,0 +1,10 @@ +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +public interface IBaseVersionIncrement +{ + string Source { get; } + + ICommit? BaseVersionSource { get; } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MainlineVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MainlineVersionStrategy.cs new file mode 100644 index 0000000000..a1909b8362 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MainlineVersionStrategy.cs @@ -0,0 +1,380 @@ +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.VersionCalculation.Mainline; +using GitVersion.VersionCalculation.Mainline.NonTrunk; +using GitVersion.VersionCalculation.Mainline.Trunk; + +namespace GitVersion.VersionCalculation; + +internal sealed class MainlineVersionStrategy( + Lazy contextLazy, + IRepositoryStore repositoryStore, + ITaggedSemanticVersionService taggedSemanticVersionService, + IIncrementStrategyFinder incrementStrategyFinder) + : IVersionStrategy +{ + private volatile int iterationCounter; + private readonly Lazy contextLazy = contextLazy.NotNull(); + private readonly ITaggedSemanticVersionService taggedSemanticVersionService = taggedSemanticVersionService.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly IIncrementStrategyFinder incrementStrategyFinder = incrementStrategyFinder.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + private static readonly IReadOnlyCollection TrunkContextPreEnricherCollection = + [ + new EnrichSemanticVersion(), + new EnrichIncrement() + ]; + private static readonly IReadOnlyCollection TrunkContextPostEnricherCollection = + [ + new RemoveSemanticVersion(), + new RemoveIncrement() + ]; + private static readonly IReadOnlyCollection TrunkIncrementerCollection = + [ + // Trunk + new CommitOnTrunk(), + + new CommitOnTrunkWithPreReleaseTag(), + new LastCommitOnTrunkWithPreReleaseTag(), + + new CommitOnTrunkWithStableTag(), + new LastCommitOnTrunkWithStableTag(), + + new MergeCommitOnTrunk(), + new LastMergeCommitOnTrunk(), + + new CommitOnTrunkBranchedToTrunk(), + new CommitOnTrunkBranchedToNonTrunk(), + + // NonTrunk + new FirstCommitOnRelease(), + + new CommitOnNonTrunk(), + new CommitOnNonTrunkWithPreReleaseTag(), + new LastCommitOnNonTrunkWithPreReleaseTag(), + + new CommitOnNonTrunkWithStableTag(), + new LastCommitOnNonTrunkWithStableTag(), + + new MergeCommitOnNonTrunk(), + new LastMergeCommitOnNonTrunk(), + + new CommitOnNonTrunkBranchedToTrunk(), + new CommitOnNonTrunkBranchedToNonTrunk() + ]; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.Mainline)) + yield break; + + var branchConfiguration = Context.Configuration.GetBranchConfiguration(Context.CurrentBranch); + + var iteration = CreateIteration( + branchName: Context.CurrentBranch.Name, + configuration: branchConfiguration + ); + + var commitsInReverseOrder = Context.Configuration.Ignore.Filter(Context.CurrentBranchCommits.ToArray()); + + var taggedSemanticVersion = TaggedSemanticVersions.OfBranch; + if (branchConfiguration.TrackMergeTarget == true) taggedSemanticVersion |= TaggedSemanticVersions.OfMergeTargets; + if (branchConfiguration.TracksReleaseBranches == true) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfReleaseBranches; + } + if (!(branchConfiguration.IsMainBranch == true || branchConfiguration.IsReleaseBranch == true)) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfMainBranches; + } + var taggedSemanticVersions = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: Context.CurrentBranch, + configuration: Context.Configuration, + label: null, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: taggedSemanticVersion + ); + var targetLabel = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + IterateOverCommitsRecursive( + commitsInReverseOrder: commitsInReverseOrder, + iteration: iteration, + targetBranch: configuration.Branch, + targetLabel: targetLabel, + taggedSemanticVersions: taggedSemanticVersions + ); + + yield return DetermineBaseVersion(iteration, targetLabel, incrementStrategyFinder, Context.Configuration); + } + + private MainlineIteration CreateIteration( + ReferenceName branchName, IBranchConfiguration configuration, + MainlineIteration? parentIteration = null, MainlineCommit? parentCommit = null) + { + var iterationCount = Interlocked.Increment(ref iterationCounter); + return new MainlineIteration( + id: $"#{iterationCount}", + branchName: branchName, + configuration: configuration, + parentIteration: parentIteration, + parentCommit: parentCommit + ); + } + + private bool IterateOverCommitsRecursive( + IEnumerable commitsInReverseOrder, MainlineIteration iteration, IBranch targetBranch, string? targetLabel, + ILookup taggedSemanticVersions, HashSet? traversedCommits = null) + { + traversedCommits ??= []; + + var returnTrueWhenTheIncrementIsKnown = false; + + var configuration = iteration.Configuration; + var branchName = iteration.BranchName; + var branch = repositoryStore.FindBranch(branchName); + + var currentBranch = branch; + Lazy>> commitsWasBranchedFromLazy = new( + () => currentBranch is null ? [] : GetCommitsWasBranchedFrom(currentBranch) + ); + + foreach (var item in commitsInReverseOrder) + { + if (!traversedCommits.Add(item)) continue; + + if (commitsWasBranchedFromLazy.Value.TryGetValue(item, out var effectiveConfigurationsWasBranchedFrom)) + { + var effectiveConfigurationWasBranchedFrom = effectiveConfigurationsWasBranchedFrom[0]; + + if (configuration.IsMainBranch != true || effectiveConfigurationWasBranchedFrom.Value.IsMainBranch == true) + { + var excludeBranch = branch; + if (effectiveConfigurationsWasBranchedFrom.Any(element => + !element.Branch.Equals(effectiveConfigurationWasBranchedFrom.Branch) + && element.Branch.Equals(targetBranch))) + { + iteration.CreateCommit(null, targetBranch.Name, Context.Configuration.GetBranchConfiguration(targetBranch)); + } + configuration = effectiveConfigurationWasBranchedFrom.Value; + branchName = effectiveConfigurationWasBranchedFrom.Branch.Name; + + branch = repositoryStore.FindBranch(branchName); + + var branchPointer = branch; + commitsWasBranchedFromLazy = new Lazy>> + (() => branchPointer is null ? [] + : GetCommitsWasBranchedFrom(branchPointer, excludeBranch is null ? [] : [excludeBranch]) + ); + + var taggedSemanticVersion = TaggedSemanticVersions.OfBranch; + if ((configuration.TrackMergeTarget ?? Context.Configuration.TrackMergeTarget) == true) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfMergeTargets; + } + if ((configuration.TracksReleaseBranches ?? Context.Configuration.TracksReleaseBranches) == true) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfReleaseBranches; + } + if (!(configuration.IsMainBranch == true || configuration.IsReleaseBranch == true)) + { + taggedSemanticVersion |= TaggedSemanticVersions.OfMainBranches; + } + taggedSemanticVersions = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: effectiveConfigurationWasBranchedFrom.Branch, + configuration: Context.Configuration, + label: null, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: taggedSemanticVersion + ); + } + } + + var commit = iteration.CreateCommit(item, branchName, configuration); + + var semanticVersions = taggedSemanticVersions[item].ToArray(); + commit.AddSemanticVersions(semanticVersions.Select(element => element.Value)); + + var label = targetLabel ?? new EffectiveConfiguration( + configuration: Context.Configuration, + branchConfiguration: configuration + ).GetBranchSpecificLabel(branchName, null); + + foreach (var semanticVersion in semanticVersions) + { + if (!semanticVersion.Value.IsMatchForBranchSpecificLabel(label)) continue; + if (configuration.Increment != IncrementStrategy.Inherit) + { + return true; + } + + returnTrueWhenTheIncrementIsKnown = true; + } + + if (returnTrueWhenTheIncrementIsKnown && configuration.Increment != IncrementStrategy.Inherit) + { + return true; + } + + if (!item.IsMergeCommit()) continue; + Lazy> mergedCommitsInReverseOrderLazy = new( + () => [.. this.incrementStrategyFinder.GetMergedCommits(item, 1, Context.Configuration.Ignore).Reverse()] + ); + + if ((configuration.TrackMergeMessage ?? Context.Configuration.TrackMergeMessage) != true + || !MergeMessage.TryParse(item, Context.Configuration, out var mergeMessage)) + { + continue; + } + + if (mergeMessage.MergedBranch is not null) + { + var childConfiguration = Context.Configuration.GetBranchConfiguration(mergeMessage.MergedBranch); + var childBranchName = mergeMessage.MergedBranch; + + if (childConfiguration.IsMainBranch == true) + { + if (configuration.IsMainBranch == true) throw new NotImplementedException(); + + mergedCommitsInReverseOrderLazy = new( + () => [.. this.incrementStrategyFinder.GetMergedCommits(item, 0, Context.Configuration.Ignore).Reverse()] + ); + childConfiguration = configuration; + childBranchName = iteration.BranchName; + } + + var childIteration = CreateIteration( + branchName: childBranchName, + configuration: childConfiguration, + parentIteration: iteration, + parentCommit: commit + ); + + var done = IterateOverCommitsRecursive( + commitsInReverseOrder: mergedCommitsInReverseOrderLazy.Value, + iteration: childIteration, + targetBranch: targetBranch, + targetLabel: targetLabel, + taggedSemanticVersions: taggedSemanticVersions, + traversedCommits: traversedCommits); + + commit.AddChildIteration(childIteration); + if (done) return true; + } + + traversedCommits.AddRange(mergedCommitsInReverseOrderLazy.Value); + } + return false; + } + + private Dictionary> GetCommitsWasBranchedFrom( + IBranch branch, params IBranch[] excludedBranches) + { + Dictionary> result = []; + + var branchCommits = repositoryStore.FindCommitBranchesBranchedFrom( + branch, Context.Configuration, excludedBranches: excludedBranches + ).ToList(); + + var branchCommitDictionary = branchCommits.ToDictionary( + element => element.Branch, element => element.Commit + ); + foreach (var item in branchCommitDictionary.Keys) + { + var branchConfiguration = Context.Configuration.GetBranchConfiguration(item); + + var key = branchCommitDictionary[item]; + if (result.TryGetValue(key, out var value)) + { + if (branchConfiguration is { Increment: IncrementStrategy.Inherit, IsMainBranch: null }) + { + throw new InvalidOperationException(); + } + + if ((branchConfiguration.IsMainBranch ?? Context.Configuration.IsMainBranch) != true) continue; + foreach (var _ in value.ToArray()) + { + value.Add(new(item, branchConfiguration)); + } + } + else + { + result.Add(key: key, value: [new ValueTuple(item, branchConfiguration)]); + } + } + + // If a main branch existing we need to ensure that it will be present at the first position in the list. + foreach (var item in result) + { + result[item.Key] = [.. item.Value.OrderByDescending(element => (element.Configuration.IsMainBranch ?? Context.Configuration.IsMainBranch) == true)]; + } + return result; + } + + private static BaseVersion DetermineBaseVersion(MainlineIteration iteration, string? targetLabel, + IIncrementStrategyFinder incrementStrategyFinder, IGitVersionConfiguration configuration) + => DetermineBaseVersionRecursive(iteration, targetLabel, incrementStrategyFinder, configuration); + + internal static BaseVersion DetermineBaseVersionRecursive(MainlineIteration iteration, string? targetLabel, + IIncrementStrategyFinder incrementStrategyFinder, IGitVersionConfiguration configuration) + { + iteration.NotNull(); + + var incrementSteps = GetIncrements(iteration, targetLabel, incrementStrategyFinder, configuration).ToArray(); + + BaseVersion? result = null; + foreach (var baseVersionIncrement in incrementSteps) + { + switch (baseVersionIncrement) + { + case BaseVersionOperand baseVersionOperand: + result = new BaseVersion(baseVersionOperand); + break; + case BaseVersionOperator baseVersionOperator: + result ??= new BaseVersion(); + result = result.Apply(baseVersionOperator); + break; + case BaseVersion baseVersion: + result = baseVersion; + break; + } + } + return result ?? throw new InvalidOperationException(); + } + + private static IEnumerable GetIncrements(MainlineIteration iteration, string? targetLabel, + IIncrementStrategyFinder incrementStrategyFinder, IGitVersionConfiguration configuration) + { + MainlineContext context = new(incrementStrategyFinder, configuration) + { + TargetLabel = targetLabel + }; + + foreach (var commit in iteration.Commits) + { + foreach (var item in TrunkContextPreEnricherCollection) + { + item.Enrich(iteration, commit, context); + } + + foreach (var incrementer in TrunkIncrementerCollection + .Where(element => element.MatchPrecondition(iteration, commit, context))) + { + foreach (var item in incrementer.GetIncrements(iteration, commit, context)) + { + yield return item; + } + } + + foreach (var item in TrunkContextPostEnricherCollection) + { + item.Enrich(commit, context); + } + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MergeMessageVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MergeMessageVersionStrategy.cs new file mode 100644 index 0000000000..8731031a8d --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/MergeMessageVersionStrategy.cs @@ -0,0 +1,76 @@ +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Extensions; +using GitVersion.Git; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +/// +/// Version is extracted from older commits' merge messages. +/// BaseVersionSource is the commit where the message was found. +/// Increments if PreventIncrementOfMergedBranchVersion (from the branch configuration) is false. +/// +internal sealed class MergeMessageVersionStrategy(ILog log, Lazy contextLazy, + IRepositoryStore repositoryStore, IIncrementStrategyFinder incrementStrategyFinder) + : IVersionStrategy +{ + private readonly ILog log = log.NotNull(); + private readonly Lazy contextLazy = contextLazy.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly IIncrementStrategyFinder incrementStrategyFinder = incrementStrategyFinder.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + => GetBaseVersionsInternal(configuration).Take(5); + + private IEnumerable GetBaseVersionsInternal(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.MergeMessage) + || !configuration.Value.TrackMergeMessage) + { + yield break; + } + + foreach (var commit in configuration.Value.Ignore.Filter(Context.CurrentBranchCommits.ToArray())) + { + if (!MergeMessage.TryParse(commit, Context.Configuration, out var mergeMessage) + || mergeMessage.Version is null + || !Context.Configuration.IsReleaseBranch(mergeMessage.MergedBranch!)) + { + continue; + } + + this.log.Info($"Found commit [{commit}] matching merge message format: {mergeMessage.FormatName}"); + + var baseVersionSource = commit; + if (commit.IsMergeCommit()) + { + baseVersionSource = this.repositoryStore.FindMergeBase(commit.Parents[0], commit.Parents[1]); + } + + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + var increment = configuration.Value.PreventIncrementOfMergedBranch + ? VersionField.None : this.incrementStrategyFinder.DetermineIncrementedField( + currentCommit: Context.CurrentCommit, + baseVersionSource: baseVersionSource, + shouldIncrement: true, + configuration: configuration.Value, + label: label + ); + + yield return new BaseVersion($"Merge message '{commit.Message.Trim()}'", mergeMessage.Version) + { + Operator = new() + { + Increment = increment, + ForceIncrement = false, + Label = label + } + }; + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TaggedCommitVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TaggedCommitVersionStrategy.cs new file mode 100644 index 0000000000..4e08eef9c8 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TaggedCommitVersionStrategy.cs @@ -0,0 +1,94 @@ +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Logging; + +namespace GitVersion.VersionCalculation; + +/// +/// Version is extracted from all tags on the branch which are valid, and not newer than the current commit. +/// BaseVersionSource is the tag's commit. +/// Increments if the tag is not the current commit. +/// +internal sealed class TaggedCommitVersionStrategy( + ILog log, + Lazy contextLazy, + ITaggedSemanticVersionService taggedSemanticVersionService, + IIncrementStrategyFinder incrementStrategyFinder) + : IVersionStrategy +{ + private readonly ILog log = log.NotNull(); + private readonly ITaggedSemanticVersionService taggedSemanticVersionService = taggedSemanticVersionService.NotNull(); + private readonly Lazy contextLazy = contextLazy.NotNull(); + private readonly IIncrementStrategyFinder incrementStrategyFinder = incrementStrategyFinder.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + => GetBaseVersionsInternal(configuration); + + private IEnumerable GetBaseVersionsInternal(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.TaggedCommit)) + yield break; + + var taggedSemanticVersions = taggedSemanticVersionService.GetTaggedSemanticVersions( + branch: Context.CurrentBranch, + configuration: Context.Configuration, + label: null, + notOlderThan: Context.CurrentCommit.When, + taggedSemanticVersion: configuration.Value.GetTaggedSemanticVersion() + ).SelectMany(elements => elements).Distinct().ToArray(); + + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + + var semanticVersionTreshold = SemanticVersion.Empty; + List alternativeSemanticVersionsWithTag = []; + foreach (var semanticVersion in taggedSemanticVersions) + { + if (!semanticVersion.Value.IsMatchForBranchSpecificLabel(label)) + { + alternativeSemanticVersionsWithTag.Add(semanticVersion); + continue; + } + + var alternativeSemanticVersionMax = alternativeSemanticVersionsWithTag.Max()?.Value; + var highestPossibleSemanticVersion = semanticVersion.Value.Increment( + VersionField.Major, null, forceIncrement: true, alternativeSemanticVersionMax + ); + if (highestPossibleSemanticVersion.IsLessThan(semanticVersionTreshold, includePreRelease: false)) + { + this.log.Info( + $"The tag '{semanticVersion.Value}' is skipped because it provides a lower base version than other tags." + ); + alternativeSemanticVersionsWithTag.Clear(); + continue; + } + + var baseVersionSource = semanticVersion.Tag.Commit; + var increment = incrementStrategyFinder.DetermineIncrementedField( + currentCommit: Context.CurrentCommit, + baseVersionSource: baseVersionSource, + shouldIncrement: true, + configuration: configuration.Value, + label: label + ); + semanticVersionTreshold = semanticVersion.Value.Increment(increment, null, forceIncrement: true); + + yield return new BaseVersion( + $"Git tag '{semanticVersion.Tag.Name.Friendly}'", semanticVersion.Value, baseVersionSource) + { + Operator = new BaseVersionOperator + { + Increment = increment, + ForceIncrement = false, + Label = label, + AlternativeSemanticVersion = alternativeSemanticVersionMax + } + }; + alternativeSemanticVersionsWithTag.Clear(); + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TrackReleaseBranchesVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TrackReleaseBranchesVersionStrategy.cs new file mode 100644 index 0000000000..75dc51146e --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/TrackReleaseBranchesVersionStrategy.cs @@ -0,0 +1,73 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Common; +using GitVersion.Configuration; +using GitVersion.Core; +using GitVersion.Extensions; +using GitVersion.Git; + +namespace GitVersion.VersionCalculation; + +internal sealed class TrackReleaseBranchesVersionStrategy( + Lazy contextLazy, + IRepositoryStore repositoryStore, + IBranchRepository branchRepository, + IIncrementStrategyFinder incrementStrategyFinder) + : IVersionStrategy +{ + private readonly Lazy contextLazy = contextLazy.NotNull(); + private readonly IRepositoryStore repositoryStore = repositoryStore.NotNull(); + private readonly IBranchRepository branchRepository = branchRepository.NotNull(); + private readonly IIncrementStrategyFinder incrementStrategyFinder = incrementStrategyFinder.NotNull(); + private readonly VersionInBranchNameVersionStrategy releaseVersionStrategy = new(contextLazy); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + { + configuration.NotNull(); + + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.TrackReleaseBranches)) + yield break; + + if (!configuration.Value.TracksReleaseBranches) yield break; + foreach (var releaseBranch in this.branchRepository.GetReleaseBranches(Context.Configuration)) + { + if (TryGetBaseVersion(releaseBranch, configuration, out var baseVersion)) + { + yield return baseVersion; + } + } + } + + private bool TryGetBaseVersion( + IBranch releaseBranch, EffectiveBranchConfiguration configuration, [NotNullWhen(true)] out BaseVersion? result) + { + result = null; + + var releaseBranchConfiguration = Context.Configuration.GetEffectiveBranchConfiguration(releaseBranch); + if (!this.releaseVersionStrategy.TryGetBaseVersion(releaseBranchConfiguration, out var baseVersion)) return result is not null; + // Find the commit where the child branch was created. + var baseVersionSource = this.repositoryStore.FindMergeBase(releaseBranch, Context.CurrentBranch); + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); + var increment = this.incrementStrategyFinder.DetermineIncrementedField( + currentCommit: Context.CurrentCommit, + baseVersionSource: baseVersionSource, + shouldIncrement: true, + configuration: configuration.Value, + label: label + ); + + result = new BaseVersion( + "Release branch exists -> " + baseVersion.Source, baseVersion.SemanticVersion, baseVersionSource) + { + Operator = new BaseVersionOperator + { + Increment = increment, + ForceIncrement = false, + Label = label + } + }; + + return true; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionInBranchNameVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionInBranchNameVersionStrategy.cs new file mode 100644 index 0000000000..67de10087a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionInBranchNameVersionStrategy.cs @@ -0,0 +1,62 @@ +using System.Diagnostics.CodeAnalysis; +using GitVersion.Configuration; +using GitVersion.Extensions; + +namespace GitVersion.VersionCalculation; + +/// +/// Version is extracted from the name of the branch. +/// BaseVersionSource is the commit where the branch was branched from its parent. +/// Does not increment. +/// +internal sealed class VersionInBranchNameVersionStrategy(Lazy contextLazy) : IVersionStrategy +{ + private readonly Lazy contextLazy = contextLazy.NotNull(); + + private GitVersionContext Context => contextLazy.Value; + + public IEnumerable GetBaseVersions(EffectiveBranchConfiguration configuration) + { + if (!Context.Configuration.VersionStrategy.HasFlag(VersionStrategies.VersionInBranchName)) + yield break; + + if (TryGetBaseVersion(configuration, out var baseVersion)) + { + yield return baseVersion; + } + } + + public bool TryGetBaseVersion(EffectiveBranchConfiguration configuration, [NotNullWhen(true)] out BaseVersion? baseVersion) + { + baseVersion = null; + + if (!configuration.Value.IsReleaseBranch) + return false; + + foreach (var branch in new[] { Context.CurrentBranch, configuration.Branch }) + { + if (!branch.Name.TryGetSemanticVersion(out var result, configuration.Value)) continue; + string? branchNameOverride = null; + if (!result.Name.IsNullOrEmpty() && (Context.CurrentBranch.Name.Equals(branch.Name) + || Context.Configuration.GetBranchConfiguration(Context.CurrentBranch.Name).Label is null)) + { + branchNameOverride = result.Name; + } + + var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, branchNameOverride); + + baseVersion = new BaseVersion("Version in branch name", result.Value) + { + Operator = new BaseVersionOperator + { + Increment = VersionField.None, + ForceIncrement = false, + Label = label + } + }; + return true; + } + + return false; + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionStrategyModule.cs b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionStrategyModule.cs new file mode 100644 index 0000000000..23d0580365 --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/VersionStrategyModule.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.VersionCalculation; + +public class VersionStrategyModule : IGitVersionModule +{ + public void RegisterTypes(IServiceCollection services) + { + var versionStrategies = IGitVersionModule.FindAllDerivedTypes(Assembly.GetAssembly(GetType())) + .Where(x => x is { IsAbstract: false, IsInterface: false }); + + foreach (var versionStrategy in versionStrategies) + { + services.AddSingleton(typeof(IVersionStrategy), versionStrategy); + } + } +} diff --git a/src/GitVersion.Core/VersionCalculation/VersionStrategies.cs b/src/GitVersion.Core/VersionCalculation/VersionStrategies.cs new file mode 100644 index 0000000000..4fe020c87a --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/VersionStrategies.cs @@ -0,0 +1,14 @@ +namespace GitVersion.VersionCalculation; + +[Flags] +public enum VersionStrategies +{ + None = 0, + Fallback = 1, + ConfiguredNextVersion = 2, + MergeMessage = 4, + TaggedCommit = 8, + TrackReleaseBranches = 16, + VersionInBranchName = 32, + Mainline = 64 +} diff --git a/src/GitVersion.Core/VersionCalculation/VersioningMode.cs b/src/GitVersion.Core/VersionCalculation/VersioningMode.cs deleted file mode 100644 index d4f5b4d9fe..0000000000 --- a/src/GitVersion.Core/VersionCalculation/VersioningMode.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace GitVersion.VersionCalculation; - -public enum VersioningMode -{ - ContinuousDelivery, - ContinuousDeployment, - Mainline -} diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs b/src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs deleted file mode 100644 index 974ae74f66..0000000000 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoContext.cs b/src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoContext.cs deleted file mode 100644 index 1f9b3586a0..0000000000 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GitVersion.VersionConverters.AssemblyInfo; - -public readonly struct AssemblyInfoContext : IConverterContext -{ - public AssemblyInfoContext(string workingDirectory, bool ensureAssemblyInfo, params string[] assemblyInfoFiles) - { - AssemblyInfoFiles = assemblyInfoFiles; - EnsureAssemblyInfo = ensureAssemblyInfo; - WorkingDirectory = workingDirectory; - } - - public string WorkingDirectory { get; } - public bool EnsureAssemblyInfo { get; } - public string[] AssemblyInfoFiles { get; } -} diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.cs b/src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.cs deleted file mode 100644 index be7fc098d4..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.cs +++ /dev/null @@ -1 +0,0 @@ -public static string {0} = "{1}"; diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoContext.cs b/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoContext.cs deleted file mode 100644 index ddccc5b0ce..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GitVersion.VersionConverters.GitVersionInfo; - -public readonly struct GitVersionInfoContext : IConverterContext -{ - public GitVersionInfoContext(string workingDirectory, string fileName, string fileExtension) - { - WorkingDirectory = workingDirectory; - FileName = fileName; - FileExtension = fileExtension; - } - - public string WorkingDirectory { get; } - public string FileName { get; } - public string FileExtension { get; } -} diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoGenerator.cs b/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoGenerator.cs deleted file mode 100644 index e02971218e..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/GitVersionInfoGenerator.cs +++ /dev/null @@ -1,66 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.OutputVariables; - -namespace GitVersion.VersionConverters.GitVersionInfo; - -public interface IGitVersionInfoGenerator : IVersionConverter -{ -} - -public sealed class GitVersionInfoGenerator : IGitVersionInfoGenerator -{ - private readonly IFileSystem fileSystem; - private readonly TemplateManager templateManager; - - public GitVersionInfoGenerator(IFileSystem fileSystem) - { - this.fileSystem = fileSystem.NotNull(); - this.templateManager = new TemplateManager(TemplateType.GitVersionInfo); - } - - public void Execute(VersionVariables variables, GitVersionInfoContext context) - { - var fileName = context.FileName; - var directory = context.WorkingDirectory; - var filePath = PathHelper.Combine(directory, fileName); - - string? originalFileContents = null; - - if (File.Exists(filePath)) - { - originalFileContents = this.fileSystem.ReadAllText(filePath); - } - - var fileExtension = Path.GetExtension(filePath); - var template = this.templateManager.GetTemplateFor(fileExtension); - var addFormat = this.templateManager.GetAddFormatFor(fileExtension); - - if (string.IsNullOrWhiteSpace(template) || string.IsNullOrWhiteSpace(addFormat)) - return; - - var indentation = GetIndentation(fileExtension); - - var members = string.Join(System.Environment.NewLine, variables.Select(v => string.Format(indentation + addFormat, v.Key, v.Value))); - - var fileContents = string.Format(template, members); - - if (fileContents != originalFileContents) - { - this.fileSystem.WriteAllText(filePath, fileContents); - } - } - - public void Dispose() - { - } - - // Because The VB-generated class is included in a namespace declaration, - // the properties must be offset by 2 tabs. - // Whereas in the C# and F# cases, 1 tab is enough. - private static string GetIndentation(string fileExtension) - { - var tabs = fileExtension.ToLowerInvariant().EndsWith("vb") ? 2 : 1; - return new string(' ', tabs * 4); - } -} diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.cs b/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.cs deleted file mode 100644 index 53e9b35ead..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// GitVersion -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 -namespace System.Diagnostics.CodeAnalysis -{{ - [global::System.AttributeUsage( - global::System.AttributeTargets.Assembly | - global::System.AttributeTargets.Class | - global::System.AttributeTargets.Struct | - global::System.AttributeTargets.Constructor | - global::System.AttributeTargets.Method | - global::System.AttributeTargets.Property | - global::System.AttributeTargets.Event, - Inherited = false, AllowMultiple = false)] - internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute {{ }} -}} -#endif - -[global::System.Runtime.CompilerServices.CompilerGenerated] -[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -static class GitVersionInformation -{{ -{0} -}} diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.fs b/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.fs deleted file mode 100644 index 561bc56f75..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.fs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// GitVersion -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 -namespace System.Diagnostics.CodeAnalysis - -[] -[] -type ExcludeFromCodeCoverageAttribute() = inherit global.System.Attribute() -#endif - -namespace global - -[] -[] -[] -type GitVersionInformation = -{0} diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.vb b/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.vb deleted file mode 100644 index d9cd68db27..0000000000 --- a/src/GitVersion.Core/VersionConverters/GitVersionInfo/Templates/GitVersionInformation.vb +++ /dev/null @@ -1,37 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' GitVersion -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -#If NET20 OrElse NET35 OrElse NETCOREAPP1_0 OrElse NETCOREAPP1_1 OrElse NETSTANDARD1_0 OrElse NETSTANDARD1_1 OrElse NETSTANDARD1_2 OrElse NETSTANDARD1_3 OrElse NETSTANDARD1_4 OrElse NETSTANDARD1_5 OrElse NETSTANDARD1_6 Then -Namespace Global.System.Diagnostics.CodeAnalysis - - Friend NotInheritable Class ExcludeFromCodeCoverageAttribute - Inherits Global.System.Attribute - End Class -End Namespace -#End If - -Namespace Global - - - - NotInheritable Class GitVersionInformation - Private Sub New() - End Sub -{0} - End Class - -End Namespace diff --git a/src/GitVersion.Core/VersionConverters/IConverterContext.cs b/src/GitVersion.Core/VersionConverters/IConverterContext.cs deleted file mode 100644 index bcf3165e58..0000000000 --- a/src/GitVersion.Core/VersionConverters/IConverterContext.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GitVersion.VersionConverters; - -public interface IConverterContext -{ - public string WorkingDirectory { get; } -} diff --git a/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputContext.cs b/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputContext.cs deleted file mode 100644 index a3447ca4f7..0000000000 --- a/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GitVersion.VersionConverters.OutputGenerator; - -public readonly struct OutputContext : IConverterContext -{ - public OutputContext(string workingDirectory, string? outputFile, bool? updateBuildNumber) - { - WorkingDirectory = workingDirectory; - OutputFile = outputFile; - UpdateBuildNumber = updateBuildNumber; - } - - public string WorkingDirectory { get; } - public string? OutputFile { get; } - public bool? UpdateBuildNumber { get; } -} diff --git a/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputGenerator.cs b/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputGenerator.cs deleted file mode 100644 index 52c4f61feb..0000000000 --- a/src/GitVersion.Core/VersionConverters/OutputGenerator/OutputGenerator.cs +++ /dev/null @@ -1,65 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.Model; -using GitVersion.OutputVariables; -using Microsoft.Extensions.Options; - -namespace GitVersion.VersionConverters.OutputGenerator; - -public interface IOutputGenerator : IVersionConverter -{ -} - -public sealed class OutputGenerator : IOutputGenerator -{ - private readonly IConsole console; - private readonly IFileSystem fileSystem; - private readonly IOptions options; - private readonly ICurrentBuildAgent buildAgent; - - public OutputGenerator(ICurrentBuildAgent buildAgent, IConsole console, IFileSystem fileSystem, IOptions options) - { - this.console = console.NotNull(); - this.fileSystem = fileSystem.NotNull(); - this.options = options.NotNull(); - this.buildAgent = buildAgent.NotNull(); - } - - public void Execute(VersionVariables variables, OutputContext context) - { - var gitVersionOptions = this.options.Value; - if (gitVersionOptions.Output.Contains(OutputType.BuildServer)) - { - this.buildAgent.WriteIntegration(this.console.WriteLine, variables, context.UpdateBuildNumber ?? true); - } - if (gitVersionOptions.Output.Contains(OutputType.File)) - { - var retryOperation = new RetryAction(); - retryOperation.Execute(() => this.fileSystem.WriteAllText(context.OutputFile, variables.ToString())); - } - - if (!gitVersionOptions.Output.Contains(OutputType.Json)) return; - - switch (gitVersionOptions.ShowVariable) - { - case null: - this.console.WriteLine(variables.ToString()); - break; - - default: - if (!variables.TryGetValue(gitVersionOptions.ShowVariable, out var part)) - { - throw new WarningException($"'{gitVersionOptions.ShowVariable}' variable does not exist"); - } - - this.console.WriteLine(part); - break; - } - } - - public void Dispose() - { - } -} diff --git a/src/GitVersion.Core/VersionConverters/TemplateManager.cs b/src/GitVersion.Core/VersionConverters/TemplateManager.cs deleted file mode 100644 index ebae681484..0000000000 --- a/src/GitVersion.Core/VersionConverters/TemplateManager.cs +++ /dev/null @@ -1,79 +0,0 @@ -using GitVersion.Extensions; - -namespace GitVersion.VersionConverters; - -internal enum TemplateType -{ - AssemblyInfo, - GitVersionInfo -} - -internal class TemplateManager -{ - private readonly Dictionary templates; - private readonly Dictionary addFormats; - - public TemplateManager(TemplateType templateType) - { - this.templates = GetEmbeddedTemplates(templateType, "Templates").ToDictionary(Path.GetExtension, v => v, StringComparer.OrdinalIgnoreCase); - this.addFormats = GetEmbeddedTemplates(templateType, "AddFormats").ToDictionary(Path.GetExtension, v => v, StringComparer.OrdinalIgnoreCase); - } - - public string? GetTemplateFor(string fileExtension) - { - if (fileExtension == null) - { - throw new ArgumentNullException(nameof(fileExtension)); - } - - string? result = null; - - if (this.templates.TryGetValue(fileExtension, out var template) && template != null) - { - result = template.ReadAsStringFromEmbeddedResource(); - } - - return result; - } - - public string? GetAddFormatFor(string fileExtension) - { - if (fileExtension == null) - { - throw new ArgumentNullException(nameof(fileExtension)); - } - - string? result = null; - - if (this.addFormats.TryGetValue(fileExtension, out var addFormat) && addFormat != null) - { - result = addFormat.ReadAsStringFromEmbeddedResource().TrimEnd('\r', '\n'); - } - - return result; - } - - public bool IsSupported(string fileExtension) - { - if (fileExtension == null) - { - throw new ArgumentNullException(nameof(fileExtension)); - } - - return this.templates.ContainsKey(fileExtension); - } - - private static IEnumerable GetEmbeddedTemplates(TemplateType templateType, string templateCategory) - { - - var assembly = typeof(TemplateManager).Assembly; - - foreach (var name in assembly.GetManifestResourceNames()) - { - if (name.Contains(templateType.ToString()) && name.Contains(templateCategory)) - { - yield return name; - } - } - } -} diff --git a/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionContext.cs b/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionContext.cs deleted file mode 100644 index c90e5ced8a..0000000000 --- a/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace GitVersion.VersionConverters.WixUpdater; - -public readonly struct WixVersionContext : IConverterContext -{ - public WixVersionContext(string workingDirectory) => - WorkingDirectory = workingDirectory; - - public string WorkingDirectory { get; } -} diff --git a/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionFileUpdater.cs b/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionFileUpdater.cs deleted file mode 100644 index ca9bf494e3..0000000000 --- a/src/GitVersion.Core/VersionConverters/WixUpdater/WixVersionFileUpdater.cs +++ /dev/null @@ -1,56 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Helpers; -using GitVersion.Logging; -using GitVersion.OutputVariables; - -namespace GitVersion.VersionConverters.WixUpdater; - -public interface IWixVersionFileUpdater : IVersionConverter -{ -} -public sealed class WixVersionFileUpdater : IWixVersionFileUpdater -{ - private readonly IFileSystem fileSystem; - private readonly ILog log; - private string? wixVersionFile; - public const string WixVersionFileName = "GitVersion_WixVersion.wxi"; - - public WixVersionFileUpdater(IFileSystem fileSystem, ILog log) - { - this.fileSystem = fileSystem.NotNull(); - this.log = log.NotNull(); - } - - public void Execute(VersionVariables variables, WixVersionContext context) - { - this.wixVersionFile = PathHelper.Combine(context.WorkingDirectory, WixVersionFileName); - this.log.Info("Updating GitVersion_WixVersion.wxi"); - - var doc = new XmlDocument(); - doc.LoadXml(GetWixFormatFromVersionVariables(variables)); - - var xmlDecl = doc.CreateXmlDeclaration("1.0", "utf-8", null); - var root = doc.DocumentElement; - doc.InsertBefore(xmlDecl, root); - - this.fileSystem.Delete(this.wixVersionFile); - using var fs = this.fileSystem.OpenWrite(this.wixVersionFile); - doc.Save(fs); - } - - private static string GetWixFormatFromVersionVariables(VersionVariables variables) - { - var builder = new StringBuilder(); - builder.Append("\n"); - var availableVariables = VersionVariables.AvailableVariables; - foreach (var variable in availableVariables) - { - variables.TryGetValue(variable, out var value); - builder.Append($"\t\n"); - } - builder.Append("\n"); - return builder.ToString(); - } - - public void Dispose() => this.log.Info($"Done writing {this.wixVersionFile}"); -} diff --git a/src/GitVersion.LibGit2Sharp/Git/Branch.cs b/src/GitVersion.LibGit2Sharp/Git/Branch.cs index 5cf3265577..3091fde193 100644 --- a/src/GitVersion.LibGit2Sharp/Git/Branch.cs +++ b/src/GitVersion.LibGit2Sharp/Git/Branch.cs @@ -1,7 +1,7 @@ using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class Branch : IBranch { @@ -10,27 +10,29 @@ internal sealed class Branch : IBranch private readonly LibGit2Sharp.Branch innerBranch; - internal Branch(LibGit2Sharp.Branch branch) + internal Branch(LibGit2Sharp.Branch branch, LibGit2Sharp.Diff diff, GitRepositoryCache repositoryCache) { + diff.NotNull(); + repositoryCache.NotNull(); this.innerBranch = branch.NotNull(); - Name = new ReferenceName(branch.CanonicalName); + Name = new(branch.CanonicalName); var commit = this.innerBranch.Tip; - Tip = commit is null ? null : new Commit(commit); + Tip = commit is null ? null : repositoryCache.GetOrWrap(commit, diff); var commits = this.innerBranch.Commits; - Commits = commits is null ? null : new CommitCollection(commits); + Commits = new CommitCollection(commits, diff, repositoryCache); } public ReferenceName Name { get; } public ICommit? Tip { get; } - public ICommitCollection? Commits { get; } - public int CompareTo(IBranch other) => comparerHelper.Compare(this, other); + public ICommitCollection Commits { get; } + public int CompareTo(IBranch? other) => comparerHelper.Compare(this, other); public bool Equals(IBranch? other) => equalityHelper.Equals(this, other); public bool IsDetachedHead => Name.Canonical.Equals("(no branch)", StringComparison.OrdinalIgnoreCase); public bool IsRemote => this.innerBranch.IsRemote; public bool IsTracking => this.innerBranch.IsTracking; - public override bool Equals(object obj) => Equals((obj as IBranch)); + public override bool Equals(object? obj) => Equals(obj as IBranch); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Name.ToString(); public static implicit operator LibGit2Sharp.Branch(Branch d) => d.innerBranch; diff --git a/src/GitVersion.LibGit2Sharp/Git/BranchCollection.cs b/src/GitVersion.LibGit2Sharp/Git/BranchCollection.cs index 89cb27fe04..5154ee5191 100644 --- a/src/GitVersion.LibGit2Sharp/Git/BranchCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/BranchCollection.cs @@ -1,17 +1,24 @@ using GitVersion.Extensions; using LibGit2Sharp; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class BranchCollection : IBranchCollection { private readonly LibGit2Sharp.BranchCollection innerCollection; + private readonly Lazy> branches; + private readonly Diff diff; + private readonly GitRepositoryCache repositoryCache; - internal BranchCollection(LibGit2Sharp.BranchCollection collection) - => this.innerCollection = collection.NotNull(); + internal BranchCollection(LibGit2Sharp.BranchCollection collection, Diff diff, GitRepositoryCache repositoryCache) + { + this.innerCollection = collection.NotNull(); + this.branches = new Lazy>(() => [.. this.innerCollection.Select(branch => repositoryCache.GetOrWrap(branch, diff))]); + this.diff = diff.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + } - public IEnumerator GetEnumerator() - => this.innerCollection.Select(branch => new Branch(branch)).GetEnumerator(); + public IEnumerator GetEnumerator() => this.branches.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); @@ -21,27 +28,27 @@ public IBranch? this[string name] { name = name.NotNull(); var branch = this.innerCollection[name]; - return branch is null ? null : new Branch(branch); + return branch is null ? null : this.repositoryCache.GetOrWrap(branch, this.diff); } } public IEnumerable ExcludeBranches(IEnumerable branchesToExclude) { - branchesToExclude = branchesToExclude.NotNull(); - - bool BranchIsNotExcluded(IBranch branch) - => branchesToExclude.All(branchToExclude => !branch.Equals(branchToExclude)); + var toExclude = branchesToExclude as IBranch[] ?? [.. branchesToExclude]; return this.Where(BranchIsNotExcluded); + + bool BranchIsNotExcluded(IBranch branch) => toExclude.All(branchToExclude => !branch.Equals(branchToExclude)); } public void UpdateTrackedBranch(IBranch branch, string remoteTrackingReferenceName) { var branchToUpdate = (Branch)branch.NotNull(); + this.innerCollection.Update(branchToUpdate, Updater); + return; + void Updater(BranchUpdater branchUpdater) => branchUpdater.TrackedBranch = remoteTrackingReferenceName; - - this.innerCollection.Update(branchToUpdate, Updater); } } diff --git a/src/GitVersion.LibGit2Sharp/Git/Commit.cs b/src/GitVersion.LibGit2Sharp/Git/Commit.cs index 51505ed7b2..f7c59ed5eb 100644 --- a/src/GitVersion.LibGit2Sharp/Git/Commit.cs +++ b/src/GitVersion.LibGit2Sharp/Git/Commit.cs @@ -1,29 +1,53 @@ +using System.Collections.Concurrent; using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; -internal sealed class Commit : GitObject, ICommit +internal sealed class Commit : ICommit { + private static readonly ConcurrentDictionary> pathsCache = new(); private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Id); private static readonly LambdaKeyComparer comparerHelper = new(x => x.Sha); + private readonly Lazy> parentsLazy; private readonly LibGit2Sharp.Commit innerCommit; + private readonly LibGit2Sharp.Diff repoDiff; - internal Commit(LibGit2Sharp.Commit innerCommit) : base(innerCommit) + internal Commit(LibGit2Sharp.Commit innerCommit, LibGit2Sharp.Diff repoDiff, GitRepositoryCache repositoryCache) { + repoDiff.NotNull(); + repositoryCache.NotNull(); this.innerCommit = innerCommit.NotNull(); - Parents = innerCommit.Parents.Select(parent => new Commit(parent)); + this.parentsLazy = new(() => [.. innerCommit.Parents.Select(parent => repositoryCache.GetOrWrap(parent, repoDiff))]); + Id = new ObjectId(innerCommit.Id); + Sha = innerCommit.Sha; When = innerCommit.Committer.When; + this.repoDiff = repoDiff; } - public int CompareTo(ICommit other) => comparerHelper.Compare(this, other); + public int CompareTo(ICommit? other) => comparerHelper.Compare(this, other); public bool Equals(ICommit? other) => equalityHelper.Equals(this, other); - public IEnumerable Parents { get; } + public IReadOnlyList Parents => this.parentsLazy.Value; + public IObjectId Id { get; } + public string Sha { get; } public DateTimeOffset When { get; } public string Message => this.innerCommit.Message; - public override bool Equals(object obj) => Equals((obj as ICommit)); + public IReadOnlyList DiffPaths + { + get + { + if (!pathsCache.TryGetValue(this.Sha, out var paths)) + { + paths = this.CommitChanges.Paths; + pathsCache[this.Sha] = paths; + } + return paths; + } + } + public override bool Equals(object? obj) => Equals(obj as ICommit); public override int GetHashCode() => equalityHelper.GetHashCode(this); - public override string ToString() => $"{Id.ToString(7)} {this.innerCommit.MessageShort}"; + public override string ToString() => $"'{Id.ToString(7)}' - {this.innerCommit.MessageShort}"; public static implicit operator LibGit2Sharp.Commit(Commit d) => d.innerCommit; + private TreeChanges CommitChanges => new(this.repoDiff.Compare(this.innerCommit.Tree, this.innerCommit.Parents.FirstOrDefault()?.Tree)); } diff --git a/src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs b/src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs index 94e1d49d03..2ab085e8c7 100644 --- a/src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs @@ -1,16 +1,24 @@ using GitVersion.Extensions; using LibGit2Sharp; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class CommitCollection : ICommitCollection { private readonly ICommitLog innerCollection; + private readonly Lazy> commits; + private readonly Diff diff; + private readonly GitRepositoryCache repositoryCache; - internal CommitCollection(ICommitLog collection) => this.innerCollection = collection.NotNull(); + internal CommitCollection(ICommitLog collection, Diff diff, GitRepositoryCache repositoryCache) + { + this.innerCollection = collection.NotNull(); + this.commits = new Lazy>(() => [.. this.innerCollection.Select(commit => repositoryCache.GetOrWrap(commit, diff))]); + this.diff = diff.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + } - public IEnumerator GetEnumerator() - => this.innerCollection.Select(commit => new Commit(commit)).GetEnumerator(); + public IEnumerator GetEnumerator() => this.commits.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); @@ -19,6 +27,18 @@ public IEnumerable GetCommitsPriorTo(DateTimeOffset olderThan) public IEnumerable QueryBy(CommitFilter commitFilter) { + var includeReachableFrom = GetReacheableFrom(commitFilter.IncludeReachableFrom); + var excludeReachableFrom = GetReacheableFrom(commitFilter.ExcludeReachableFrom); + var filter = new LibGit2Sharp.CommitFilter + { + IncludeReachableFrom = includeReachableFrom, + ExcludeReachableFrom = excludeReachableFrom, + FirstParentOnly = commitFilter.FirstParentOnly, + SortBy = (LibGit2Sharp.CommitSortStrategies)commitFilter.SortBy + }; + var commitLog = ((IQueryableCommitLog)this.innerCollection).QueryBy(filter); + return new CommitCollection(commitLog, this.diff, this.repositoryCache); + static object? GetReacheableFrom(object? item) => item switch { @@ -26,11 +46,5 @@ public IEnumerable QueryBy(CommitFilter commitFilter) Branch b => (LibGit2Sharp.Branch)b, _ => null }; - - var includeReachableFrom = GetReacheableFrom(commitFilter.IncludeReachableFrom); - var excludeReachableFrom = GetReacheableFrom(commitFilter.ExcludeReachableFrom); - var filter = new LibGit2Sharp.CommitFilter { IncludeReachableFrom = includeReachableFrom, ExcludeReachableFrom = excludeReachableFrom, FirstParentOnly = commitFilter.FirstParentOnly, SortBy = (LibGit2Sharp.CommitSortStrategies)commitFilter.SortBy }; - var commitLog = ((IQueryableCommitLog)this.innerCollection).QueryBy(filter); - return new CommitCollection(commitLog); } } diff --git a/src/GitVersion.LibGit2Sharp/Git/GitObject.cs b/src/GitVersion.LibGit2Sharp/Git/GitObject.cs deleted file mode 100644 index 535056bdcf..0000000000 --- a/src/GitVersion.LibGit2Sharp/Git/GitObject.cs +++ /dev/null @@ -1,26 +0,0 @@ -using GitVersion.Extensions; -using GitVersion.Helpers; - -namespace GitVersion; - -internal class GitObject : IGitObject -{ - private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Id); - private static readonly LambdaKeyComparer comparerHelper = new(x => x.Sha); - - internal GitObject(LibGit2Sharp.GitObject innerGitObject) - { - innerGitObject = innerGitObject.NotNull(); - Id = new ObjectId(innerGitObject.Id); - Sha = innerGitObject.Sha; - } - - public int CompareTo(IGitObject other) => comparerHelper.Compare(this, other); - public bool Equals(IGitObject? other) => equalityHelper.Equals(this, other); - public override bool Equals(object obj) => Equals((obj as IGitObject)); - public override int GetHashCode() => equalityHelper.GetHashCode(this); - public override string ToString() => Id.ToString(7); - - public IObjectId Id { get; } - public string Sha { get; } -} diff --git a/src/GitVersion.LibGit2Sharp/Git/GitRepository.cs b/src/GitVersion.LibGit2Sharp/Git/GitRepository.cs index cf1f315716..a3b899013e 100644 --- a/src/GitVersion.LibGit2Sharp/Git/GitRepository.cs +++ b/src/GitVersion.LibGit2Sharp/Git/GitRepository.cs @@ -1,50 +1,51 @@ using GitVersion.Extensions; using GitVersion.Helpers; -using GitVersion.Logging; using LibGit2Sharp; -using LibGit2Sharp.Handlers; -namespace GitVersion; +namespace GitVersion.Git; -internal sealed class GitRepository : IMutatingGitRepository +internal sealed partial class GitRepository { - private readonly ILog log; - private readonly Lazy repositoryLazy; + private Lazy? repositoryLazy; + private readonly GitRepositoryCache repositoryCache = new(); - public GitRepository(ILog log, IGitRepositoryInfo repositoryInfo) - : this(log, () => repositoryInfo.GitRootPath) + private IRepository RepositoryInstance { + get + { + var lazy = this.repositoryLazy ?? throw new NullReferenceException("Repository not initialized. Call DiscoverRepository() first."); + return lazy.Value; + } } + public string Path => RepositoryInstance.Info.Path; + public string WorkingDirectory => RepositoryInstance.Info.WorkingDirectory; + public bool IsHeadDetached => RepositoryInstance.Info.IsHeadDetached; + public bool IsShallow => RepositoryInstance.Info.IsShallow; + public IBranch Head => this.repositoryCache.GetOrWrap(RepositoryInstance.Head, RepositoryInstance.Diff); - internal GitRepository(string gitRootDirectory) - : this(new NullLog(), () => gitRootDirectory) - { - } + private ITagCollection? tags; + public ITagCollection Tags => this.tags ??= new TagCollection(RepositoryInstance.Tags, RepositoryInstance.Diff, this.repositoryCache); - internal GitRepository(IRepository repository) - { - repository = repository.NotNull(); - this.log = new NullLog(); - this.repositoryLazy = new Lazy(() => repository); - } + public IBranchCollection Branches => new BranchCollection(RepositoryInstance.Branches, RepositoryInstance.Diff, this.repositoryCache); - private GitRepository(ILog log, Func getGitRootDirectory) + private ICommitCollection? commits; + public ICommitCollection Commits => this.commits ??= new CommitCollection(RepositoryInstance.Commits, RepositoryInstance.Diff, this.repositoryCache); + + private IRemoteCollection? remotes; + public IRemoteCollection Remotes => this.remotes ??= new RemoteCollection(RepositoryInstance.Network.Remotes, this.repositoryCache); + + private IReferenceCollection? references; + public IReferenceCollection References => this.references ??= new ReferenceCollection(RepositoryInstance.Refs, this.repositoryCache); + + public void DiscoverRepository(string? gitDirectory) { - this.log = log.NotNull(); - this.repositoryLazy = new Lazy(() => new Repository(getGitRootDirectory())); + if (gitDirectory?.EndsWith(".git") == false) + { + gitDirectory = Repository.Discover(gitDirectory); + } + this.repositoryLazy = new(() => new Repository(gitDirectory)); } - private IRepository RepositoryInstance => this.repositoryLazy.Value; - public string Path => RepositoryInstance.Info.Path; - public string WorkingDirectory => RepositoryInstance.Info.WorkingDirectory; - public bool IsHeadDetached => RepositoryInstance.Info.IsHeadDetached; - public IBranch Head => new Branch(RepositoryInstance.Head); - public ITagCollection Tags => new TagCollection(RepositoryInstance.Tags); - public IReferenceCollection Refs => new ReferenceCollection(RepositoryInstance.Refs); - public IBranchCollection Branches => new BranchCollection(RepositoryInstance.Branches); - public ICommitCollection Commits => new CommitCollection(RepositoryInstance.Commits); - public IRemoteCollection Remotes => new RemoteCollection(RepositoryInstance.Network.Remotes); - public ICommit? FindMergeBase(ICommit commit, ICommit otherCommit) { commit = commit.NotNull(); @@ -56,134 +57,28 @@ private GitRepository(ILog log, Func getGitRootDirectory) var first = (Commit)commit; var second = (Commit)otherCommit; var mergeBase = RepositoryInstance.ObjectDatabase.FindMergeBase(first, second); - return mergeBase == null ? null : new Commit(mergeBase); + return mergeBase == null ? null : this.repositoryCache.GetOrWrap(mergeBase, RepositoryInstance.Diff); }); } - public int GetNumberOfUncommittedChanges() + public int UncommittedChangesCount() { var retryAction = new RetryAction(); - return retryAction.Execute(GetNumberOfUncommittedChangesInternal); - } - - public void CreateBranchForPullRequestBranch(AuthenticationInfo auth) => RepositoryExtensions.RunSafe(() => - { - this.log.Info("Fetching remote refs to see if there is a pull request ref"); - - // FIX ME: What to do when Tip is null? - if (Head.Tip == null) - return; - - var headTipSha = Head.Tip.Sha; - var remote = RepositoryInstance.Network.Remotes.Single(); - var reference = GetPullRequestReference(auth, remote, headTipSha); - var canonicalName = reference.CanonicalName; - var referenceName = ReferenceName.Parse(reference.CanonicalName); - this.log.Info($"Found remote tip '{canonicalName}' pointing at the commit '{headTipSha}'."); - - if (referenceName.IsTag) - { - this.log.Info($"Checking out tag '{canonicalName}'"); - Checkout(reference.Target.Sha); - } - else if (referenceName.IsPullRequest) - { - var fakeBranchName = canonicalName.Replace("refs/pull/", "refs/heads/pull/").Replace("refs/pull-requests/", "refs/heads/pull-requests/"); - - this.log.Info($"Creating fake local branch '{fakeBranchName}'."); - Refs.Add(fakeBranchName, headTipSha); - - this.log.Info($"Checking local branch '{fakeBranchName}' out."); - Checkout(fakeBranchName); - } - else - { - var message = $"Remote tip '{canonicalName}' from remote '{remote.Url}' doesn't look like a valid pull request."; - throw new WarningException(message); - } - }); - - public void Clone(string? sourceUrl, string? workdirPath, AuthenticationInfo auth) - { - try - { - var path = Repository.Clone(sourceUrl, workdirPath, GetCloneOptions(auth)); - this.log.Info($"Returned path after repository clone: {path}"); - } - catch (LibGit2Sharp.LockedFileException ex) - { - throw new LockedFileException(ex); - } - catch (LibGit2SharpException ex) - { - var message = ex.Message; - if (message.Contains("401")) - { - throw new Exception("Unauthorized: Incorrect username/password", ex); - } - - if (message.Contains("403")) - { - throw new Exception("Forbidden: Possibly Incorrect username/password", ex); - } - - if (message.Contains("404")) - { - throw new Exception("Not found: The repository was not found", ex); - } - - throw new Exception("There was an unknown problem with the Git repository you provided", ex); - } - } - - public void Checkout(string commitOrBranchSpec) => - RepositoryExtensions.RunSafe(() => - Commands.Checkout(RepositoryInstance, commitOrBranchSpec)); - - public void Fetch(string remote, IEnumerable refSpecs, AuthenticationInfo auth, string? logMessage) => - RepositoryExtensions.RunSafe(() => - Commands.Fetch((Repository)RepositoryInstance, remote, refSpecs, GetFetchOptions(auth), logMessage)); - - private DirectReference GetPullRequestReference(AuthenticationInfo auth, LibGit2Sharp.Remote remote, string headTipSha) - { - var network = RepositoryInstance.Network; - var credentialsProvider = GetCredentialsProvider(auth); - var remoteTips = (credentialsProvider != null - ? network.ListReferences(remote, credentialsProvider) - : network.ListReferences(remote)) - .Select(r => r.ResolveToDirectReference()).ToList(); - - this.log.Info($"Remote Refs:{System.Environment.NewLine}" + string.Join(System.Environment.NewLine, remoteTips.Select(r => r.CanonicalName))); - var refs = remoteTips.Where(r => r.TargetIdentifier == headTipSha).ToList(); - - switch (refs.Count) - { - case 0: - { - var message = $"Couldn't find any remote tips from remote '{remote.Url}' pointing at the commit '{headTipSha}'."; - throw new WarningException(message); - } - case > 1: - { - var names = string.Join(", ", refs.Select(r => r.CanonicalName)); - var message = $"Found more than one remote tip from remote '{remote.Url}' pointing at the commit '{headTipSha}'. Unable to determine which one to use ({names})."; - throw new WarningException(message); - } - } - - return refs.First(); + return retryAction.Execute(GetUncommittedChangesCountInternal); } public void Dispose() { - if (this.repositoryLazy.IsValueCreated) RepositoryInstance.Dispose(); + if (this.repositoryLazy is not { IsValueCreated: true }) return; + RepositoryInstance.Dispose(); + this.repositoryLazy = null; } - private int GetNumberOfUncommittedChangesInternal() + private int GetUncommittedChangesCountInternal() { // check if we have a branch tip at all to behave properly with empty repos // => return that we have actually un-committed changes because we are apparently - // running GitVersion on something which lives inside this brand new repo _/\Ö/\_ + // running GitVersion on something which lives inside this brand-new repo _/\Ö/\_ if (RepositoryInstance.Head?.Tip == null || RepositoryInstance.Diff == null) { // this is a somewhat cumbersome way of figuring out the number of changes in the repo @@ -203,27 +98,9 @@ private int GetNumberOfUncommittedChangesInternal() } // gets all changes of the last commit vs Staging area and WT - var changes = RepositoryInstance.Diff.Compare(RepositoryInstance.Head.Tip.Tree, + var changes = RepositoryInstance.Diff.Compare(RepositoryInstance.Head.Tip.Tree, DiffTargets.Index | DiffTargets.WorkingDirectory); return changes.Count; } - - internal static string? Discover(string? path) => Repository.Discover(path); - - private static FetchOptions GetFetchOptions(AuthenticationInfo auth) => - new() { CredentialsProvider = GetCredentialsProvider(auth) }; - - private static CloneOptions GetCloneOptions(AuthenticationInfo auth) => - new() { Checkout = false, CredentialsProvider = GetCredentialsProvider(auth) }; - - private static CredentialsHandler? GetCredentialsProvider(AuthenticationInfo auth) - { - if (!auth.Username.IsNullOrWhiteSpace()) - { - return (_, _, _) => new UsernamePasswordCredentials { Username = auth.Username, Password = auth.Password ?? string.Empty }; - } - - return null; - } } diff --git a/src/GitVersion.LibGit2Sharp/Git/GitRepository.mutating.cs b/src/GitVersion.LibGit2Sharp/Git/GitRepository.mutating.cs new file mode 100644 index 0000000000..022fdf8c11 --- /dev/null +++ b/src/GitVersion.LibGit2Sharp/Git/GitRepository.mutating.cs @@ -0,0 +1,129 @@ +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.Logging; +using LibGit2Sharp; +using LibGit2Sharp.Handlers; + +namespace GitVersion.Git; + +internal partial class GitRepository(ILog log) : IMutatingGitRepository +{ + private readonly ILog log = log.NotNull(); + + public void Clone(string? sourceUrl, string? workdirPath, AuthenticationInfo auth) + { + try + { + var path = Repository.Clone(sourceUrl, workdirPath, GetCloneOptions(auth)); + this.log.Info($"Returned path after repository clone: {path}"); + } + catch (LibGit2Sharp.LockedFileException ex) + { + throw new LockedFileException(ex); + } + catch (LibGit2SharpException ex) + { + var message = ex.Message; + if (message.Contains("401")) + { + throw new Exception("Unauthorized: Incorrect username/password", ex); + } + + if (message.Contains("403")) + { + throw new Exception("Forbidden: Possibly Incorrect username/password", ex); + } + + if (message.Contains("404")) + { + throw new Exception("Not found: The repository was not found", ex); + } + + throw new Exception("There was an unknown problem with the Git repository you provided", ex); + } + } + public void Checkout(string commitOrBranchSpec) => + RepositoryExtensions.RunSafe(() => + Commands.Checkout(RepositoryInstance, commitOrBranchSpec)); + public void Fetch(string remote, IEnumerable refSpecs, AuthenticationInfo auth, string? logMessage) => + RepositoryExtensions.RunSafe(() => + Commands.Fetch((Repository)RepositoryInstance, remote, refSpecs, GetFetchOptions(auth), logMessage)); + public void CreateBranchForPullRequestBranch(AuthenticationInfo auth) => RepositoryExtensions.RunSafe(() => + { + this.log.Info("Fetching remote refs to see if there is a pull request ref"); + + // FIX ME: What to do when Tip is null? + if (Head.Tip == null) + return; + + var headTipSha = Head.Tip.Sha; + var remote = RepositoryInstance.Network.Remotes.Single(); + var reference = GetPullRequestReference(auth, remote, headTipSha); + var canonicalName = reference.CanonicalName; + var referenceName = ReferenceName.Parse(reference.CanonicalName); + this.log.Info($"Found remote tip '{canonicalName}' pointing at the commit '{headTipSha}'."); + + if (referenceName.IsTag) + { + this.log.Info($"Checking out tag '{canonicalName}'"); + Checkout(reference.Target.Sha); + } + else if (referenceName.IsPullRequest) + { + var fakeBranchName = canonicalName.Replace("refs/pull/", "refs/heads/pull/").Replace("refs/pull-requests/", "refs/heads/pull-requests/"); + + this.log.Info($"Creating fake local branch '{fakeBranchName}'."); + References.Add(fakeBranchName, headTipSha); + + this.log.Info($"Checking local branch '{fakeBranchName}' out."); + Checkout(fakeBranchName); + } + else + { + var message = $"Remote tip '{canonicalName}' from remote '{remote.Url}' doesn't look like a valid pull request."; + throw new WarningException(message); + } + }); + private DirectReference GetPullRequestReference(AuthenticationInfo auth, LibGit2Sharp.Remote remote, string headTipSha) + { + var network = RepositoryInstance.Network; + var credentialsProvider = GetCredentialsProvider(auth); + var remoteTips = (credentialsProvider != null + ? network.ListReferences(remote, credentialsProvider) + : network.ListReferences(remote)) + .Select(r => r.ResolveToDirectReference()).ToList(); + + this.log.Info($"Remote Refs:{FileSystemHelper.Path.NewLine}" + string.Join(FileSystemHelper.Path.NewLine, remoteTips.Select(r => r.CanonicalName))); + var refs = remoteTips.Where(r => r.TargetIdentifier == headTipSha).ToList(); + + switch (refs.Count) + { + case 0: + { + var message = $"Couldn't find any remote tips from remote '{remote.Url}' pointing at the commit '{headTipSha}'."; + throw new WarningException(message); + } + case > 1: + { + var names = string.Join(", ", refs.Select(r => r.CanonicalName)); + var message = $"Found more than one remote tip from remote '{remote.Url}' pointing at the commit '{headTipSha}'. Unable to determine which one to use ({names})."; + throw new WarningException(message); + } + } + + return refs[0]; + } + private static FetchOptions GetFetchOptions(AuthenticationInfo auth) => + new() { CredentialsProvider = GetCredentialsProvider(auth) }; + private static CloneOptions GetCloneOptions(AuthenticationInfo auth) => + new() { Checkout = false, FetchOptions = { CredentialsProvider = GetCredentialsProvider(auth) } }; + private static CredentialsHandler? GetCredentialsProvider(AuthenticationInfo auth) + { + if (!auth.Username.IsNullOrWhiteSpace()) + { + return (_, _, _) => new UsernamePasswordCredentials { Username = auth.Username, Password = auth.Password ?? string.Empty }; + } + + return null; + } +} diff --git a/src/GitVersion.LibGit2Sharp/Git/GitRepositoryCache.cs b/src/GitVersion.LibGit2Sharp/Git/GitRepositoryCache.cs new file mode 100644 index 0000000000..8d8eba006b --- /dev/null +++ b/src/GitVersion.LibGit2Sharp/Git/GitRepositoryCache.cs @@ -0,0 +1,37 @@ +using System.Collections.Concurrent; +using LibGit2Sharp; + +namespace GitVersion.Git; + +internal class GitRepositoryCache +{ + private readonly ConcurrentDictionary cachedBranches = new(); + private readonly ConcurrentDictionary cachedCommits = new(); + private readonly ConcurrentDictionary cachedTags = new(); + private readonly ConcurrentDictionary cachedRemotes = new(); + private readonly ConcurrentDictionary cachedReferences = new(); + private readonly ConcurrentDictionary cachedRefSpecs = new(); + + public Branch GetOrWrap(LibGit2Sharp.Branch innerBranch, Diff repoDiff) + { + var cacheKey = innerBranch.Tip is null + ? $"{innerBranch.RemoteName}/{innerBranch.CanonicalName}" + : $"{innerBranch.RemoteName}/{innerBranch.CanonicalName}@{innerBranch.Tip.Sha}"; + return cachedBranches.GetOrAdd(cacheKey, _ => new Branch(innerBranch, repoDiff, this)); + } + + public Commit GetOrWrap(LibGit2Sharp.Commit innerCommit, Diff repoDiff) + => cachedCommits.GetOrAdd(innerCommit.Sha, _ => new Commit(innerCommit, repoDiff, this)); + + public Tag GetOrWrap(LibGit2Sharp.Tag innerTag, Diff repoDiff) + => cachedTags.GetOrAdd(innerTag.CanonicalName, _ => new Tag(innerTag, repoDiff, this)); + + public Remote GetOrWrap(LibGit2Sharp.Remote innerRemote) + => cachedRemotes.GetOrAdd(innerRemote.Name, _ => new Remote(innerRemote, this)); + + public Reference GetOrWrap(LibGit2Sharp.Reference innerReference) + => cachedReferences.GetOrAdd(innerReference.CanonicalName, _ => new Reference(innerReference)); + + public RefSpec GetOrWrap(LibGit2Sharp.RefSpec innerRefSpec) + => cachedRefSpecs.GetOrAdd(innerRefSpec.Specification, _ => new RefSpec(innerRefSpec)); +} diff --git a/src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs b/src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs index da70201a7a..44a58b6485 100644 --- a/src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs +++ b/src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs @@ -1,27 +1,30 @@ +using System.IO.Abstractions; using GitVersion.Extensions; using GitVersion.Helpers; +using LibGit2Sharp; using Microsoft.Extensions.Options; -namespace GitVersion; +namespace GitVersion.Git; -internal class GitRepositoryInfo : IGitRepositoryInfo +public class GitRepositoryInfo : IGitRepositoryInfo { - private readonly IOptions options; - private GitVersionOptions gitVersionOptions => this.options.Value; + private readonly IFileSystem fileSystem; + private readonly GitVersionOptions gitVersionOptions; private readonly Lazy dynamicGitRepositoryPath; private readonly Lazy dotGitDirectory; private readonly Lazy gitRootPath; private readonly Lazy projectRootDirectory; - public GitRepositoryInfo(IOptions options) + public GitRepositoryInfo(IFileSystem fileSystem, IOptions options) { - this.options = options.NotNull(); + this.fileSystem = fileSystem.NotNull(); + this.gitVersionOptions = options.NotNull().Value; - this.dynamicGitRepositoryPath = new Lazy(GetDynamicGitRepositoryPath); - this.dotGitDirectory = new Lazy(GetDotGitDirectory); - this.gitRootPath = new Lazy(GetGitRootPath); - this.projectRootDirectory = new Lazy(GetProjectRootDirectory); + this.dynamicGitRepositoryPath = new(GetDynamicGitRepositoryPath); + this.dotGitDirectory = new(GetDotGitDirectory); + this.gitRootPath = new(GetGitRootPath); + this.projectRootDirectory = new(GetProjectRootDirectory); } public string? DynamicGitRepositoryPath => this.dynamicGitRepositoryPath.Value; @@ -37,24 +40,24 @@ public GitRepositoryInfo(IOptions options) var targetUrl = repositoryInfo.TargetUrl; var clonePath = repositoryInfo.ClonePath; - var userTemp = clonePath ?? Path.GetTempPath(); + var userTemp = clonePath ?? FileSystemHelper.Path.GetTempPath(); var repositoryName = targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty); - var possiblePath = PathHelper.Combine(userTemp, repositoryName); + var possiblePath = FileSystemHelper.Path.Combine(userTemp, repositoryName); // Verify that the existing directory is ok for us to use - if (Directory.Exists(possiblePath) && !GitRepoHasMatchingRemote(possiblePath, targetUrl)) + if (this.fileSystem.Directory.Exists(possiblePath) && !GitRepoHasMatchingRemote(possiblePath, targetUrl)) { var i = 1; var originalPath = possiblePath; bool possiblePathExists; do { - possiblePath = string.Concat(originalPath, "_", i++.ToString()); - possiblePathExists = Directory.Exists(possiblePath); + possiblePath = $"{originalPath}_{i++}"; + possiblePathExists = this.fileSystem.Directory.Exists(possiblePath); } while (possiblePathExists && !GitRepoHasMatchingRemote(possiblePath, targetUrl)); } - var repositoryPath = PathHelper.Combine(possiblePath, ".git"); + var repositoryPath = FileSystemHelper.Path.Combine(possiblePath, ".git"); return repositoryPath; } @@ -62,19 +65,15 @@ public GitRepositoryInfo(IOptions options) { var gitDirectory = !DynamicGitRepositoryPath.IsNullOrWhiteSpace() ? DynamicGitRepositoryPath - : GitRepository.Discover(gitVersionOptions.WorkingDirectory); + : Repository.Discover(gitVersionOptions.WorkingDirectory); gitDirectory = gitDirectory?.TrimEnd('/', '\\'); if (gitDirectory.IsNullOrEmpty()) throw new DirectoryNotFoundException("Cannot find the .git directory"); - var directoryInfo = Directory.GetParent(gitDirectory); - if (directoryInfo == null) - { - throw new DirectoryNotFoundException("Cannot find the .git directory"); - } - return gitDirectory.Contains(PathHelper.Combine(".git", "worktrees")) - ? Directory.GetParent(directoryInfo.FullName)?.FullName + var directoryInfo = this.fileSystem.Directory.GetParent(gitDirectory) ?? throw new DirectoryNotFoundException("Cannot find the .git directory"); + return gitDirectory.Contains(FileSystemHelper.Path.Combine(".git", "worktrees")) + ? this.fileSystem.Directory.GetParent(directoryInfo.FullName)?.FullName : gitDirectory; } @@ -85,12 +84,13 @@ private string GetProjectRootDirectory() return gitVersionOptions.WorkingDirectory; } - var gitDirectory = GitRepository.Discover(gitVersionOptions.WorkingDirectory); + var gitDirectory = Repository.Discover(gitVersionOptions.WorkingDirectory); if (gitDirectory.IsNullOrEmpty()) throw new DirectoryNotFoundException("Cannot find the .git directory"); - return new GitRepository(gitDirectory).WorkingDirectory; + using var repo = new Repository(gitDirectory); + return repo.Info.WorkingDirectory; } private string? GetGitRootPath() @@ -105,13 +105,12 @@ private static bool GitRepoHasMatchingRemote(string possiblePath, string targetU { try { - var gitRepository = new GitRepository(possiblePath); - return gitRepository.Remotes.Any(r => r.Url == targetUrl); + using var gitRepository = new Repository(possiblePath); + return gitRepository.Network.Remotes.Any(r => r.Url == targetUrl); } catch (Exception) { return false; } } - } diff --git a/src/GitVersion.LibGit2Sharp/Git/ObjectId.cs b/src/GitVersion.LibGit2Sharp/Git/ObjectId.cs index 74a36ca1e1..0d924f59af 100644 --- a/src/GitVersion.LibGit2Sharp/Git/ObjectId.cs +++ b/src/GitVersion.LibGit2Sharp/Git/ObjectId.cs @@ -1,7 +1,7 @@ using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class ObjectId : IObjectId { @@ -17,9 +17,9 @@ public ObjectId(string sha) : this(new LibGit2Sharp.ObjectId(sha)) { } - public int CompareTo(IObjectId other) => comparerHelper.Compare(this, other); + public int CompareTo(IObjectId? other) => comparerHelper.Compare(this, other); public bool Equals(IObjectId? other) => equalityHelper.Equals(this, other); - public override bool Equals(object obj) => Equals((obj as IObjectId)); + public override bool Equals(object? obj) => Equals(obj as IObjectId); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => ToString(7); public static implicit operator LibGit2Sharp.ObjectId(ObjectId d) => d.innerObjectId; diff --git a/src/GitVersion.LibGit2Sharp/Git/RefSpec.cs b/src/GitVersion.LibGit2Sharp/Git/RefSpec.cs index 5cd46bc0a6..1e5088f37f 100644 --- a/src/GitVersion.LibGit2Sharp/Git/RefSpec.cs +++ b/src/GitVersion.LibGit2Sharp/Git/RefSpec.cs @@ -1,22 +1,22 @@ using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; -public class RefSpec : IRefSpec +internal sealed class RefSpec : IRefSpec { private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Specification); private static readonly LambdaKeyComparer comparerHelper = new(x => x.Specification); private readonly LibGit2Sharp.RefSpec innerRefSpec; internal RefSpec(LibGit2Sharp.RefSpec refSpec) => this.innerRefSpec = refSpec.NotNull(); - public int CompareTo(IRefSpec other) => comparerHelper.Compare(this, other); + public int CompareTo(IRefSpec? other) => comparerHelper.Compare(this, other); public bool Equals(IRefSpec? other) => equalityHelper.Equals(this, other); public string Specification => this.innerRefSpec.Specification; public RefSpecDirection Direction => (RefSpecDirection)this.innerRefSpec.Direction; public string Source => this.innerRefSpec.Source; public string Destination => this.innerRefSpec.Destination; - public override bool Equals(object obj) => Equals((obj as IRefSpec)); + public override bool Equals(object? obj) => Equals(obj as IRefSpec); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Specification; } diff --git a/src/GitVersion.LibGit2Sharp/Git/RefSpecCollection.cs b/src/GitVersion.LibGit2Sharp/Git/RefSpecCollection.cs index e7ca999747..3ae987a10f 100644 --- a/src/GitVersion.LibGit2Sharp/Git/RefSpecCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/RefSpecCollection.cs @@ -1,14 +1,17 @@ using GitVersion.Extensions; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class RefSpecCollection : IRefSpecCollection { - private readonly LibGit2Sharp.RefSpecCollection innerCollection; + private readonly Lazy> refSpecs; - internal RefSpecCollection(LibGit2Sharp.RefSpecCollection collection) - => this.innerCollection = collection.NotNull(); + internal RefSpecCollection(LibGit2Sharp.RefSpecCollection innerCollection, GitRepositoryCache repositoryCache) + { + innerCollection = innerCollection.NotNull(); + this.refSpecs = new Lazy>(() => [.. innerCollection.Select(repositoryCache.GetOrWrap)]); + } - public IEnumerator GetEnumerator() => this.innerCollection.Select(tag => new RefSpec(tag)).GetEnumerator(); + public IEnumerator GetEnumerator() => this.refSpecs.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/GitVersion.LibGit2Sharp/Git/Reference.cs b/src/GitVersion.LibGit2Sharp/Git/Reference.cs index f88d75e3f2..1540ba9f7f 100644 --- a/src/GitVersion.LibGit2Sharp/Git/Reference.cs +++ b/src/GitVersion.LibGit2Sharp/Git/Reference.cs @@ -2,32 +2,31 @@ using GitVersion.Helpers; using LibGit2Sharp; -namespace GitVersion -{ - internal sealed class Reference : IReference - { - private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Name.Canonical); - private static readonly LambdaKeyComparer comparerHelper = new(x => x.Name.Canonical); - internal readonly LibGit2Sharp.Reference innerReference; +namespace GitVersion.Git; - internal Reference(LibGit2Sharp.Reference reference) - { - this.innerReference = reference.NotNull(); - Name = new ReferenceName(reference.CanonicalName); +internal sealed class Reference : IReference +{ + private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Name.Canonical); + private static readonly LambdaKeyComparer comparerHelper = new(x => x.Name.Canonical); + internal readonly LibGit2Sharp.Reference innerReference; - if (reference is DirectReference) - ReferenceTargetId = new ObjectId(reference.TargetIdentifier); - } + internal Reference(LibGit2Sharp.Reference reference) + { + this.innerReference = reference.NotNull(); + Name = new ReferenceName(reference.CanonicalName); - public ReferenceName Name { get; } - public IObjectId? ReferenceTargetId { get; } - public int CompareTo(IReference other) => comparerHelper.Compare(this, other); - public override bool Equals(object obj) => Equals(obj as IReference); - public bool Equals(IReference? other) => equalityHelper.Equals(this, other); - public override int GetHashCode() => equalityHelper.GetHashCode(this); - public override string ToString() => Name.ToString(); - public string TargetIdentifier => this.innerReference.TargetIdentifier; - public static implicit operator LibGit2Sharp.Reference(Reference d) - => d.NotNull().innerReference; + if (reference is DirectReference) + ReferenceTargetId = new ObjectId(reference.TargetIdentifier); } + + public ReferenceName Name { get; } + public IObjectId? ReferenceTargetId { get; } + public int CompareTo(IReference? other) => comparerHelper.Compare(this, other); + public override bool Equals(object? obj) => Equals(obj as IReference); + public bool Equals(IReference? other) => equalityHelper.Equals(this, other); + public override int GetHashCode() => equalityHelper.GetHashCode(this); + public override string ToString() => Name.ToString(); + public string TargetIdentifier => this.innerReference.TargetIdentifier; + public static implicit operator LibGit2Sharp.Reference(Reference d) + => d.innerReference; } diff --git a/src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs b/src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs index 2383c33980..5e0b795cd3 100644 --- a/src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs @@ -1,19 +1,21 @@ using GitVersion.Extensions; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class ReferenceCollection : IReferenceCollection { private readonly LibGit2Sharp.ReferenceCollection innerCollection; + private readonly GitRepositoryCache repositoryCache; + private Lazy> references = null!; - internal ReferenceCollection(LibGit2Sharp.ReferenceCollection collection) - => this.innerCollection = collection.NotNull(); - - public IEnumerator GetEnumerator() => this.innerCollection.Select(reference => new Reference(reference)).GetEnumerator(); - - public void Add(string name, string canonicalRefNameOrObject, bool allowOverwrite = false) => this.innerCollection.Add(name, canonicalRefNameOrObject, allowOverwrite); + internal ReferenceCollection(LibGit2Sharp.ReferenceCollection collection, GitRepositoryCache repositoryCache) + { + this.innerCollection = collection.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + InitializeReferencesLazy(); + } - public void UpdateTarget(IReference directRef, IObjectId targetId) => RepositoryExtensions.RunSafe(() => this.innerCollection.UpdateTarget((Reference)directRef, (ObjectId)targetId)); + public IEnumerator GetEnumerator() => this.references.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); @@ -22,7 +24,7 @@ public IReference? this[string name] get { var reference = this.innerCollection[name]; - return reference is null ? null : new Reference(reference); + return reference is null ? null : this.repositoryCache.GetOrWrap(reference); } } @@ -30,5 +32,23 @@ public IReference? this[string name] public IReference? Head => this["HEAD"]; - public IEnumerable FromGlob(string prefix) => this.innerCollection.FromGlob(prefix).Select(reference => new Reference(reference)); + public IEnumerable FromGlob(string prefix) + => this.innerCollection.FromGlob(prefix).Select(reference => this.repositoryCache.GetOrWrap(reference)); + + public void Add(string name, string canonicalRefNameOrObject, bool allowOverwrite = false) => + RepositoryExtensions.RunSafe(() => + { + this.innerCollection.Add(name, canonicalRefNameOrObject, allowOverwrite); + InitializeReferencesLazy(); + }); + + public void UpdateTarget(IReference directRef, IObjectId targetId) => + RepositoryExtensions.RunSafe(() => + { + this.innerCollection.UpdateTarget((Reference)directRef, (ObjectId)targetId); + InitializeReferencesLazy(); + }); + + private void InitializeReferencesLazy() + => this.references = new Lazy>(() => [.. this.innerCollection.Select(repositoryCache.GetOrWrap)]); } diff --git a/src/GitVersion.LibGit2Sharp/Git/Remote.cs b/src/GitVersion.LibGit2Sharp/Git/Remote.cs index b92326080c..e6f0099a7c 100644 --- a/src/GitVersion.LibGit2Sharp/Git/Remote.cs +++ b/src/GitVersion.LibGit2Sharp/Git/Remote.cs @@ -1,7 +1,7 @@ using GitVersion.Extensions; using GitVersion.Helpers; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class Remote : IRemote { @@ -9,28 +9,33 @@ internal sealed class Remote : IRemote private static readonly LambdaKeyComparer comparerHelper = new(x => x.Name); private readonly LibGit2Sharp.Remote innerRemote; + private readonly GitRepositoryCache repositoryCache; - internal Remote(LibGit2Sharp.Remote remote) => this.innerRemote = remote.NotNull(); + internal Remote(LibGit2Sharp.Remote remote, GitRepositoryCache repositoryCache) + { + this.innerRemote = remote.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + } - public int CompareTo(IRemote other) => comparerHelper.Compare(this, other); + public int CompareTo(IRemote? other) => comparerHelper.Compare(this, other); public bool Equals(IRemote? other) => equalityHelper.Equals(this, other); public string Name => this.innerRemote.Name; public string Url => this.innerRemote.Url; - public IEnumerable RefSpecs + private IEnumerable RefSpecs { get { var refSpecs = this.innerRemote.RefSpecs; return refSpecs is null - ? Enumerable.Empty() - : new RefSpecCollection((LibGit2Sharp.RefSpecCollection)refSpecs); + ? [] + : new RefSpecCollection((LibGit2Sharp.RefSpecCollection)refSpecs, this.repositoryCache); } } public IEnumerable FetchRefSpecs => RefSpecs.Where(x => x.Direction == RefSpecDirection.Fetch); public IEnumerable PushRefSpecs => RefSpecs.Where(x => x.Direction == RefSpecDirection.Push); - public override bool Equals(object obj) => Equals((obj as IRemote)); + public override bool Equals(object? obj) => Equals(obj as IRemote); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Name; } diff --git a/src/GitVersion.LibGit2Sharp/Git/RemoteCollection.cs b/src/GitVersion.LibGit2Sharp/Git/RemoteCollection.cs index aad80d1f22..c63f135823 100644 --- a/src/GitVersion.LibGit2Sharp/Git/RemoteCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/RemoteCollection.cs @@ -1,16 +1,21 @@ using GitVersion.Extensions; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class RemoteCollection : IRemoteCollection { private readonly LibGit2Sharp.RemoteCollection innerCollection; + private readonly GitRepositoryCache repositoryCache; + private Lazy> remotes = null!; - internal RemoteCollection(LibGit2Sharp.RemoteCollection collection) - => this.innerCollection = collection.NotNull(); + internal RemoteCollection(LibGit2Sharp.RemoteCollection collection, GitRepositoryCache repositoryCache) + { + this.innerCollection = collection.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + InitializeRemotesLazy(); + } - public IEnumerator GetEnumerator() - => this.innerCollection.Select(reference => new Remote(reference)).GetEnumerator(); + public IEnumerator GetEnumerator() => this.remotes.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); @@ -19,12 +24,24 @@ public IRemote? this[string name] get { var remote = this.innerCollection[name]; - return remote is null ? null : new Remote(remote); + return remote is null ? null : this.repositoryCache.GetOrWrap(remote); } } - public void Remove(string remoteName) => this.innerCollection.Remove(remoteName); + public void Remove(string remoteName) => + RepositoryExtensions.RunSafe(() => + { + this.innerCollection.Remove(remoteName); + InitializeRemotesLazy(); + }); + + public void Update(string remoteName, string refSpec) => + RepositoryExtensions.RunSafe(() => + { + this.innerCollection.Update(remoteName, r => r.FetchRefSpecs.Add(refSpec)); + InitializeRemotesLazy(); + }); - public void Update(string remoteName, string refSpec) - => this.innerCollection.Update(remoteName, r => r.FetchRefSpecs.Add(refSpec)); + private void InitializeRemotesLazy() + => this.remotes = new Lazy>(() => [.. this.innerCollection.Select(repositoryCache.GetOrWrap)]); } diff --git a/src/GitVersion.LibGit2Sharp/Git/RepositoryExtensions.cs b/src/GitVersion.LibGit2Sharp/Git/RepositoryExtensions.cs new file mode 100644 index 0000000000..f98e993fa2 --- /dev/null +++ b/src/GitVersion.LibGit2Sharp/Git/RepositoryExtensions.cs @@ -0,0 +1,30 @@ +namespace GitVersion.Git; + +internal static class RepositoryExtensions +{ + internal static void RunSafe(Action operation) + { + try + { + operation(); + } + catch (LibGit2Sharp.LockedFileException ex) + { + // Wrap this exception so that callers that want to catch it doesn't need to take a dependency on LibGit2Sharp. + throw new LockedFileException(ex); + } + } + + internal static T RunSafe(Func operation) + { + try + { + return operation(); + } + catch (LibGit2Sharp.LockedFileException ex) + { + // Wrap this exception so that callers that want to catch it doesn't need to take a dependency on LibGit2Sharp. + throw new LockedFileException(ex); + } + } +} diff --git a/src/GitVersion.LibGit2Sharp/Git/Tag.cs b/src/GitVersion.LibGit2Sharp/Git/Tag.cs index dd0b83b270..47743c6eac 100644 --- a/src/GitVersion.LibGit2Sharp/Git/Tag.cs +++ b/src/GitVersion.LibGit2Sharp/Git/Tag.cs @@ -2,26 +2,33 @@ using GitVersion.Helpers; using LibGit2Sharp; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class Tag : ITag { private static readonly LambdaEqualityHelper equalityHelper = new(x => x.Name.Canonical); private static readonly LambdaKeyComparer comparerHelper = new(x => x.Name.Canonical); private readonly LibGit2Sharp.Tag innerTag; + private readonly Diff diff; + private readonly Lazy commitLazy; + private readonly GitRepositoryCache repositoryCache; - internal Tag(LibGit2Sharp.Tag tag) + internal Tag(LibGit2Sharp.Tag tag, Diff diff, GitRepositoryCache repositoryCache) { this.innerTag = tag.NotNull(); - Name = new ReferenceName(this.innerTag.CanonicalName); + this.diff = diff.NotNull(); + this.repositoryCache = repositoryCache.NotNull(); + this.commitLazy = new(PeeledTargetCommit); + Name = new(this.innerTag.CanonicalName); } public ReferenceName Name { get; } - public int CompareTo(ITag other) => comparerHelper.Compare(this, other); + public int CompareTo(ITag? other) => comparerHelper.Compare(this, other); public bool Equals(ITag? other) => equalityHelper.Equals(this, other); - public string? TargetSha => this.innerTag.Target.Sha; + public string TargetSha => this.innerTag.Target.Sha; + public ICommit Commit => this.commitLazy.Value.NotNull(); - public ICommit? PeeledTargetCommit() + private ICommit? PeeledTargetCommit() { var target = this.innerTag.Target; @@ -30,10 +37,10 @@ internal Tag(LibGit2Sharp.Tag tag) target = annotation.Target; } - return target is LibGit2Sharp.Commit commit ? new Commit(commit) : null; + return target is LibGit2Sharp.Commit commit ? this.repositoryCache.GetOrWrap(commit, this.diff) : null; } - public override bool Equals(object obj) => Equals((obj as ITag)); + public override bool Equals(object? obj) => Equals(obj as ITag); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Name.ToString(); } diff --git a/src/GitVersion.LibGit2Sharp/Git/TagCollection.cs b/src/GitVersion.LibGit2Sharp/Git/TagCollection.cs index ca81e4077f..8ff39d4b4a 100644 --- a/src/GitVersion.LibGit2Sharp/Git/TagCollection.cs +++ b/src/GitVersion.LibGit2Sharp/Git/TagCollection.cs @@ -1,16 +1,20 @@ using GitVersion.Extensions; -namespace GitVersion; +namespace GitVersion.Git; internal sealed class TagCollection : ITagCollection { - private readonly LibGit2Sharp.TagCollection innerCollection; + private readonly Lazy> tags; - internal TagCollection(LibGit2Sharp.TagCollection collection) - => this.innerCollection = collection.NotNull(); + internal TagCollection(LibGit2Sharp.TagCollection collection, LibGit2Sharp.Diff diff, GitRepositoryCache repositoryCache) + { + collection.NotNull(); + diff.NotNull(); + repositoryCache.NotNull(); + this.tags = new Lazy>(() => [.. collection.Select(tag => repositoryCache.GetOrWrap(tag, diff))]); + } - public IEnumerator GetEnumerator() - => this.innerCollection.Select(tag => new Tag(tag)).GetEnumerator(); + public IEnumerator GetEnumerator() => this.tags.Value.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/GitVersion.LibGit2Sharp/Git/TreeChanges.cs b/src/GitVersion.LibGit2Sharp/Git/TreeChanges.cs new file mode 100644 index 0000000000..9ee9385a7e --- /dev/null +++ b/src/GitVersion.LibGit2Sharp/Git/TreeChanges.cs @@ -0,0 +1,8 @@ +namespace GitVersion.Git; + +internal sealed class TreeChanges(LibGit2Sharp.TreeChanges innerTreeChanges) : ITreeChanges +{ + private readonly LibGit2Sharp.TreeChanges innerTreeChanges = innerTreeChanges ?? throw new ArgumentNullException(nameof(innerTreeChanges)); + + public IReadOnlyList Paths => [.. this.innerTreeChanges.Select(element => element.Path)]; +} diff --git a/src/GitVersion.LibGit2Sharp/GitVersion.LibGit2Sharp.csproj b/src/GitVersion.LibGit2Sharp/GitVersion.LibGit2Sharp.csproj index be6aa028f4..31fa835152 100644 --- a/src/GitVersion.LibGit2Sharp/GitVersion.LibGit2Sharp.csproj +++ b/src/GitVersion.LibGit2Sharp/GitVersion.LibGit2Sharp.csproj @@ -1,18 +1,11 @@ - - netstandard2.0 - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + - + + diff --git a/src/GitVersion.LibGit2Sharp/GitVersionLibGit2SharpModule.cs b/src/GitVersion.LibGit2Sharp/GitVersionLibGit2SharpModule.cs index 1886324ece..317a3a3af2 100644 --- a/src/GitVersion.LibGit2Sharp/GitVersionLibGit2SharpModule.cs +++ b/src/GitVersion.LibGit2Sharp/GitVersionLibGit2SharpModule.cs @@ -1,3 +1,4 @@ +using GitVersion.Git; using Microsoft.Extensions.DependencyInjection; namespace GitVersion; @@ -7,7 +8,7 @@ public class GitVersionLibGit2SharpModule : IGitVersionModule public void RegisterTypes(IServiceCollection services) { services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(sp => (IMutatingGitRepository)sp.GetRequiredService()); services.AddSingleton(); } } diff --git a/src/GitVersion.LibGit2Sharp/LibGit2SharpExtensions.cs b/src/GitVersion.LibGit2Sharp/LibGit2SharpExtensions.cs new file mode 100644 index 0000000000..727e2c1fca --- /dev/null +++ b/src/GitVersion.LibGit2Sharp/LibGit2SharpExtensions.cs @@ -0,0 +1,15 @@ +using GitVersion.Git; +using GitVersion.Logging; +using LibGit2Sharp; + +namespace GitVersion; + +public static class LibGit2SharpExtensions +{ + public static IGitRepository ToGitRepository(this IRepository repository) + { + var gitRepository = new GitRepository(new NullLog()); + gitRepository.DiscoverRepository(repository.Info.Path); + return gitRepository; + } +} diff --git a/src/GitVersion.LibGit2Sharp/PublicAPI.Shipped.txt b/src/GitVersion.LibGit2Sharp/PublicAPI.Shipped.txt index c9904bace6..8a22a02e1b 100644 --- a/src/GitVersion.LibGit2Sharp/PublicAPI.Shipped.txt +++ b/src/GitVersion.LibGit2Sharp/PublicAPI.Shipped.txt @@ -1,19 +1,12 @@ #nullable enable +GitVersion.Git.GitRepositoryInfo +GitVersion.Git.GitRepositoryInfo.DotGitDirectory.get -> string? +GitVersion.Git.GitRepositoryInfo.DynamicGitRepositoryPath.get -> string? +GitVersion.Git.GitRepositoryInfo.GitRepositoryInfo(System.IO.Abstractions.IFileSystem! fileSystem, Microsoft.Extensions.Options.IOptions! options) -> void +GitVersion.Git.GitRepositoryInfo.GitRootPath.get -> string? +GitVersion.Git.GitRepositoryInfo.ProjectRootDirectory.get -> string? GitVersion.GitVersionLibGit2SharpModule GitVersion.GitVersionLibGit2SharpModule.GitVersionLibGit2SharpModule() -> void GitVersion.GitVersionLibGit2SharpModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.RefSpec -GitVersion.RefSpec.CompareTo(GitVersion.IRefSpec! other) -> int -GitVersion.RefSpec.Destination.get -> string! -GitVersion.RefSpec.Direction.get -> GitVersion.RefSpecDirection -GitVersion.RefSpec.Equals(GitVersion.IRefSpec? other) -> bool -GitVersion.RefSpec.Source.get -> string! -GitVersion.RefSpec.Specification.get -> string! -GitVersion.RepositoryExtensions -override GitVersion.RefSpec.Equals(object! obj) -> bool -override GitVersion.RefSpec.GetHashCode() -> int -override GitVersion.RefSpec.ToString() -> string! -static GitVersion.RepositoryExtensions.RunSafe(System.Action! operation) -> void -static GitVersion.RepositoryExtensions.RunSafe(System.Func! operation) -> T -static GitVersion.RepositoryExtensions.ToGitRepository(this LibGit2Sharp.IRepository! repository) -> GitVersion.IGitRepository! -static GitVersion.RepositoryExtensions.ToGitRepositoryInfo(Microsoft.Extensions.Options.IOptions! options) -> GitVersion.IGitRepositoryInfo! +GitVersion.LibGit2SharpExtensions +static GitVersion.LibGit2SharpExtensions.ToGitRepository(this LibGit2Sharp.IRepository! repository) -> GitVersion.Git.IGitRepository! diff --git a/src/GitVersion.LibGit2Sharp/PublicAPI.Unshipped.txt b/src/GitVersion.LibGit2Sharp/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/GitVersion.LibGit2Sharp/PublicAPI.Unshipped.txt +++ b/src/GitVersion.LibGit2Sharp/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.LibGit2Sharp/RepositoryExtensions.cs b/src/GitVersion.LibGit2Sharp/RepositoryExtensions.cs deleted file mode 100644 index c0687802f6..0000000000 --- a/src/GitVersion.LibGit2Sharp/RepositoryExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using LibGit2Sharp; -using Microsoft.Extensions.Options; - -namespace GitVersion; - -public static class RepositoryExtensions -{ - public static IGitRepository ToGitRepository(this IRepository repository) => new GitRepository(repository); - public static IGitRepositoryInfo ToGitRepositoryInfo(IOptions options) => new GitRepositoryInfo(options); - - public static void RunSafe(Action operation) - { - try - { - operation(); - } - catch (LibGit2Sharp.LockedFileException ex) - { - // Wrap this exception so that callers that want to catch it don't need to take a dependency on LibGit2Sharp. - throw new LockedFileException(ex); - } - } - - public static T RunSafe(Func operation) - { - try - { - return operation(); - } - catch (LibGit2Sharp.LockedFileException ex) - { - // Wrap this exception so that callers that want to catch it don't need to take a dependency on LibGit2Sharp. - throw new LockedFileException(ex); - } - } -} diff --git a/src/GitVersion.MsBuild.Tests/AssemblyInfoFileHelperTests.cs b/src/GitVersion.MsBuild.Tests/AssemblyInfoFileHelperTests.cs new file mode 100644 index 0000000000..ddb4139b33 --- /dev/null +++ b/src/GitVersion.MsBuild.Tests/AssemblyInfoFileHelperTests.cs @@ -0,0 +1,46 @@ +namespace GitVersion.MsBuild.Tests; + +[TestFixture] +public class AssemblyInfoFileHelperTests +{ + [Test] + [TestCase("C#", "cs")] + [TestCase("F#", "fs")] + [TestCase("VB", "vb")] + [TestCase("XY", null)] + public void GetFileExtensionShouldReturnCorrectExtension(string language, string? expectedExtension) + { + if (expectedExtension != null) + { + Assert.That(AssemblyInfoFileHelper.GetFileExtension(language), Is.EqualTo(expectedExtension)); + } + else + { + Assert.That((TestDelegate)(() => AssemblyInfoFileHelper.GetFileExtension(language)), Throws.ArgumentException.With.Message.EqualTo($"Unknown language detected: '{language}'")); + } + } + + [Test] + public void GetFileWriteInfoShouldCreateConstantNamedFileWhenIntermediateOutputPath() + { + var fileInfo = "MyIntermediateOutputPath".GetFileWriteInfo("C#", "MyProject.csproj", "GeneratedVersionInformation"); + Assert.Multiple(() => + { + Assert.That(fileInfo.WorkingDirectory, Is.EqualTo("MyIntermediateOutputPath")); + Assert.That(fileInfo.FileName, Is.EqualTo("GeneratedVersionInformation.g.cs")); + Assert.That(fileInfo.FileExtension, Is.EqualTo("cs")); + }); + } + + [Test] + public void GetFileWriteInfoShouldCreateRandomNamedFileWhenNoIntermediateOutputPath() + { + var fileInfo = AssemblyInfoFileHelper.GetFileWriteInfo(null, "C#", "MyProject.csproj", "GeneratedVersionInformation"); + Assert.Multiple(() => + { + Assert.That(fileInfo.WorkingDirectory, Is.EqualTo(AssemblyInfoFileHelper.TempPath)); + Assert.That(fileInfo.FileName, Does.StartWith("GeneratedVersionInformation_MyProject_").And.EndsWith(".g.cs")); + Assert.That(fileInfo.FileExtension, Is.EqualTo("cs")); + }); + } +} diff --git a/src/GitVersion.MsBuild.Tests/FileHelperTests.cs b/src/GitVersion.MsBuild.Tests/FileHelperTests.cs deleted file mode 100644 index 704b66d194..0000000000 --- a/src/GitVersion.MsBuild.Tests/FileHelperTests.cs +++ /dev/null @@ -1,44 +0,0 @@ -using NUnit.Framework; - -namespace GitVersion.MsBuild.Tests; - -[TestFixture] -public class FileHelperTests -{ - [Test] - [TestCase("C#", "cs")] - [TestCase("F#", "fs")] - [TestCase("VB", "vb")] - [TestCase("XY", null)] - public void GetFileExtensionShouldReturnCorrectExtension(string language, string? expectedExtension) - { - if (expectedExtension != null) - { - Assert.That(FileHelper.GetFileExtension(language), Is.EqualTo(expectedExtension)); - } - else - { - Assert.That((TestDelegate)(() => FileHelper.GetFileExtension(language)), Throws.ArgumentException.With.Message.EqualTo($"Unknown language detected: '{language}'")); - } - } - - [Test] - public void GetFileWriteInfoShouldCreateConstantNamedFileWhenIntermediateOutputPath() - { - var fileInfo = "MyIntermediateOutputPath".GetFileWriteInfo("C#", "MyProject.csproj", "GeneratedVersionInformation"); - - Assert.That(fileInfo.WorkingDirectory, Is.EqualTo("MyIntermediateOutputPath")); - Assert.That(fileInfo.FileName, Is.EqualTo("GeneratedVersionInformation.g.cs")); - Assert.That(fileInfo.FileExtension, Is.EqualTo("cs")); - } - - [Test] - public void GetFileWriteInfoShouldCreateRandomNamedFileWhenNoIntermediateOutputPath() - { - var fileInfo = FileHelper.GetFileWriteInfo(null, "C#", "MyProject.csproj", "GeneratedVersionInformation"); - - Assert.That(fileInfo.WorkingDirectory, Is.EqualTo(FileHelper.TempPath)); - Assert.That(fileInfo.FileName, Does.StartWith("GeneratedVersionInformation_MyProject_").And.EndsWith(".g.cs")); - Assert.That(fileInfo.FileExtension, Is.EqualTo("cs")); - } -} diff --git a/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj b/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj index 26116dd703..50661ee216 100644 --- a/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj +++ b/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj @@ -1,49 +1,36 @@ - - net48;netcoreapp3.1;net5.0;net6.0 - - true - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + + diff --git a/src/GitVersion.MsBuild.Tests/Helpers/AssemblyParallelizable.cs b/src/GitVersion.MsBuild.Tests/Helpers/AssemblyParallelizable.cs index 9ae285d9ea..fdd365b7e2 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/AssemblyParallelizable.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/AssemblyParallelizable.cs @@ -1,3 +1 @@ -using NUnit.Framework; - [assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/src/GitVersion.MsBuild.Tests/Helpers/EventArgsFormatting.cs b/src/GitVersion.MsBuild.Tests/Helpers/EventArgsFormatting.cs index 5b6377e4bb..a0781dee3f 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/EventArgsFormatting.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/EventArgsFormatting.cs @@ -25,7 +25,7 @@ internal static string FormatEventMessage(BuildErrorEventArgs e) => /// a single string. /// /// Error to format - /// true to show the project file which issued the event, otherwise false. + /// true to show the project file which issued the event, otherwise false. /// The formatted message string. internal static string FormatEventMessage(BuildErrorEventArgs e, bool showProjectFile) => // "error" should not be localized @@ -50,7 +50,7 @@ internal static string FormatEventMessage(BuildWarningEventArgs e) => /// single string. /// /// Warning to format - /// true to show the project file which issued the event, otherwise false. + /// true to show the project file which issued the event, otherwise false. /// The formatted message string. internal static string FormatEventMessage(BuildWarningEventArgs e, bool showProjectFile) => // "warning" should not be localized @@ -140,7 +140,7 @@ int threadId { var format = new StringBuilder(); - // Uncomment these lines to show show the processor, if present. + // Uncomment these lines to show the processor, if present. /* if (threadId != 0) { @@ -148,7 +148,7 @@ int threadId } */ - if ((file == null) || (file.Length == 0)) + if (string.IsNullOrEmpty(file)) { format.Append("MSBUILD : "); // Should not be localized. } @@ -214,12 +214,12 @@ int threadId for (var i = 0; i < lines.Length; i++) { - formattedMessage.Append(string.Format( + formattedMessage.AppendFormat( CultureInfo.CurrentCulture, finalFormat, threadId, file, lineNumber, columnNumber, category, code, lines[i], endLineNumber, endColumnNumber, - subcategory, projectFile)); + subcategory, projectFile); if (i < (lines.Length - 1)) { @@ -230,7 +230,6 @@ int threadId return formattedMessage.ToString(); } - /// /// Splits strings on 'newLines' with tolerance for Everett and Dogfood builds. /// @@ -245,5 +244,5 @@ private static string[] SplitStringOnNewLines(string s) /// The kinds of newline breaks we expect. /// /// Currently we're not supporting "\r". - private static readonly string[] s_newLines = { "\r\n", "\n" }; + private static readonly string[] s_newLines = ["\r\n", "\n"]; } diff --git a/src/GitVersion.MsBuild.Tests/Helpers/GitToolsTestingExtensions.cs b/src/GitVersion.MsBuild.Tests/Helpers/GitRepositoryTestingExtensions.cs similarity index 85% rename from src/GitVersion.MsBuild.Tests/Helpers/GitToolsTestingExtensions.cs rename to src/GitVersion.MsBuild.Tests/Helpers/GitRepositoryTestingExtensions.cs index 1516c77043..068d0b0810 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/GitToolsTestingExtensions.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/GitRepositoryTestingExtensions.cs @@ -1,5 +1,4 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; using Microsoft.Extensions.DependencyInjection; @@ -7,7 +6,7 @@ namespace GitVersion.MsBuild.Tests.Helpers; -public static class GitToolsTestingExtensions +public static class GitRepositoryTestingExtensions { /// /// Simulates running on build server @@ -33,7 +32,7 @@ public static void InitializeRepo(this RemoteRepositoryFixture fixture) gitPreparer.Prepare(); } - private static IServiceProvider ConfigureServices(Action? servicesOverrides = null) + private static ServiceProvider ConfigureServices(Action? servicesOverrides = null) { var services = new ServiceCollection() .AddModule(new GitVersionCoreTestModule()); diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs index 6576f81e55..1d1c138d8c 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs @@ -1,14 +1,7 @@ using Buildalyzer; using Buildalyzer.Environment; -using GitTools.Testing; using GitVersion.Core.Tests; -using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; - -#if NET48 -using GitVersion.Extensions; -#endif - using Microsoft.Build.Framework; using Microsoft.Build.Logging; using Microsoft.Build.Utilities.ProjectCreation; @@ -27,12 +20,13 @@ public class MsBuildExeFixture private readonly AnalyzerManager manager = new(); private readonly string ProjectPath; - public MsBuildExeFixture(RepositoryFixtureBase fixture, string workingDirectory = "") + public MsBuildExeFixture(RepositoryFixtureBase fixture, string workingDirectory = "", string language = "C#") { + var projectExtension = AssemblyInfoFileHelper.GetProjectExtension(language); this.fixture = fixture; - this.ProjectPath = PathHelper.Combine(workingDirectory, "app.csproj"); + this.ProjectPath = FileSystemHelper.Path.Combine(workingDirectory, $"app.{projectExtension}"); - var versionFile = PathHelper.Combine(workingDirectory, "gitversion.json"); + var versionFile = FileSystemHelper.Path.Combine(workingDirectory, "gitversion.json"); fixture.WriteVersionVariables(versionFile); } @@ -52,7 +46,7 @@ public MsBuildExeFixtureResult Execute() { foreach (var (key, value) in this.environmentVariables) { - analyzer.SetEnvironmentVariable(key, value); + analyzer.SetEnvironmentVariable(key, value!); } } @@ -68,10 +62,7 @@ public MsBuildExeFixtureResult Execute() public void CreateTestProject(Action extendProject) { - var project = RuntimeHelper.IsCoreClr() - ? ProjectCreator.Templates.SdkCsproj(this.ProjectPath) - : ProjectCreator.Templates.LegacyCsproj(this.ProjectPath, targetFrameworkVersion: "v4.8", toolsVersion: "15.0"); - + var project = ProjectCreator.Templates.SdkCsproj(this.ProjectPath); extendProject(project); project.Save(); diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixtureResult.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixtureResult.cs index 7dcb21f890..02b7271a23 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixtureResult.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixtureResult.cs @@ -1,15 +1,11 @@ using Buildalyzer; -using GitTools.Testing; namespace GitVersion.MsBuild.Tests.Helpers; -public sealed class MsBuildExeFixtureResult : IDisposable +public sealed class MsBuildExeFixtureResult(IDisposable fixture) : IDisposable { - private readonly RepositoryFixtureBase fixture; - - public MsBuildExeFixtureResult(RepositoryFixtureBase fixture) => this.fixture = fixture; - public IAnalyzerResults MsBuild { get; set; } - public string Output { get; set; } - public string ProjectPath { get; set; } - public void Dispose() => this.fixture.Dispose(); + public IAnalyzerResults MsBuild { get; init; } + public string Output { get; init; } + public string ProjectPath { get; init; } + public void Dispose() => fixture.Dispose(); } diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs index ab66d452c4..3efac8d61d 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs @@ -1,23 +1,14 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using GitVersion.Agents; using GitVersion.Core.Tests; using GitVersion.Helpers; - -#if NET48 -using GitVersion.Extensions; -#endif - using GitVersion.MsBuild.Tests.Mocks; namespace GitVersion.MsBuild.Tests.Helpers; -public class MsBuildTaskFixture +public class MsBuildTaskFixture(RepositoryFixtureBase fixture) { - private readonly RepositoryFixtureBase fixture; private KeyValuePair[]? environmentVariables; - public MsBuildTaskFixture(RepositoryFixtureBase fixture) => this.fixture = fixture; - public void WithEnv(params KeyValuePair[] envs) => this.environmentVariables = envs; public MsBuildTaskFixtureResult Execute(T task) where T : GitVersionTaskBase => @@ -27,14 +18,14 @@ public MsBuildTaskFixtureResult Execute(T task) where T : GitVersionTaskBa task.BuildEngine = buildEngine; - var versionFile = PathHelper.Combine(task.SolutionDirectory, "gitversion.json"); - this.fixture.WriteVersionVariables(versionFile); + var versionFile = FileSystemHelper.Path.Combine(task.SolutionDirectory, "gitversion.json"); + fixture.WriteVersionVariables(versionFile); task.VersionFile = versionFile; - var result = task.Execute(); + var result = GitVersionTasks.Execute(task); - return new MsBuildTaskFixtureResult(this.fixture) + return new MsBuildTaskFixtureResult(fixture) { Success = result, Task = task, @@ -73,7 +64,7 @@ private static void ResetEnvironment() { SpaceAutomation.EnvironmentVariableName, null } }; - SetEnvironmentVariables(environmentalVariables.ToArray()); + SetEnvironmentVariables([.. environmentalVariables]); } private static void SetEnvironmentVariables(KeyValuePair[]? envs) @@ -81,7 +72,7 @@ private static void SetEnvironmentVariables(KeyValuePair[]? env if (envs == null) return; foreach (var (key, value) in envs) { - System.Environment.SetEnvironmentVariable(key, value); + SysEnv.SetEnvironmentVariable(key, value); } } } diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixtureResult.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixtureResult.cs index 5af70dfe20..e75a409360 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixtureResult.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixtureResult.cs @@ -1,21 +1,18 @@ -using GitTools.Testing; using Microsoft.Build.Framework; namespace GitVersion.MsBuild.Tests.Helpers; -public sealed class MsBuildTaskFixtureResult : IDisposable where T : ITask +public sealed class MsBuildTaskFixtureResult(IDisposable fixture) : IDisposable + where T : ITask { - private readonly RepositoryFixtureBase fixture; + public bool Success { get; init; } - public MsBuildTaskFixtureResult(RepositoryFixtureBase fixture) => this.fixture = fixture; - public bool Success { get; set; } + public T Task { get; init; } - public T Task { get; set; } - - public int Errors { get; set; } + public int Errors { get; init; } public int Warnings { get; set; } public int Messages { get; set; } - public string Log { get; set; } + public string Log { get; init; } - public void Dispose() => this.fixture.Dispose(); + public void Dispose() => fixture.Dispose(); } diff --git a/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs b/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs index c11ee3fa1c..3607471cd0 100644 --- a/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs +++ b/src/GitVersion.MsBuild.Tests/InvalidFileCheckerTests.cs @@ -1,9 +1,8 @@ +using System.IO.Abstractions; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.MsBuild.Tests.Mocks; -using Microsoft.Build.Framework; -using NUnit.Framework; -using Shouldly; +using Microsoft.Extensions.DependencyInjection; namespace GitVersion.MsBuild.Tests; @@ -12,51 +11,58 @@ public class InvalidFileCheckerTests : TestBase { private string projectDirectory; private string projectFile; + private IFileSystem fileSystem; [SetUp] public void CreateTemporaryProject() { - this.projectDirectory = PathHelper.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); - this.projectFile = PathHelper.Combine(this.projectDirectory, "Fake.csproj"); + var sp = ConfigureServices(); + this.fileSystem = sp.GetRequiredService(); + this.projectDirectory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), Guid.NewGuid().ToString()); + this.projectFile = FileSystemHelper.Path.Combine(this.projectDirectory, "Fake.csproj"); - Directory.CreateDirectory(this.projectDirectory); + this.fileSystem.Directory.CreateDirectory(this.projectDirectory); - File.Create(this.projectFile).Close(); + this.fileSystem.File.Create(this.projectFile).Close(); } [TearDown] - public void Cleanup() => Directory.Delete(this.projectDirectory, true); + public void Cleanup() => this.fileSystem.Directory.Delete(this.projectDirectory, true); [Test] public void VerifyIgnoreNonAssemblyInfoFile() { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "SomeOtherFile.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "SomeOtherthis.fileSystem.File.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" -[assembly: AssemblyVersion(""1.0.0.0"")] -"); + using System; + using System.Reflection; + + [assembly: AssemblyVersion("1.0.0.0")] + + """); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "SomeOtherFile.cs" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "SomeOtherthis.fileSystem.File.cs" }], this.projectFile); } [Test] public void VerifyAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" + + using System; + using System.Reflection; -[assembly:{0}(""1.0.0.0"")] -", attribute); + [assembly:{0}("1.0.0.0")] + + """, attribute); } - var ex = Assert.Throws(() => FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile), attribute); + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile), attribute); ex.ShouldNotBeNull(); Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs")); } @@ -64,18 +70,20 @@ public void VerifyAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileV [Test] public void VerifyUnformattedAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" + + using System; + using System.Reflection; + + [ assembly : + {0} ( "1.0.0.0")] -[ assembly : -{0} ( ""1.0.0.0"")] -", attribute); + """, attribute); } - var ex = Assert.Throws(() => FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile), attribute); + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile), attribute); ex.ShouldNotBeNull(); Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs")); } @@ -83,85 +91,95 @@ public void VerifyUnformattedAttributeFoundCSharp([Values("AssemblyVersion", "As [Test] public void VerifyCommentWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" -//[assembly: {0}(""1.0.0.0"")] -", attribute); + using System; + using System.Reflection; + + //[assembly: {0}("1.0.0.0")] + + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile); } [Test] public void VerifyCommentWithNoNewLineAtEndWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" + + using System; + using System.Reflection; -//[assembly: {0}(""1.0.0.0"")]", attribute); + //[assembly: {0}("1.0.0.0")] + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile); } [Test] public void VerifyStringWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" + + using System; + using System.Reflection; + + public class Temp + {{ + static const string Foo = "[assembly: {0}(""1.0.0.0"")]"; + }} -public class Temp -{{ - static const string Foo = ""[assembly: {0}(""""1.0.0.0"""")]""; -}} -", attribute); + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile); } [Test] public void VerifyIdentifierWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.cs"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.cs"))) { - writer.Write(@" -using System; -using System.Reflection; + writer.Write(""" -public class {0} -{{ -}} -", attribute); + using System; + using System.Reflection; + + public class {0} + {{ + }} + + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.cs" }], this.projectFile); } [Test] public void VerifyAttributeFoundVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" + + Imports System + Imports System.Reflection - -", attribute); + + + """, attribute); } - var ex = Assert.Throws(() => FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile), attribute); + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile), attribute); ex.ShouldNotBeNull(); Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb")); } @@ -169,18 +187,20 @@ Imports System.Reflection [Test] public void VerifyUnformattedAttributeFoundVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" + + Imports System + Imports System.Reflection + + < Assembly : + {0} ( "1.0.0.0")> -< Assembly : -{0} ( ""1.0.0.0"")> -", attribute); + """, attribute); } - var ex = Assert.Throws(() => FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile), attribute); + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile), attribute); ex.ShouldNotBeNull(); Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb")); } @@ -188,66 +208,187 @@ Imports System.Reflection [Test] public void VerifyCommentWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" -' -", attribute); + Imports System + Imports System.Reflection + + ' + + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile); } [Test] public void VerifyCommentWithNoNewLineAtEndWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" + + Imports System + Imports System.Reflection -'", attribute); + ' + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile); } [Test] public void VerifyStringWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" + + Imports System + Imports System.Reflection + + Public Class Temp + static const string Foo = ""; + End Class -Public Class Temp - static const string Foo = """"; -End Class -", attribute); + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile); } [Test] public void VerifyIdentifierWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) { - using (var writer = File.CreateText(PathHelper.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.vb"))) + { + writer.Write(""" + + Imports System + Imports System.Reflection + + Public Class {0} + End Class + + """, attribute); + } + + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.vb" }], this.projectFile); + } + + [Test] + public void VerifyAttributeFoundFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) + { + writer.Write(""" + + open System + open System.Reflection + + [] + + """, attribute); + } + + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile), attribute); + ex.ShouldNotBeNull(); + Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.fs")); + } + + [Test] + public void VerifyUnformattedAttributeFoundFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) { - writer.Write(@" -Imports System -Imports System.Reflection + writer.Write(""" + + open System + open System.Reflection + + [< assembly : + {0} ( "1.0.0.0")>] + + """, attribute); + } + + var ex = Assert.Throws(() => AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile), attribute); + ex.ShouldNotBeNull(); + Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.fs")); + } + + [Test] + public void VerifyCommentWorksFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) + { + writer.Write(""" + + open System + open System.Reflection + + //[] + + """, attribute); + } + + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile); + } + + [Test] + public void VerifyCommentWithNoNewLineAtEndWorksFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) + { + writer.Write(""" + + open System + open System.Reflection + + //[] + """, attribute); + } + + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile); + } + + [Test] + public void VerifyStringWorksFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) + { + writer.Write(""" + + open System + open System.Reflection + + type Temp() = + static let Foo = "[]" + + """, attribute); + } + + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile); + } + + [Test] + public void VerifyIdentifierWorksFSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")] string attribute) + { + using (var writer = this.fileSystem.File.CreateText(FileSystemHelper.Path.Combine(this.projectDirectory, "AssemblyInfo.fs"))) + { + writer.Write(""" + + open System + open System.Reflection + + type {0}() = class end -Public Class {0} -End Class -", attribute); + """, attribute); } - FileHelper.CheckForInvalidFiles(new ITaskItem[] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } }, this.projectFile); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, [new MockTaskItem { ItemSpec = "AssemblyInfo.fs" }], this.projectFile); } } diff --git a/src/GitVersion.MsBuild.Tests/Mocks/MockEngine.cs b/src/GitVersion.MsBuild.Tests/Mocks/MockEngine.cs index bd60d73fec..6e6a5671ed 100644 --- a/src/GitVersion.MsBuild.Tests/Mocks/MockEngine.cs +++ b/src/GitVersion.MsBuild.Tests/Mocks/MockEngine.cs @@ -1,7 +1,6 @@ using System.Collections.Concurrent; using GitVersion.MsBuild.Tests.Helpers; using Microsoft.Build.Framework; -using Shouldly; namespace GitVersion.MsBuild.Tests.Mocks; @@ -71,7 +70,7 @@ public string Log /// /// Assert that the log file contains the given string. - /// Case insensitive. + /// Case-insensitive. /// /// internal void AssertLogContains(string contains) => Log.ShouldContain(contains); @@ -91,7 +90,6 @@ public bool BuildProjectFilesInParallel( bool useResultsCache, bool unloadProjectsOnCompletion) => false; - public BuildEngineResult BuildProjectFilesInParallel( string[] projectFileNames, string[] targetNames, diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs index 7d6f7b81b8..5119afdb0f 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs @@ -4,61 +4,71 @@ using GitVersion.OutputVariables; using Microsoft.Build.Framework; using Microsoft.Build.Utilities.ProjectCreation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.MsBuild.Tests.Tasks; [TestFixture] public class GenerateGitVersionInformationTest : TestTaskBase { - [Test] - public void GenerateGitVersionInformationTaskShouldCreateFile() + private const string regexPattern = """.*{0}.*=.*"{1}".*"""; + private static readonly object[] Languages = + [ + new object[] { "C#" }, + new object[] { "F#" }, + new object[] { "VB" } + ]; + + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFile(string language) { - var task = new GenerateGitVersionInformation(); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation { Language = language }; using var result = ExecuteMsBuildTask(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); - - var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); } - [Test] - public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServer() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServer(string language) { - var task = new GenerateGitVersionInformation(); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation { Language = language }; using var result = ExecuteMsBuildTaskInAzurePipeline(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); - - var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "0")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild(string language) { const string taskName = nameof(GenerateGitVersionInformation); const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); - using var result = ExecuteMsBuildExe(project => AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty)); + using var result = ExecuteMsBuildExe(project => + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language), language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -66,26 +76,26 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild( result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), "GitVersionInformation.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), $"GitVersionInformation.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildInBuildServer() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildInBuildServer(string language) { const string taskName = nameof(GenerateGitVersionInformation); const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty)); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language), language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -93,65 +103,136 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildI result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), "GitVersionInformation.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), $"GitVersionInformation.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "0")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); } - [Test] - public void GenerateGitVersionInformationTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExist() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExist(string language) { - var task = new GenerateGitVersionInformation { IntermediateOutputPath = Guid.NewGuid().ToString("N") }; + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation { Language = language, IntermediateOutputPath = Guid.NewGuid().ToString("N") }; using var result = ExecuteMsBuildTask(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); - - var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + FileSystemHelper.Directory.DeleteDirectory(task.IntermediateOutputPath); } - [Test] - public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServerWhenIntermediateOutputPathDoesNotExist() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServerWhenIntermediateOutputPathDoesNotExist(string language) { - var task = new GenerateGitVersionInformation { IntermediateOutputPath = Guid.NewGuid().ToString("N") }; + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation { Language = language, IntermediateOutputPath = Guid.NewGuid().ToString("N") }; using var result = ExecuteMsBuildTaskInAzurePipeline(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "0")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); + FileSystemHelper.Directory.DeleteDirectory(task.IntermediateOutputPath); + } + + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExist(string language) + { + const string taskName = nameof(GenerateGitVersionInformation); + const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); + var randDir = Guid.NewGuid().ToString("N"); + + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExe(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath); + }, language); + + result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); + result.MsBuild.Count.ShouldBeGreaterThan(0); + result.MsBuild.OverallSuccess.ShouldBe(true); + result.MsBuild.ShouldAllBe(x => x.Succeeded); + result.Output.ShouldNotBeNullOrWhiteSpace(); + + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"GitVersionInformation.g.{extension}"); + result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); + + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + } + + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExistInBuildServer(string language) + { + const string taskName = nameof(GenerateGitVersionInformation); + const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); + var randDir = Guid.NewGuid().ToString("N"); + + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath); + }, language); - var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); + result.MsBuild.Count.ShouldBeGreaterThan(0); + result.MsBuild.OverallSuccess.ShouldBe(true); + result.MsBuild.ShouldAllBe(x => x.Succeeded); + result.Output.ShouldNotBeNullOrWhiteSpace(); + + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"GitVersionInformation.g.{extension}"); + result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); + + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "0")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExist() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUseProjectNamespaceIsSpecifiedAndRootNamespaceIsSet(string language) { const string taskName = nameof(GenerateGitVersionInformation); const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); var randDir = Guid.NewGuid().ToString("N"); - using var result = ExecuteMsBuildExe(project => AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, Path.Combine("$(MSBuildProjectDirectory)", randDir))); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExe(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("UseProjectNamespaceForGitVersionInformation", "True").Property("RootNamespace", "Test.Root"); + }, language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -159,27 +240,32 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), randDir, "GitVersionInformation.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"GitVersionInformation.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + TestContext.Out.WriteLine(fileContent); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + fileContent.ShouldContain("namespace Test.Root"); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExistInBuildServer() + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildAndUseProjectNamespaceIsSpecifiedAndRootNamespaceIsNotSet(string language) { const string taskName = nameof(GenerateGitVersionInformation); const string outputProperty = nameof(GenerateGitVersionInformation.GitVersionInformationFilePath); var randDir = Guid.NewGuid().ToString("N"); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, Path.Combine("$(MSBuildProjectDirectory)", randDir))); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddGenerateGitVersionInformationTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath).Property("UseProjectNamespaceForGitVersionInformation", "True"); + }, language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -187,30 +273,91 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), randDir, "GitVersionInformation.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"GitVersionInformation.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "0")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.0.1-1")); + fileContent.ShouldContain("namespace App"); + } + + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWithUseProjectNamespaceSetAndRootNamespaceUnSet(string language) + { + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation + { + Language = language, + UseProjectNamespaceForGitVersionInformation = "true", + ProjectFile = "App.Project.csproj" + }; + using var result = ExecuteMsBuildTask(task); + + result.Success.ShouldBe(true); + result.Errors.ShouldBe(0); + result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + fileContent.ShouldContain("namespace App.Project"); + } + + [TestCaseSource(nameof(Languages))] + public void GenerateGitVersionInformationTaskShouldCreateFileWithUseProjectNamespaceSetAndRootNamespaceIsSet(string language) + { + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new GenerateGitVersionInformation + { + Language = language, + UseProjectNamespaceForGitVersionInformation = "true", + ProjectFile = "App.Project.csproj", + RootNamespace = "App.Project.RootNamespace" + }; + using var result = ExecuteMsBuildTask(task); + + result.Success.ShouldBe(true); + result.Errors.ShouldBe(0); + result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); + result.Task.GitVersionInformationFilePath.ShouldMatch($@"GitVersionInformation.*\.g\.{extension}"); + + var fileContent = this.FileSystem.File.ReadAllText(result.Task.GitVersionInformationFilePath); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Major), "1")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Minor), "2")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.Patch), "4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")); + fileContent.ShouldMatch(string.Format(regexPattern, nameof(GitVersionVariables.FullSemVer), "1.2.4-1")); + + fileContent.ShouldContain("namespace App.Project.RootNamespace"); } - private static void AddGenerateGitVersionInformationTask(ProjectCreator project, string targetToRun, string taskName, string outputProperty, string intermediateOutputPath = "$(MSBuildProjectDirectory)") + private static ProjectCreator AddGenerateGitVersionInformationTask(ProjectCreator project, string targetToRun, string taskName, + string outputProperty, string language, + string intermediateOutputPath = "$(MSBuildProjectDirectory)") { var assemblyFileLocation = typeof(GitVersionTaskBase).Assembly.Location; - project.UsingTaskAssemblyFile(taskName, assemblyFileLocation) + return project.UsingTaskAssemblyFile(taskName, assemblyFileLocation) + .Property("ManagePackageVersionsCentrally", "false") .Property("GenerateAssemblyInfo", "false") + .Property("Language", language) .Target(targetToRun, beforeTargets: "CoreCompile;GetAssemblyVersion;GenerateNuspec") .Task(taskName, parameters: new Dictionary { { "SolutionDirectory", "$(MSBuildProjectDirectory)" }, { "VersionFile", "$(MSBuildProjectDirectory)/gitversion.json" }, { "ProjectFile", "$(MSBuildProjectFullPath)" }, + { "Language", "$(Language)" }, { "IntermediateOutputPath", intermediateOutputPath }, - { "Language", "$(Language)" } + { "UseProjectNamespaceForGitVersionInformation", "$(UseProjectNamespaceForGitVersionInformation)" }, + { "RootNamespace", "$(RootNamespace)" } }) .TaskOutputProperty(outputProperty, outputProperty) .ItemGroup() diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs index 4a53d4c505..2ca7282b1e 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs @@ -3,8 +3,6 @@ using GitVersion.OutputVariables; using Microsoft.Build.Framework; using Microsoft.Build.Utilities.ProjectCreation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.MsBuild.Tests.Tasks; @@ -16,10 +14,10 @@ public void OutputsShouldMatchVariableProvider() { var taskProperties = typeof(GetVersion) .GetProperties() - .Where(p => p.GetCustomAttributes(typeof(OutputAttribute), false).Any()) + .Where(p => p.GetCustomAttributes(typeof(OutputAttribute), false).Length != 0) .Select(p => p.Name); - var variablesProperties = VersionVariables.AvailableVariables; + var variablesProperties = GitVersionVariables.AvailableVariables; taskProperties.ShouldBe(variablesProperties, true); } @@ -37,7 +35,7 @@ public void GetVersionTaskShouldReturnVersionOutputVariables() result.Task.Minor.ShouldBe("2"); result.Task.Patch.ShouldBe("4"); result.Task.MajorMinorPatch.ShouldBe("1.2.4"); - result.Task.FullSemVer.ShouldBe("1.2.4+1"); + result.Task.FullSemVer.ShouldBe("1.2.4-1"); } [Test] @@ -53,16 +51,14 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesForBuildServer() result.Task.Minor.ShouldBe("0"); result.Task.Patch.ShouldBe("1"); result.Task.MajorMinorPatch.ShouldBe("1.0.1"); - result.Task.FullSemVer.ShouldBe("1.0.1+1"); + result.Task.FullSemVer.ShouldBe("1.0.1-1"); } - [TestCase(nameof(VersionVariables.Major), "1")] - [TestCase(nameof(VersionVariables.Minor), "2")] - [TestCase(nameof(VersionVariables.Patch), "4")] - [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.2.4")] - [TestCase(nameof(VersionVariables.FullSemVer), "1.2.4+1")] - [Category(NoNet48)] - [Category(NoMono)] + [TestCase(nameof(GitVersionVariables.Major), "1")] + [TestCase(nameof(GitVersionVariables.Minor), "2")] + [TestCase(nameof(GitVersionVariables.Patch), "4")] + [TestCase(nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")] + [TestCase(nameof(GitVersionVariables.FullSemVer), "1.2.4-1")] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(string outputProperty, string version) { const string taskName = nameof(GetVersion); @@ -77,18 +73,17 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(s result.Output.ShouldContain($"GitVersion_{outputProperty}: {version}"); } - [TestCase(nameof(VersionVariables.Major), "1")] - [TestCase(nameof(VersionVariables.Minor), "0")] - [TestCase(nameof(VersionVariables.Patch), "1")] - [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.0.1")] - [TestCase(nameof(VersionVariables.FullSemVer), "1.0.1+1")] - [Category(NoNet48)] - [Category(NoMono)] + [TestCase(nameof(GitVersionVariables.Major), "1")] + [TestCase(nameof(GitVersionVariables.Minor), "0")] + [TestCase(nameof(GitVersionVariables.Patch), "1")] + [TestCase(nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")] + [TestCase(nameof(GitVersionVariables.FullSemVer), "1.0.1-1")] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuildInBuildServer(string outputProperty, string version) { const string taskName = nameof(GetVersion); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddGetVersionTask(project, taskName, taskName, outputProperty)); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + AddGetVersionTask(project, taskName, taskName, outputProperty)); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); diff --git a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs index 53d826f351..c0c7999983 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs @@ -1,16 +1,26 @@ -using GitTools.Testing; -using GitVersion.BuildAgents; +using System.IO.Abstractions; +using GitVersion.Agents; using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.MsBuild.Tests.Helpers; using LibGit2Sharp; using Microsoft.Build.Utilities.ProjectCreation; +using Microsoft.Extensions.DependencyInjection; namespace GitVersion.MsBuild.Tests.Tasks; -public class TestTaskBase : TestBase +public abstract class TestTaskBase : TestBase { + protected IFileSystem FileSystem; + + [SetUp] + public void SetUp() + { + var sp = ConfigureServices(); + this.FileSystem = sp.GetRequiredService(); + } + private static readonly IDictionary env = new Dictionary { { AzurePipelines.EnvironmentVariableName, "true" }, @@ -21,37 +31,36 @@ protected static MsBuildTaskFixtureResult ExecuteMsBuildTask(T task) where { var fixture = CreateLocalRepositoryFixture(); task.SolutionDirectory = fixture.RepositoryPath; - var msbuildFixture = new MsBuildTaskFixture(fixture); var result = msbuildFixture.Execute(task); - if (result.Success == false) Console.WriteLine(result.Log); + if (!result.Success) Console.WriteLine(result.Log); return result; } - protected static MsBuildExeFixtureResult ExecuteMsBuildExe(Action extendProject) + protected static MsBuildExeFixtureResult ExecuteMsBuildExe(Action extendProject, string language = "C#") { var fixture = CreateLocalRepositoryFixture(); - var msbuildFixture = new MsBuildExeFixture(fixture, fixture.RepositoryPath); + var msbuildFixture = new MsBuildExeFixture(fixture, fixture.RepositoryPath, language); msbuildFixture.CreateTestProject(extendProject); var result = msbuildFixture.Execute(); - if (result.MsBuild.OverallSuccess == false) Console.WriteLine(result.Output); + if (!result.MsBuild.OverallSuccess) Console.WriteLine(result.Output); return result; } - protected static MsBuildTaskFixtureResult ExecuteMsBuildTaskInAzurePipeline(T task, string? buildNumber = null, string? configurationText = null) where T : GitVersionTaskBase + protected MsBuildTaskFixtureResult ExecuteMsBuildTaskInAzurePipeline(T task, string? buildNumber = null, string? configurationText = null) where T : GitVersionTaskBase { var fixture = CreateRemoteRepositoryFixture(); task.SolutionDirectory = fixture.LocalRepositoryFixture.RepositoryPath; var msbuildFixture = new MsBuildTaskFixture(fixture); - var environmentVariables = new List>(env.ToArray()); + var environmentVariables = env.ToList(); if (buildNumber != null) { - environmentVariables.Add(new KeyValuePair("BUILD_BUILDNUMBER", buildNumber)); + environmentVariables.Add(new("BUILD_BUILDNUMBER", buildNumber)); } - msbuildFixture.WithEnv(environmentVariables.ToArray()); + msbuildFixture.WithEnv([.. environmentVariables]); if (configurationText != null) { CreateConfiguration(task.SolutionDirectory, configurationText); @@ -59,36 +68,34 @@ protected static MsBuildTaskFixtureResult ExecuteMsBuildTaskInAzurePipeline ExecuteMsBuildTaskInGitHubActions(T task, string envFilePath) where T : GitVersionTaskBase + protected static MsBuildTaskFixtureResult ExecuteMsBuildTaskInGitHubActions(T task) where T : GitVersionTaskBase { var fixture = CreateRemoteRepositoryFixture(); task.SolutionDirectory = fixture.LocalRepositoryFixture.RepositoryPath; var msbuildFixture = new MsBuildTaskFixture(fixture); - msbuildFixture.WithEnv( - new KeyValuePair("GITHUB_ACTIONS", "true"), - new KeyValuePair("GITHUB_ENV", envFilePath) - ); + msbuildFixture.WithEnv(new KeyValuePair("GITHUB_ACTIONS", "true")); var result = msbuildFixture.Execute(task); - if (result.Success == false) + if (!result.Success) Console.WriteLine(result.Log); + return result; } - protected static MsBuildExeFixtureResult ExecuteMsBuildExeInAzurePipeline(Action extendProject) + protected static MsBuildExeFixtureResult ExecuteMsBuildExeInAzurePipeline(Action extendProject, string language = "C#") { var fixture = CreateRemoteRepositoryFixture(); - var msbuildFixture = new MsBuildExeFixture(fixture, fixture.LocalRepositoryFixture.RepositoryPath); + var msbuildFixture = new MsBuildExeFixture(fixture, fixture.LocalRepositoryFixture.RepositoryPath, language); msbuildFixture.CreateTestProject(extendProject); - msbuildFixture.WithEnv(env.ToArray()); + msbuildFixture.WithEnv([.. env]); var result = msbuildFixture.Execute(); - if (result.MsBuild.OverallSuccess == false) Console.WriteLine(result.Output); + if (!result.MsBuild.OverallSuccess) Console.WriteLine(result.Output); return result; } @@ -109,16 +116,16 @@ private static RemoteRepositoryFixture CreateRemoteRepositoryFixture() fixture.Repository.MakeACommit(); fixture.Repository.CreateBranch("develop"); - Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, Array.Empty(), new FetchOptions(), null); + Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.Repository.Head.Tip); fixture.LocalRepositoryFixture.Repository.Branches.Remove(MainBranch); fixture.InitializeRepo(); return fixture; } - private static void CreateConfiguration(string repoFolder, string content) + private void CreateConfiguration(string repoFolder, string content) { - var configFilePath = PathHelper.Combine(repoFolder, ConfigFileLocator.DefaultFileName); - File.WriteAllText(configFilePath, content); + var configFilePath = FileSystemHelper.Path.Combine(repoFolder, ConfigurationFileLocator.DefaultFileName); + this.FileSystem.File.WriteAllText(configFilePath, content); } } diff --git a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs index 4108b746f6..dd8c9f7ca7 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs @@ -3,53 +3,62 @@ using GitVersion.MsBuild.Tests.Helpers; using Microsoft.Build.Framework; using Microsoft.Build.Utilities.ProjectCreation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.MsBuild.Tests.Tasks; [TestFixture] public class UpdateAssemblyInfoTaskTest : TestTaskBase { - [Test] - public void UpdateAssemblyInfoTaskShouldCreateFile() + private static readonly object[] Languages = + [ + new object[] { "C#" }, + new object[] { "F#" }, + new object[] { "VB" } + ]; + + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFile(string language) { - var task = new UpdateAssemblyInfo(); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new UpdateAssemblyInfo { Language = language }; using var result = ExecuteMsBuildTask(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.AssemblyInfoTempFilePath.ShouldNotBeNull(); + result.Task.AssemblyInfoTempFilePath.ShouldMatch($@"AssemblyInfo.*\.g\.{extension}"); - var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.2.4.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(result.Task.AssemblyInfoTempFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.2.4.0")"""); } - [Test] - public void UpdateAssemblyInfoTaskShouldCreateFileInBuildServer() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileInBuildServer(string language) { - var task = new UpdateAssemblyInfo(); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new UpdateAssemblyInfo { Language = language }; using var result = ExecuteMsBuildTaskInAzurePipeline(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.AssemblyInfoTempFilePath.ShouldNotBeNull(); + result.Task.AssemblyInfoTempFilePath.ShouldMatch($@"AssemblyInfo.*\.g\.{extension}"); - var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.0.1.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(result.Task.AssemblyInfoTempFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.0.1.0")"""); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuild() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuild(string language) { const string taskName = nameof(UpdateAssemblyInfo); const string outputProperty = nameof(UpdateAssemblyInfo.AssemblyInfoTempFilePath); - using var result = ExecuteMsBuildExe(project => AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty)); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExe(project => + AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, language), language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -57,22 +66,22 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuild() result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), "AssemblyInfo.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), $"AssemblyInfo.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.2.4.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.2.4.0")"""); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildInBuildServer() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildInBuildServer(string language) { const string taskName = nameof(UpdateAssemblyInfo); const string outputProperty = nameof(UpdateAssemblyInfo.AssemblyInfoTempFilePath); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty)); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, language), language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -80,53 +89,62 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildInBuildServe result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), "AssemblyInfo.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), $"AssemblyInfo.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.0.1.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.0.1.0")"""); } - [Test] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExist() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExist(string language) { - var task = new UpdateAssemblyInfo { IntermediateOutputPath = Guid.NewGuid().ToString("N") }; + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new UpdateAssemblyInfo { Language = language, IntermediateOutputPath = Guid.NewGuid().ToString("N") }; using var result = ExecuteMsBuildTask(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.AssemblyInfoTempFilePath.ShouldNotBeNull(); + result.Task.AssemblyInfoTempFilePath.ShouldMatch($@"AssemblyInfo.*\.g\.{extension}"); - var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.2.4.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(result.Task.AssemblyInfoTempFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.2.4.0")"""); + FileSystemHelper.Directory.DeleteDirectory(task.IntermediateOutputPath); } - [Test] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExistInBuildServer() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenIntermediateOutputPathDoesNotExistInBuildServer(string language) { - var task = new UpdateAssemblyInfo { IntermediateOutputPath = Guid.NewGuid().ToString("N") }; + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + var task = new UpdateAssemblyInfo { Language = language, IntermediateOutputPath = Guid.NewGuid().ToString("N") }; using var result = ExecuteMsBuildTaskInAzurePipeline(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); result.Task.AssemblyInfoTempFilePath.ShouldNotBeNull(); + result.Task.AssemblyInfoTempFilePath.ShouldMatch($@"AssemblyInfo.*\.g\.{extension}"); - var fileContent = File.ReadAllText(result.Task.AssemblyInfoTempFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.0.1.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(result.Task.AssemblyInfoTempFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.0.1.0")"""); + FileSystemHelper.Directory.DeleteDirectory(task.IntermediateOutputPath); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExist() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExist(string language) { const string taskName = nameof(UpdateAssemblyInfo); const string outputProperty = nameof(UpdateAssemblyInfo.AssemblyInfoTempFilePath); var randDir = Guid.NewGuid().ToString("N"); - using var result = ExecuteMsBuildExe(project => AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, Path.Combine("$(MSBuildProjectDirectory)", randDir))); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExe(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath); + }, language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -134,23 +152,26 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermedi result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), randDir, "AssemblyInfo.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"AssemblyInfo.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.2.4.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.2.4.0")"""); } - [Test] - [Category(NoNet48)] - [Category(NoMono)] - public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExistInBuildServer() + [TestCaseSource(nameof(Languages))] + public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermediateOutputPathDoesNotExistInBuildServer(string language) { const string taskName = nameof(UpdateAssemblyInfo); const string outputProperty = nameof(UpdateAssemblyInfo.AssemblyInfoTempFilePath); var randDir = Guid.NewGuid().ToString("N"); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, Path.Combine("$(MSBuildProjectDirectory)", randDir))); + var extension = AssemblyInfoFileHelper.GetFileExtension(language); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + { + var intermediateOutputPath = FileSystemHelper.Path.Combine("$(MSBuildProjectDirectory)", randDir); + AddUpdateAssemblyInfoTask(project, taskName, taskName, outputProperty, language, intermediateOutputPath); + }, language); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); @@ -158,18 +179,22 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildAndIntermedi result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - var generatedFilePath = PathHelper.Combine(Path.GetDirectoryName(result.ProjectPath), randDir, "AssemblyInfo.g.cs"); + var generatedFilePath = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(result.ProjectPath), randDir, $"AssemblyInfo.g.{extension}"); result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); - var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain(@"[assembly: AssemblyVersion(""1.0.1.0"")]"); + var fileContent = this.FileSystem.File.ReadAllText(generatedFilePath); + fileContent.ShouldContain("""assembly: AssemblyVersion("1.0.1.0")"""); } - private static void AddUpdateAssemblyInfoTask(ProjectCreator project, string targetToRun, string taskName, string outputProperty, string intermediateOutputPath = "$(MSBuildProjectDirectory)") + private static void AddUpdateAssemblyInfoTask(ProjectCreator project, string targetToRun, string taskName, + string outputProperty, string language, + string intermediateOutputPath = "$(MSBuildProjectDirectory)") { var assemblyFileLocation = typeof(GitVersionTaskBase).Assembly.Location; project.UsingTaskAssemblyFile(taskName, assemblyFileLocation) + .Property("ManagePackageVersionsCentrally", "false") .Property("GenerateAssemblyInfo", "false") + .Property("Language", language) .Target(targetToRun, beforeTargets: "CoreCompile;GetAssemblyVersion;GenerateNuspec") .Task(taskName, parameters: new Dictionary { diff --git a/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs index 6210c5b768..ef7900cd0a 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs @@ -1,25 +1,13 @@ +using GitVersion.Helpers; using GitVersion.MsBuild.Tasks; using GitVersion.MsBuild.Tests.Helpers; using Microsoft.Build.Utilities.ProjectCreation; -using NUnit.Framework; -using Shouldly; namespace GitVersion.MsBuild.Tests.Tasks; [TestFixture] public class WriteVersionInfoTest : TestTaskBase { - private string GitHubEnvFilePath { get; set; } = Path.GetTempFileName(); - - [OneTimeTearDown] - public void OneTimeTearDown() - { - if (File.Exists(GitHubEnvFilePath)) - { - File.Delete(GitHubEnvFilePath); - } - } - [Test] public void WriteVersionInfoTaskShouldNotLogOutputVariablesToBuildOutput() { @@ -41,10 +29,9 @@ public void WriteVersionInfoTaskShouldLogOutputVariablesToBuildOutputInAzurePipe result.Success.ShouldBe(true); result.Errors.ShouldBe(0); - result.Log.ShouldContain("##vso[task.setvariable variable=GitVersion.FullSemVer]1.0.1+1"); + result.Log.ShouldContain("##vso[task.setvariable variable=GitVersion.FullSemVer]1.0.1-1"); } - [TestCase("2021-02-14.1")] public void WriteVersionInfoTaskShouldNotUpdateBuildNumberInAzurePipeline(string buildNumber) { @@ -58,12 +45,11 @@ public void WriteVersionInfoTaskShouldNotUpdateBuildNumberInAzurePipeline(string result.Log.ShouldNotContain("##vso[build.updatebuildnumber]"); } - - [TestCase("2021-02-14.1-$(GITVERSION.FullSemVer)", "2021-02-14.1-1.0.1+1", Ignore = "#2552 - GitVersion.MsBuild does not set Azure DevOps build number")] - [TestCase("2021-02-14.1-$(GITVERSION.SemVer)", "2021-02-14.1-1.0.1", Ignore = "#2552 - GitVersion.MsBuild does not set Azure DevOps build number")] - [TestCase("2021-02-14.1-$(GITVERSION.minor)", "2021-02-14.1-0", Ignore = "#2552 - GitVersion.MsBuild does not set Azure DevOps build number")] - [TestCase("2021-02-14.1-$(GITVERSION_MAJOR)", "2021-02-14.1-1", Ignore = "#2552 - GitVersion.MsBuild does not set Azure DevOps build number")] - [TestCase("2021-02-14.1", "1.0.1+1", Ignore = "#2552 - GitVersion.MsBuild does not set Azure DevOps build number")] + [TestCase("2021-02-14.1-$(GITVERSION.FullSemVer)", "2021-02-14.1-1.0.1-1")] + [TestCase("2021-02-14.1-$(GITVERSION.SemVer)", "2021-02-14.1-1.0.1")] + [TestCase("2021-02-14.1-$(GITVERSION.minor)", "2021-02-14.1-0")] + [TestCase("2021-02-14.1-$(GITVERSION_MAJOR)", "2021-02-14.1-1")] + [TestCase("2021-02-14.1", "1.0.1-1")] public void WriteVersionInfoTaskShouldUpdateBuildNumberInAzurePipeline(string buildNumber, string expected) { var task = new WriteVersionInfoToBuildLog(); @@ -78,19 +64,30 @@ public void WriteVersionInfoTaskShouldUpdateBuildNumberInAzurePipeline(string bu [Test] public void WriteVersionInfoTaskShouldLogOutputVariablesToBuildOutputInGitHubActions() { + var envFilePath = SysEnv.GetEnvironmentVariable("GITHUB_ENV"); + if (!string.IsNullOrWhiteSpace(envFilePath)) + { + Assert.Pass("This test should be ignored when running on GitHub Actions."); + return; + } + + envFilePath = $"{FileSystemHelper.Path.GetTempPath()}/github-env.txt"; + SysEnv.SetEnvironmentVariable("GITHUB_ENV", envFilePath); + var task = new WriteVersionInfoToBuildLog(); - using var result = ExecuteMsBuildTaskInGitHubActions(task, GitHubEnvFilePath); + using var result = ExecuteMsBuildTaskInGitHubActions(task); result.Success.ShouldBe(true); result.Errors.ShouldBe(0); - string content = File.ReadAllText(GitHubEnvFilePath); + + var content = this.FileSystem.File.ReadAllText(envFilePath); content.ShouldContain("GitVersion_SemVer=1.0.1"); + + this.FileSystem.File.Delete(envFilePath); } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void WriteVersionInfoTaskShouldNotLogOutputVariablesToBuildOutputWhenRunWithMsBuild() { const string taskName = nameof(WriteVersionInfoToBuildLog); @@ -106,20 +103,19 @@ public void WriteVersionInfoTaskShouldNotLogOutputVariablesToBuildOutputWhenRunW } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void WriteVersionInfoTaskShouldLogOutputVariablesToBuildOutputWhenRunWithMsBuildInAzurePipeline() { const string taskName = nameof(WriteVersionInfoToBuildLog); - using var result = ExecuteMsBuildExeInAzurePipeline(project => AddWriteVersionInfoToBuildLogTask(project, taskName, taskName)); + using var result = ExecuteMsBuildExeInAzurePipeline(project => + AddWriteVersionInfoToBuildLogTask(project, taskName, taskName)); result.ProjectPath.ShouldNotBeNullOrWhiteSpace(); result.MsBuild.Count.ShouldBeGreaterThan(0); result.MsBuild.OverallSuccess.ShouldBe(true); result.MsBuild.ShouldAllBe(x => x.Succeeded); result.Output.ShouldNotBeNullOrWhiteSpace(); - result.Output.ShouldContain("##vso[task.setvariable variable=GitVersion.FullSemVer]1.0.1+1"); + result.Output.ShouldContain("##vso[task.setvariable variable=GitVersion.FullSemVer]1.0.1-1"); } private static void AddWriteVersionInfoToBuildLogTask(ProjectCreator project, string targetToRun, string taskName) diff --git a/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj b/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj index 016c11a751..2de6d91a22 100644 --- a/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj +++ b/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj @@ -1,8 +1,6 @@ - netstandard2.0 - GitVersion.MsBuild GitVersionMsBuild 0.0.1-alpha-0001 @@ -10,24 +8,39 @@ false true true + + bin/$(Configuration) + ../GitVersion.App/$(BinPath) - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + + - + + + + + - + + + + + + + + + + + + diff --git a/src/GitVersion.MsBuild/GitVersionMsBuildModule.cs b/src/GitVersion.MsBuild/GitVersionMsBuildModule.cs new file mode 100644 index 0000000000..0d314115ca --- /dev/null +++ b/src/GitVersion.MsBuild/GitVersionMsBuildModule.cs @@ -0,0 +1,8 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.MsBuild; + +public class GitVersionMsBuildModule : IGitVersionModule +{ + public void RegisterTypes(IServiceCollection services) => services.AddSingleton(); +} diff --git a/src/GitVersion.MsBuild/GitVersionTaskBase.cs b/src/GitVersion.MsBuild/GitVersionTaskBase.cs index 4af337e7d7..a7fb78a9ac 100644 --- a/src/GitVersion.MsBuild/GitVersionTaskBase.cs +++ b/src/GitVersion.MsBuild/GitVersionTaskBase.cs @@ -8,7 +8,7 @@ public abstract class GitVersionTaskBase : ITask public IBuildEngine BuildEngine { get; set; } public ITaskHost HostObject { get; set; } - protected GitVersionTaskBase() => Log = new TaskLoggingHelper(this); + protected GitVersionTaskBase() => Log = new(this); [Required] public string SolutionDirectory { get; set; } @@ -17,7 +17,5 @@ public abstract class GitVersionTaskBase : ITask public TaskLoggingHelper Log { get; } - public bool Execute() => OnExecute(); - - protected abstract bool OnExecute(); + public bool Execute() => GitVersionTasks.Execute(this); } diff --git a/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs b/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs index 1f0e9dcebc..e0e3a0052f 100644 --- a/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs +++ b/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs @@ -1,3 +1,5 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.MsBuild.Tasks; @@ -6,22 +8,23 @@ namespace GitVersion.MsBuild; -public class GitVersionTaskExecutor : IGitVersionTaskExecutor +internal class GitVersionTaskExecutor( + IFileSystem fileSystem, + IGitVersionOutputTool gitVersionOutputTool, + IVersionVariableSerializer serializer, + IConfigurationProvider configurationProvider, + IOptions options) + : IGitVersionTaskExecutor { - private readonly IFileSystem fileSystem; - private readonly IGitVersionOutputTool gitVersionOutputTool; - private readonly IOptions options; - - public GitVersionTaskExecutor(IFileSystem fileSystem, IGitVersionOutputTool gitVersionOutputTool, IOptions options) - { - this.fileSystem = fileSystem.NotNull(); - this.gitVersionOutputTool = gitVersionOutputTool.NotNull(); - this.options = options.NotNull(); - } + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IGitVersionOutputTool gitVersionOutputTool = gitVersionOutputTool.NotNull(); + private readonly IVersionVariableSerializer serializer = serializer.NotNull(); + private readonly IConfigurationProvider configurationProvider = configurationProvider.NotNull(); + private readonly IOptions options = options.NotNull(); public void GetVersion(GetVersion task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = GitVersionVariables(task); var outputType = typeof(GetVersion); foreach (var (key, value) in versionVariables) { @@ -31,50 +34,77 @@ public void GetVersion(GetVersion task) public void UpdateAssemblyInfo(UpdateAssemblyInfo task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); - FileHelper.DeleteTempFiles(); - FileHelper.CheckForInvalidFiles(task.CompileFiles, task.ProjectFile); + var versionVariables = GitVersionVariables(task); + AssemblyInfoFileHelper.CheckForInvalidFiles(this.fileSystem, task.CompileFiles, task.ProjectFile); if (!string.IsNullOrEmpty(task.IntermediateOutputPath)) { // Ensure provided output path exists first. Fixes issue #2815. - fileSystem.CreateDirectory(task.IntermediateOutputPath); + fileSystem.Directory.CreateDirectory(task.IntermediateOutputPath); } var fileWriteInfo = task.IntermediateOutputPath.GetFileWriteInfo(task.Language, task.ProjectFile, "AssemblyInfo"); - task.AssemblyInfoTempFilePath = PathHelper.Combine(fileWriteInfo.WorkingDirectory, fileWriteInfo.FileName); + task.AssemblyInfoTempFilePath = FileSystemHelper.Path.Combine(fileWriteInfo.WorkingDirectory, fileWriteInfo.FileName); + if (!this.fileSystem.Directory.Exists(fileWriteInfo.WorkingDirectory)) + { + this.fileSystem.Directory.CreateDirectory(fileWriteInfo.WorkingDirectory); + } var gitVersionOptions = this.options.Value; - gitVersionOptions.AssemblyInfo.UpdateAssemblyInfo = true; - gitVersionOptions.AssemblyInfo.EnsureAssemblyInfo = true; gitVersionOptions.WorkingDirectory = fileWriteInfo.WorkingDirectory; - gitVersionOptions.AssemblyInfo.Files.Add(fileWriteInfo.FileName); + gitVersionOptions.AssemblySettingsInfo.UpdateAssemblyInfo = true; + gitVersionOptions.AssemblySettingsInfo.EnsureAssemblyInfo = true; + gitVersionOptions.AssemblySettingsInfo.Files.Add(fileWriteInfo.FileName); gitVersionOutputTool.UpdateAssemblyInfo(versionVariables); } public void GenerateGitVersionInformation(GenerateGitVersionInformation task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = GitVersionVariables(task); if (!string.IsNullOrEmpty(task.IntermediateOutputPath)) { // Ensure provided output path exists first. Fixes issue #2815. - fileSystem.CreateDirectory(task.IntermediateOutputPath); + fileSystem.Directory.CreateDirectory(task.IntermediateOutputPath); } var fileWriteInfo = task.IntermediateOutputPath.GetFileWriteInfo(task.Language, task.ProjectFile, "GitVersionInformation"); - task.GitVersionInformationFilePath = PathHelper.Combine(fileWriteInfo.WorkingDirectory, fileWriteInfo.FileName); + task.GitVersionInformationFilePath = FileSystemHelper.Path.Combine(fileWriteInfo.WorkingDirectory, fileWriteInfo.FileName); + if (!this.fileSystem.Directory.Exists(fileWriteInfo.WorkingDirectory)) + { + this.fileSystem.Directory.CreateDirectory(fileWriteInfo.WorkingDirectory); + } var gitVersionOptions = this.options.Value; gitVersionOptions.WorkingDirectory = fileWriteInfo.WorkingDirectory; + var targetNamespace = GetTargetNamespace(task); + gitVersionOutputTool.GenerateGitVersionInformation(versionVariables, fileWriteInfo, targetNamespace); + return; - gitVersionOutputTool.GenerateGitVersionInformation(versionVariables, fileWriteInfo); + static string? GetTargetNamespace(GenerateGitVersionInformation task) + { + string? targetNamespace = null; + if (!bool.TryParse(task.UseProjectNamespaceForGitVersionInformation, out var useTargetPathAsRootNamespace) || !useTargetPathAsRootNamespace) return targetNamespace; + targetNamespace = task.RootNamespace; + if (string.IsNullOrWhiteSpace(targetNamespace)) + { + targetNamespace = FileSystemHelper.Path.GetFileNameWithoutExtension(task.ProjectFile); + } + + return targetNamespace; + } } public void WriteVersionInfoToBuildLog(WriteVersionInfoToBuildLog task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); - gitVersionOutputTool.OutputVariables(versionVariables, false); + var versionVariables = GitVersionVariables(task); + + var gitVersionOptions = this.options.Value; + var configuration = this.configurationProvider.Provide(gitVersionOptions.ConfigurationInfo.OverrideConfiguration); + + gitVersionOutputTool.OutputVariables(versionVariables, configuration.UpdateBuildNumber); } + + private GitVersionVariables GitVersionVariables(GitVersionTaskBase task) => serializer.FromFile(task.VersionFile); } diff --git a/src/GitVersion.MsBuild/GitVersionTaskModule.cs b/src/GitVersion.MsBuild/GitVersionTaskModule.cs deleted file mode 100644 index 7d334c14a4..0000000000 --- a/src/GitVersion.MsBuild/GitVersionTaskModule.cs +++ /dev/null @@ -1,34 +0,0 @@ -using GitVersion.BuildAgents; -using GitVersion.Extensions; -using GitVersion.Logging; -using GitVersion.VersionConverters.AssemblyInfo; -using GitVersion.VersionConverters.GitVersionInfo; -using GitVersion.VersionConverters.OutputGenerator; -using GitVersion.VersionConverters.WixUpdater; -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion.MsBuild; - -public class GitVersionTaskModule : IGitVersionModule -{ - public void RegisterTypes(IServiceCollection services) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - services.AddSingleton(); - - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - services.AddSingleton(); - services.AddModule(new BuildServerModule()); - services.AddSingleton(sp => sp.GetRequiredService().Resolve()); - } -} diff --git a/src/GitVersion.MsBuild/GitVersionTasks.cs b/src/GitVersion.MsBuild/GitVersionTasks.cs index 577ab6c65d..d0860b20e9 100644 --- a/src/GitVersion.MsBuild/GitVersionTasks.cs +++ b/src/GitVersion.MsBuild/GitVersionTasks.cs @@ -1,33 +1,37 @@ -using GitVersion.BuildAgents; +using GitVersion.Agents; +using GitVersion.Configuration; using GitVersion.Extensions; using GitVersion.Logging; -using GitVersion.Model; using GitVersion.MsBuild.Tasks; +using GitVersion.Output; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; namespace GitVersion.MsBuild; -public static class GitVersionTasks +internal static class GitVersionTasks { - public static bool GetVersion(GetVersion task) => ExecuteGitVersionTask(task, executor => executor.GetVersion(task)); - - public static bool UpdateAssemblyInfo(UpdateAssemblyInfo task) => ExecuteGitVersionTask(task, executor => executor.UpdateAssemblyInfo(task)); - - public static bool GenerateGitVersionInformation(GenerateGitVersionInformation task) => ExecuteGitVersionTask(task, executor => executor.GenerateGitVersionInformation(task)); - - public static bool WriteVersionInfoToBuildLog(WriteVersionInfoToBuildLog task) => ExecuteGitVersionTask(task, executor => executor.WriteVersionInfoToBuildLog(task)); + public static bool Execute(GitVersionTaskBase task) + { + var serviceProvider = BuildServiceProvider(task); + var executor = serviceProvider.GetRequiredService(); + return task switch + { + GetVersion getVersion => ExecuteGitVersionTask(getVersion, () => executor.GetVersion(getVersion)), + UpdateAssemblyInfo updateAssemblyInfo => ExecuteGitVersionTask(updateAssemblyInfo, () => executor.UpdateAssemblyInfo(updateAssemblyInfo)), + GenerateGitVersionInformation generateGitVersionInformation => ExecuteGitVersionTask(generateGitVersionInformation, () => executor.GenerateGitVersionInformation(generateGitVersionInformation)), + WriteVersionInfoToBuildLog writeVersionInfoToBuildLog => ExecuteGitVersionTask(writeVersionInfoToBuildLog, () => executor.WriteVersionInfoToBuildLog(writeVersionInfoToBuildLog)), + _ => throw new NotSupportedException($"Task type {task.GetType().Name} is not supported") + }; + } - private static bool ExecuteGitVersionTask(T task, Action action) + private static bool ExecuteGitVersionTask(T task, Action action) where T : GitVersionTaskBase { var taskLog = task.Log; try { - var sp = BuildServiceProvider(task); - var gitVersionTaskExecutor = sp.GetRequiredService(); - - action(gitVersionTaskExecutor); + action(); } catch (WarningException errorException) { @@ -58,7 +62,7 @@ private static void Configure(IServiceProvider sp, GitVersionTaskBase task) gitVersionOptions.Settings.NoFetch = gitVersionOptions.Settings.NoFetch || buildAgent.PreventFetch(); } - private static IServiceProvider BuildServiceProvider(GitVersionTaskBase task) + private static ServiceProvider BuildServiceProvider(GitVersionTaskBase task) { var services = new ServiceCollection(); @@ -67,11 +71,12 @@ private static IServiceProvider BuildServiceProvider(GitVersionTaskBase task) WorkingDirectory = task.SolutionDirectory }; - gitVersionOptions.Output.Add(OutputType.BuildServer); - services.AddSingleton(Options.Create(gitVersionOptions)); - services.AddModule(new GitVersionTaskModule()); - + services.AddModule(new GitVersionConfigurationModule()); + services.AddModule(new GitVersionCoreModule()); + services.AddModule(new GitVersionBuildAgentsModule()); + services.AddModule(new GitVersionOutputModule()); + services.AddModule(new GitVersionMsBuildModule()); services.AddSingleton(new MsBuildAdapter(task.Log)); var sp = services.BuildServiceProvider(); diff --git a/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs b/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs new file mode 100644 index 0000000000..5f96caead6 --- /dev/null +++ b/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs @@ -0,0 +1,89 @@ +using System.IO.Abstractions; +using System.Text.RegularExpressions; +using GitVersion.Helpers; +using Microsoft.Build.Framework; + +using static GitVersion.Core.RegexPatterns.AssemblyVersion; + +namespace GitVersion.MsBuild; + +internal static class AssemblyInfoFileHelper +{ + public static readonly string TempPath = MakeAndGetTempPath(); + + private static string MakeAndGetTempPath() => FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "GitVersionTask"); + + public static string GetFileExtension(string language) => language switch + { + "C#" => "cs", + "F#" => "fs", + "VB" => "vb", + _ => throw new ArgumentException($"Unknown language detected: '{language}'") + }; + + public static string GetProjectExtension(string language) => language switch + { + "C#" => "csproj", + "F#" => "fsproj", + "VB" => "vbproj", + _ => throw new ArgumentException($"Unknown language detected: '{language}'") + }; + + public static void CheckForInvalidFiles(IFileSystem fileSystem, IEnumerable compileFiles, string projectFile) + { + var invalidCompileFile = GetInvalidFiles(fileSystem, compileFiles, projectFile).FirstOrDefault(); + if (invalidCompileFile != null) + { + throw new WarningException("File contains assembly version attributes which conflict with the attributes generated by GitVersion " + invalidCompileFile); + } + } + + private static bool FileContainsVersionAttribute(IFileSystem fileSystem, string compileFile, string projectFile) + { + var compileFileExtension = FileSystemHelper.Path.GetExtension(compileFile); + + var (attributeRegex, triviaRegex) = compileFileExtension switch + { + ".cs" => (CSharp.AttributeRegex(), CSharp.TriviaRegex()), + ".fs" => (FSharp.AttributeRegex(), FSharp.TriviaRegex()), + ".vb" => (VisualBasic.AttributeRegex(), VisualBasic.TriviaRegex()), + _ => throw new WarningException("File with name containing AssemblyInfo could not be checked for assembly version attributes which conflict with the attributes generated by GitVersion " + compileFile) + }; + + return FileContainsVersionAttribute(fileSystem, compileFile, projectFile, attributeRegex, triviaRegex); + } + + private static bool FileContainsVersionAttribute(IFileSystem fileSystem, string compileFile, string projectFile, Regex attributeRegex, Regex triviaRegex) + { + var combine = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetDirectoryName(projectFile), compileFile); + var allText = fileSystem.File.ReadAllText(combine); + allText += FileSystemHelper.Path.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. + + var noCommentsOrStrings = triviaRegex.Replace(allText, me => me.Value.StartsWith("//") || me.Value.StartsWith('\'') ? FileSystemHelper.Path.NewLine : string.Empty); + return attributeRegex.IsMatch(noCommentsOrStrings); + } + + private static IEnumerable GetInvalidFiles(IFileSystem fileSystem, IEnumerable compileFiles, string projectFile) + => compileFiles.Select(x => x.ItemSpec) + .Where(compileFile => compileFile.Contains("AssemblyInfo")) + .Where(filePath => FileContainsVersionAttribute(fileSystem, filePath, projectFile)); + + public static FileWriteInfo GetFileWriteInfo(this string? intermediateOutputPath, string language, string projectFile, string outputFileName) + { + var fileExtension = GetFileExtension(language); + string workingDirectory, fileName; + + if (intermediateOutputPath == null) + { + fileName = $"{outputFileName}_{FileSystemHelper.Path.GetFileNameWithoutExtension(projectFile)}_{FileSystemHelper.Path.GetRandomFileName()}.g.{fileExtension}"; + workingDirectory = TempPath; + } + else + { + fileName = $"{outputFileName}.g.{fileExtension}"; + workingDirectory = intermediateOutputPath; + } + + return new FileWriteInfo(workingDirectory, fileName, fileExtension); + } +} diff --git a/src/GitVersion.MsBuild/Helpers/FileHelper.cs b/src/GitVersion.MsBuild/Helpers/FileHelper.cs deleted file mode 100644 index dee009e256..0000000000 --- a/src/GitVersion.MsBuild/Helpers/FileHelper.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System.Text.RegularExpressions; -using GitVersion.Helpers; -using Microsoft.Build.Framework; - -namespace GitVersion.MsBuild; - -public static class FileHelper -{ - private static readonly Dictionary> VersionAttributeFinders = new() - { - { ".cs", CSharpFileContainsVersionAttribute }, - { ".vb", VisualBasicFileContainsVersionAttribute } - }; - - public static readonly string TempPath = MakeAndGetTempPath(); - - private static string MakeAndGetTempPath() - { - var tempPath = PathHelper.Combine(Path.GetTempPath(), "GitVersionTask"); - Directory.CreateDirectory(tempPath); - return tempPath; - } - - public static void DeleteTempFiles() - { - if (!Directory.Exists(TempPath)) - { - return; - } - - foreach (var file in Directory.GetFiles(TempPath)) - { - if (File.GetLastWriteTime(file) >= DateTime.Now.AddDays(-1)) - continue; - try - { - File.Delete(file); - } - catch (UnauthorizedAccessException) - { - //ignore contention - } - } - } - - public static string GetFileExtension(string language) => language switch - { - "C#" => "cs", - "F#" => "fs", - "VB" => "vb", - _ => throw new ArgumentException($"Unknown language detected: '{language}'") - }; - - public static void CheckForInvalidFiles(IEnumerable compileFiles, string projectFile) - { - if (GetInvalidFiles(compileFiles, projectFile).FirstOrDefault() is { } invalidCompileFile) - { - throw new WarningException("File contains assembly version attributes which conflict with the attributes generated by GitVersion " + invalidCompileFile); - } - } - - private static bool FileContainsVersionAttribute(string compileFile, string projectFile) - { - var compileFileExtension = Path.GetExtension(compileFile); - - if (VersionAttributeFinders.TryGetValue(compileFileExtension, out var languageSpecificFileContainsVersionAttribute)) - { - return languageSpecificFileContainsVersionAttribute(compileFile, projectFile); - } - - throw new WarningException("File with name containing AssemblyInfo could not be checked for assembly version attributes which conflict with the attributes generated by GitVersion " + compileFile); - } - - private static bool CSharpFileContainsVersionAttribute(string compileFile, string projectFile) - { - var combine = PathHelper.Combine(Path.GetDirectoryName(projectFile), compileFile); - var allText = File.ReadAllText(combine); - - allText += System.Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. - - const string blockComments = @"/\*(.*?)\*/"; - const string lineComments = @"//(.*?)\r?\n"; - const string strings = @"""((\\[^\n]|[^""\n])*)"""; - const string verbatimStrings = @"@(""[^""]*"")+"; - - var noCommentsOrStrings = Regex.Replace(allText, - blockComments + "|" + lineComments + "|" + strings + "|" + verbatimStrings, - me => me.Value.StartsWith("//") ? System.Environment.NewLine : string.Empty, - RegexOptions.Singleline); - - return Regex.IsMatch(noCommentsOrStrings, @"(?x) # IgnorePatternWhitespace - -\[\s*assembly\s*:\s* # The [assembly: part - -(System\s*\.\s*Reflection\s*\.\s*)? # The System.Reflection. part (optional) - -Assembly(File|Informational)?Version # The attribute AssemblyVersion, AssemblyFileVersion, or AssemblyInformationalVersion - -\s*\(\s*\)\s*\] # End brackets ()]"); - } - - private static bool VisualBasicFileContainsVersionAttribute(string compileFile, string projectFile) - { - var combine = PathHelper.Combine(Path.GetDirectoryName(projectFile), compileFile); - var allText = File.ReadAllText(combine); - - allText += System.Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. - - const string lineComments = @"'(.*?)\r?\n"; - const string strings = @"""((\\[^\n]|[^""\n])*)"""; - - var noCommentsOrStrings = Regex.Replace(allText, - lineComments + "|" + strings, - me => me.Value.StartsWith("'") ? System.Environment.NewLine : string.Empty, - RegexOptions.Singleline); - - return Regex.IsMatch(noCommentsOrStrings, @"(?x) # IgnorePatternWhitespace - -\<\s*Assembly\s*:\s* # The # End brackets ()>"); - } - - private static IEnumerable GetInvalidFiles(IEnumerable compileFiles, string projectFile) => compileFiles.Select(x => x.ItemSpec) - .Where(compileFile => compileFile.Contains("AssemblyInfo")) - .Where(s => FileContainsVersionAttribute(s, projectFile)); - - public static FileWriteInfo GetFileWriteInfo(this string? intermediateOutputPath, string language, string projectFile, string outputFileName) - { - var fileExtension = GetFileExtension(language); - string workingDirectory, fileName; - - if (intermediateOutputPath == null) - { - fileName = $"{outputFileName}_{Path.GetFileNameWithoutExtension(projectFile)}_{Path.GetRandomFileName()}.g.{fileExtension}"; - workingDirectory = TempPath; - } - else - { - fileName = $"{outputFileName}.g.{fileExtension}"; - workingDirectory = intermediateOutputPath; - } - return new FileWriteInfo(workingDirectory, fileName, fileExtension); - } -} diff --git a/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs b/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs index d3856d9859..2b676ed538 100644 --- a/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs +++ b/src/GitVersion.MsBuild/Helpers/MsBuildAdapter.cs @@ -1,23 +1,18 @@ +using GitVersion.Helpers; using GitVersion.Logging; using Microsoft.Build.Utilities; namespace GitVersion.MsBuild; -internal class MsBuildAdapter : IConsole +internal class MsBuildAdapter(TaskLoggingHelper taskLog) : IConsole { - private readonly TaskLoggingHelper taskLog; - - public MsBuildAdapter(TaskLoggingHelper taskLog) => this.taskLog = taskLog; - public void WriteLine(string? msg) { Write(msg); WriteLine(); } - public void WriteLine() => this.taskLog.LogMessage("\n"); - - public void Write(string? msg) => this.taskLog.LogMessage(msg); + public void Write(string? msg) => taskLog.LogMessage(msg); public string? ReadLine() => Console.ReadLine(); @@ -28,4 +23,6 @@ public IDisposable UseColor(ConsoleColor consoleColor) return Disposable.Create(() => Console.ForegroundColor = old); } + + private void WriteLine() => taskLog.LogMessage("\n"); } diff --git a/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs b/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs index 7c6d0fa103..166f4eb65d 100644 --- a/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs +++ b/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs @@ -1,21 +1,18 @@ +using GitVersion.Helpers; using GitVersion.Logging; using Microsoft.Build.Utilities; namespace GitVersion.MsBuild; -public class MsBuildAppender : ILogAppender +internal class MsBuildAppender(TaskLoggingHelper taskLog) : ILogAppender { - private readonly TaskLoggingHelper taskLog; - - public MsBuildAppender(TaskLoggingHelper taskLog) => this.taskLog = taskLog; - public void WriteTo(LogLevel level, string message) { try { WriteLogEntry(level, message); } - catch (Exception) + catch { // } @@ -23,20 +20,20 @@ public void WriteTo(LogLevel level, string message) private void WriteLogEntry(LogLevel level, string str) { - var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{System.Environment.NewLine}"; + var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{FileSystemHelper.Path.NewLine}"; switch (level) { case LogLevel.Fatal: case LogLevel.Error: - this.taskLog.LogError(contents); + taskLog.LogError(contents); break; case LogLevel.Warn: - this.taskLog.LogWarning(contents); + taskLog.LogWarning(contents); break; case LogLevel.Info: case LogLevel.Verbose: case LogLevel.Debug: - this.taskLog.LogMessage(contents); + taskLog.LogMessage(contents); break; default: throw new ArgumentOutOfRangeException(nameof(level), level, null); diff --git a/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs b/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs index 520496d583..9d27348723 100644 --- a/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs +++ b/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs @@ -2,7 +2,7 @@ namespace GitVersion.MsBuild; -public interface IGitVersionTaskExecutor +internal interface IGitVersionTaskExecutor { void GetVersion(GetVersion task); void UpdateAssemblyInfo(UpdateAssemblyInfo task); diff --git a/src/GitVersion.MsBuild/PublicAPI.Shipped.txt b/src/GitVersion.MsBuild/PublicAPI.Shipped.txt index 452c036fcc..000e4d9453 100644 --- a/src/GitVersion.MsBuild/PublicAPI.Shipped.txt +++ b/src/GitVersion.MsBuild/PublicAPI.Shipped.txt @@ -1,6 +1,7 @@ #nullable enable -abstract GitVersion.MsBuild.GitVersionTaskBase.OnExecute() -> bool -GitVersion.MsBuild.FileHelper +GitVersion.MsBuild.GitVersionMsBuildModule +GitVersion.MsBuild.GitVersionMsBuildModule.GitVersionMsBuildModule() -> void +GitVersion.MsBuild.GitVersionMsBuildModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.MsBuild.GitVersionTaskBase GitVersion.MsBuild.GitVersionTaskBase.BuildEngine.get -> Microsoft.Build.Framework.IBuildEngine! GitVersion.MsBuild.GitVersionTaskBase.BuildEngine.set -> void @@ -13,34 +14,15 @@ GitVersion.MsBuild.GitVersionTaskBase.SolutionDirectory.get -> string! GitVersion.MsBuild.GitVersionTaskBase.SolutionDirectory.set -> void GitVersion.MsBuild.GitVersionTaskBase.VersionFile.get -> string! GitVersion.MsBuild.GitVersionTaskBase.VersionFile.set -> void -GitVersion.MsBuild.GitVersionTaskExecutor -GitVersion.MsBuild.GitVersionTaskExecutor.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.GitVersionTaskExecutor(GitVersion.IFileSystem! fileSystem, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> void -GitVersion.MsBuild.GitVersionTaskModule -GitVersion.MsBuild.GitVersionTaskModule.GitVersionTaskModule() -> void -GitVersion.MsBuild.GitVersionTaskModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.MsBuild.GitVersionTasks -GitVersion.MsBuild.IGitVersionTaskExecutor -GitVersion.MsBuild.IGitVersionTaskExecutor.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> void -GitVersion.MsBuild.MsBuildAppender -GitVersion.MsBuild.MsBuildAppender.MsBuildAppender(Microsoft.Build.Utilities.TaskLoggingHelper! taskLog) -> void -GitVersion.MsBuild.MsBuildAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GenerateGitVersionInformation() -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GitVersionInformationFilePath.get -> string! GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GitVersionInformationFilePath.set -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.IntermediateOutputPath.get -> string! -GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.IntermediateOutputPath.set -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.Language.get -> string! -GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.Language.set -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.ProjectFile.get -> string! -GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.ProjectFile.set -> void +GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.RootNamespace.get -> string! +GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.UseProjectNamespaceForGitVersionInformation.get -> string? GitVersion.MsBuild.Tasks.GetVersion GitVersion.MsBuild.Tasks.GetVersion.AssemblySemFileVer.get -> string! GitVersion.MsBuild.Tasks.GetVersion.AssemblySemFileVer.set -> void @@ -50,14 +32,10 @@ GitVersion.MsBuild.Tasks.GetVersion.BranchName.get -> string! GitVersion.MsBuild.Tasks.GetVersion.BranchName.set -> void GitVersion.MsBuild.Tasks.GetVersion.BuildMetaData.get -> string! GitVersion.MsBuild.Tasks.GetVersion.BuildMetaData.set -> void -GitVersion.MsBuild.Tasks.GetVersion.BuildMetaDataPadded.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.BuildMetaDataPadded.set -> void GitVersion.MsBuild.Tasks.GetVersion.CommitDate.get -> string! GitVersion.MsBuild.Tasks.GetVersion.CommitDate.set -> void GitVersion.MsBuild.Tasks.GetVersion.CommitsSinceVersionSource.get -> string! GitVersion.MsBuild.Tasks.GetVersion.CommitsSinceVersionSource.set -> void -GitVersion.MsBuild.Tasks.GetVersion.CommitsSinceVersionSourcePadded.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.CommitsSinceVersionSourcePadded.set -> void GitVersion.MsBuild.Tasks.GetVersion.EscapedBranchName.get -> string! GitVersion.MsBuild.Tasks.GetVersion.EscapedBranchName.set -> void GitVersion.MsBuild.Tasks.GetVersion.FullBuildMetaData.get -> string! @@ -67,24 +45,12 @@ GitVersion.MsBuild.Tasks.GetVersion.FullSemVer.set -> void GitVersion.MsBuild.Tasks.GetVersion.GetVersion() -> void GitVersion.MsBuild.Tasks.GetVersion.InformationalVersion.get -> string! GitVersion.MsBuild.Tasks.GetVersion.InformationalVersion.set -> void -GitVersion.MsBuild.Tasks.GetVersion.LegacySemVer.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.LegacySemVer.set -> void -GitVersion.MsBuild.Tasks.GetVersion.LegacySemVerPadded.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.LegacySemVerPadded.set -> void GitVersion.MsBuild.Tasks.GetVersion.Major.get -> string! GitVersion.MsBuild.Tasks.GetVersion.Major.set -> void GitVersion.MsBuild.Tasks.GetVersion.MajorMinorPatch.get -> string! GitVersion.MsBuild.Tasks.GetVersion.MajorMinorPatch.set -> void GitVersion.MsBuild.Tasks.GetVersion.Minor.get -> string! GitVersion.MsBuild.Tasks.GetVersion.Minor.set -> void -GitVersion.MsBuild.Tasks.GetVersion.NuGetPreReleaseTag.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.NuGetPreReleaseTag.set -> void -GitVersion.MsBuild.Tasks.GetVersion.NuGetPreReleaseTagV2.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.NuGetPreReleaseTagV2.set -> void -GitVersion.MsBuild.Tasks.GetVersion.NuGetVersion.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.NuGetVersion.set -> void -GitVersion.MsBuild.Tasks.GetVersion.NuGetVersionV2.get -> string! -GitVersion.MsBuild.Tasks.GetVersion.NuGetVersionV2.set -> void GitVersion.MsBuild.Tasks.GetVersion.Patch.get -> string! GitVersion.MsBuild.Tasks.GetVersion.Patch.set -> void GitVersion.MsBuild.Tasks.GetVersion.PreReleaseLabel.get -> string! @@ -113,26 +79,9 @@ GitVersion.MsBuild.Tasks.UpdateAssemblyInfo GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.AssemblyInfoTempFilePath.get -> string! GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.AssemblyInfoTempFilePath.set -> void GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.CompileFiles.get -> Microsoft.Build.Framework.ITaskItem![]! -GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.CompileFiles.set -> void GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.IntermediateOutputPath.get -> string! -GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.IntermediateOutputPath.set -> void GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.Language.get -> string! -GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.Language.set -> void GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.ProjectFile.get -> string! -GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.ProjectFile.set -> void GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.UpdateAssemblyInfo() -> void GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog.WriteVersionInfoToBuildLog() -> void -override GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.OnExecute() -> bool -override GitVersion.MsBuild.Tasks.GetVersion.OnExecute() -> bool -override GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.OnExecute() -> bool -override GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog.OnExecute() -> bool -static GitVersion.MsBuild.FileHelper.CheckForInvalidFiles(System.Collections.Generic.IEnumerable! compileFiles, string! projectFile) -> void -static GitVersion.MsBuild.FileHelper.DeleteTempFiles() -> void -static GitVersion.MsBuild.FileHelper.GetFileExtension(string! language) -> string! -static GitVersion.MsBuild.FileHelper.GetFileWriteInfo(this string? intermediateOutputPath, string! language, string! projectFile, string! outputFileName) -> GitVersion.FileWriteInfo! -static GitVersion.MsBuild.GitVersionTasks.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> bool -static readonly GitVersion.MsBuild.FileHelper.TempPath -> string! diff --git a/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt b/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt +++ b/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.MsBuild/Tasks/GenerateGitVersionInformation.cs b/src/GitVersion.MsBuild/Tasks/GenerateGitVersionInformation.cs index ebebf91f66..93b4f5da23 100644 --- a/src/GitVersion.MsBuild/Tasks/GenerateGitVersionInformation.cs +++ b/src/GitVersion.MsBuild/Tasks/GenerateGitVersionInformation.cs @@ -5,17 +5,18 @@ namespace GitVersion.MsBuild.Tasks; public class GenerateGitVersionInformation : GitVersionTaskBase { [Required] - public string ProjectFile { get; set; } + public string ProjectFile { get; internal init; } [Required] - public string IntermediateOutputPath { get; set; } + public string IntermediateOutputPath { get; internal init; } [Required] - public string Language { get; set; } = "C#"; + public string Language { get; internal init; } = "C#"; - [Output] - public string GitVersionInformationFilePath { get; set; } + public string? UseProjectNamespaceForGitVersionInformation { get; internal init; } - protected override bool OnExecute() => GitVersionTasks.GenerateGitVersionInformation(this); + public string RootNamespace { get; internal init; } + [Output] + public string GitVersionInformationFilePath { get; set; } } diff --git a/src/GitVersion.MsBuild/Tasks/GetVersion.cs b/src/GitVersion.MsBuild/Tasks/GetVersion.cs index 74f56e2df5..2a3e695a99 100644 --- a/src/GitVersion.MsBuild/Tasks/GetVersion.cs +++ b/src/GitVersion.MsBuild/Tasks/GetVersion.cs @@ -34,9 +34,6 @@ public class GetVersion : GitVersionTaskBase [Output] public string BuildMetaData { get; set; } - [Output] - public string BuildMetaDataPadded { get; set; } - [Output] public string FullBuildMetaData { get; set; } @@ -46,12 +43,6 @@ public class GetVersion : GitVersionTaskBase [Output] public string SemVer { get; set; } - [Output] - public string LegacySemVer { get; set; } - - [Output] - public string LegacySemVerPadded { get; set; } - [Output] public string AssemblySemVer { get; set; } @@ -76,18 +67,6 @@ public class GetVersion : GitVersionTaskBase [Output] public string ShortSha { get; set; } - [Output] - public string NuGetVersionV2 { get; set; } - - [Output] - public string NuGetVersion { get; set; } - - [Output] - public string NuGetPreReleaseTagV2 { get; set; } - - [Output] - public string NuGetPreReleaseTag { get; set; } - [Output] public string CommitDate { get; set; } @@ -97,12 +76,6 @@ public class GetVersion : GitVersionTaskBase [Output] public string CommitsSinceVersionSource { get; set; } - [Output] - public string CommitsSinceVersionSourcePadded { get; set; } - - [Output] public string UncommittedChanges { get; set; } - - protected override bool OnExecute() => GitVersionTasks.GetVersion(this); } diff --git a/src/GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs b/src/GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs index 127ebbd1de..f95a5c1803 100644 --- a/src/GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs +++ b/src/GitVersion.MsBuild/Tasks/UpdateAssemblyInfo.cs @@ -5,19 +5,17 @@ namespace GitVersion.MsBuild.Tasks; public class UpdateAssemblyInfo : GitVersionTaskBase { [Required] - public string ProjectFile { get; set; } + public string ProjectFile { get; internal init; } [Required] - public string IntermediateOutputPath { get; set; } + public string IntermediateOutputPath { get; internal init; } [Required] - public ITaskItem[] CompileFiles { get; set; } = Array.Empty(); + public ITaskItem[] CompileFiles { get; internal init; } = []; [Required] - public string Language { get; set; } = "C#"; + public string Language { get; internal init; } = "C#"; [Output] public string AssemblyInfoTempFilePath { get; set; } - - protected override bool OnExecute() => GitVersionTasks.UpdateAssemblyInfo(this); } diff --git a/src/GitVersion.MsBuild/Tasks/WriteVersionInfoToBuildLog.cs b/src/GitVersion.MsBuild/Tasks/WriteVersionInfoToBuildLog.cs index b92f7dd187..3ee822c61e 100644 --- a/src/GitVersion.MsBuild/Tasks/WriteVersionInfoToBuildLog.cs +++ b/src/GitVersion.MsBuild/Tasks/WriteVersionInfoToBuildLog.cs @@ -1,6 +1,3 @@ namespace GitVersion.MsBuild.Tasks; -public class WriteVersionInfoToBuildLog : GitVersionTaskBase -{ - protected override bool OnExecute() => GitVersionTasks.WriteVersionInfoToBuildLog(this); -} +public class WriteVersionInfoToBuildLog : GitVersionTaskBase; diff --git a/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.props index bbccf450d2..53a710d932 100644 --- a/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.props @@ -1,4 +1,5 @@ + - + diff --git a/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.targets b/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.targets index bbccf450d2..53a710d932 100644 --- a/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.targets +++ b/src/GitVersion.MsBuild/msbuild/build/GitVersion.MsBuild.targets @@ -1,4 +1,5 @@ + - + diff --git a/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.props index bbccf450d2..53a710d932 100644 --- a/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.props @@ -1,4 +1,5 @@ + - + diff --git a/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.targets b/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.targets index bbccf450d2..53a710d932 100644 --- a/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.targets +++ b/src/GitVersion.MsBuild/msbuild/buildMultiTargeting/GitVersion.MsBuild.targets @@ -1,4 +1,5 @@ + - + diff --git a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props index e102c29e34..c497718e77 100644 --- a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props @@ -4,7 +4,6 @@ $([MSBuild]::EnsureTrailingSlash($(BaseIntermediateOutputPath)))gitversion.json - C# $(MSBuildProjectDirectory)/../ $(SolutionDir) $(MSBuildProjectDirectory) @@ -12,24 +11,22 @@ false false false + false - $(GitVersion_CommandLineArguments) -output file -outputfile $(GitVersionOutputFile) + $(GitVersion_CommandLineArguments) -output file -outputfile "$(GitVersionOutputFile)" $(GitVersion_ToolArgments) -nofetch $(GitVersion_ToolArgments) -nonormalize $(GitVersion_ToolArgments) -nocache - - - - "$(MSBuildThisFileDirectory)net48/gitversion.exe" - $(MSBuildThisFileDirectory)net48/GitVersion.MsBuild.dll + $(GitVersion_ToolArgments) -allowshallow - dotnet --roll-forward Major "$(MSBuildThisFileDirectory)netcoreapp3.1/gitversion.dll" - $(MSBuildThisFileDirectory)netcoreapp3.1/GitVersion.MsBuild.dll - + + true - false @@ -38,7 +35,7 @@ false - true + true false false false @@ -53,7 +50,7 @@ (The global property "_TargetAssemblyProjectName" is injected by XAML's above-mentioned task) --> false - true + true + net8.0 + net9.0 + + net8.0 + dotnet --roll-forward Major "$([MSBuild]::EnsureTrailingSlash($(MSBuildThisFileDirectory)$(GitVersionTargetFramework)))gitversion.dll" + $([MSBuild]::EnsureTrailingSlash($(MSBuildThisFileDirectory)$(GitVersionTargetFramework)))GitVersion.MsBuild.dll + + + + + + @@ -26,12 +43,9 @@ - - - @@ -40,23 +54,16 @@ - - - - - - $(GitVersion_NuGetVersion) + $(GitVersion_SemVer) $(GitVersion_MajorMinorPatch) - $(GitVersion_NuGetPreReleaseTag) $(GitVersion_PreReleaseTag) - $(GitVersion_NuGetVersion) $(GitVersion_FullSemVer) $(GitVersion_InformationalVersion) $(GitVersion_AssemblySemVer) @@ -76,12 +83,9 @@ GitVersion_PreReleaseNumber=$(GitVersion_PreReleaseNumber);$(DefineConstants) GitVersion_WeightedPreReleaseNumber=$(GitVersion_WeightedPreReleaseNumber);$(DefineConstants) GitVersion_BuildMetaData=$(GitVersion_BuildMetaData);$(DefineConstants) - GitVersion_BuildMetaDataPadded=$(GitVersion_BuildMetaDataPadded);$(DefineConstants) GitVersion_FullBuildMetaData=$(GitVersion_FullBuildMetaData);$(DefineConstants) GitVersion_MajorMinorPatch=$(GitVersion_MajorMinorPatch);$(DefineConstants) GitVersion_SemVer=$(GitVersion_SemVer);$(DefineConstants) - GitVersion_LegacySemVer=$(GitVersion_LegacySemVer);$(DefineConstants) - GitVersion_LegacySemVerPadded=$(GitVersion_LegacySemVerPadded);$(DefineConstants) GitVersion_AssemblySemVer=$(GitVersion_AssemblySemVer);$(DefineConstants) GitVersion_AssemblySemFileVer=$(GitVersion_AssemblySemFileVer);$(DefineConstants) GitVersion_FullSemVer=$(GitVersion_FullSemVer);$(DefineConstants) @@ -90,14 +94,9 @@ GitVersion_EscapedBranchName=$(GitVersion_EscapedBranchName);$(DefineConstants) GitVersion_Sha=$(GitVersion_Sha);$(DefineConstants) GitVersion_ShortSha=$(GitVersion_ShortSha);$(DefineConstants) - GitVersion_NuGetVersionV2=$(GitVersion_NuGetVersionV2);$(DefineConstants) - GitVersion_NuGetVersion=$(GitVersion_NuGetVersion);$(DefineConstants) - GitVersion_NuGetPreReleaseTagV2=$(GitVersion_NuGetPreReleaseTagV2);$(DefineConstants) - GitVersion_NuGetPreReleaseTag=$(GitVersion_NuGetPreReleaseTag);$(DefineConstants) GitVersion_CommitDate=$(GitVersion_CommitDate);$(DefineConstants) GitVersion_VersionSourceSha=$(GitVersion_VersionSourceSha);$(DefineConstants) GitVersion_CommitsSinceVersionSource=$(GitVersion_CommitsSinceVersionSource);$(DefineConstants) - GitVersion_CommitsSinceVersionSourcePadded=$(GitVersion_CommitsSinceVersionSourcePadded);$(DefineConstants) GitVersion_UncommittedChanges=$(GitVersion_UncommittedChanges);$(DefineConstants) @@ -110,19 +109,16 @@ + Language="$(Language)" + UseProjectNamespaceForGitVersionInformation="$(UseProjectNamespaceForGitVersionInformation)" + RootNamespace="$(RootNamespace)"> - - - - - - - + + <_GeneratedCodeFiles Include="$(GitVersionInformationFilePath)" /> @@ -135,18 +131,14 @@ ProjectFile="$(MSBuildProjectFullPath)" IntermediateOutputPath="$(IntermediateOutputPath)" Language="$(Language)" - CompileFiles ="@(Compile)"> + CompileFiles="@(Compile)"> - - - - - - + + <_GeneratedCodeFiles Include="$(AssemblyInfoTempFilePath)" /> diff --git a/src/GitVersion.MsBuild/nuget-files.props b/src/GitVersion.MsBuild/nuget-files.props deleted file mode 100644 index 65516b5e63..0000000000 --- a/src/GitVersion.MsBuild/nuget-files.props +++ /dev/null @@ -1,28 +0,0 @@ - - - - ../GitVersion.App/bin/$(Configuration)/net48 - ../GitVersion.App/bin/$(Configuration)/netcoreapp3.1/publish - ../GitVersion.App/bin/$(Configuration)/net5.0/publish - ../GitVersion.App/bin/$(Configuration)/net6.0/publish - tools/net48 - tools/netcoreapp3.1 - tools/net5.0 - tools/net6.0 - - - - - - - - - - - - - - - - - diff --git a/src/GitVersion.Output.Tests/AssemblyParallelizable.cs b/src/GitVersion.Output.Tests/AssemblyParallelizable.cs new file mode 100644 index 0000000000..fdd365b7e2 --- /dev/null +++ b/src/GitVersion.Output.Tests/AssemblyParallelizable.cs @@ -0,0 +1 @@ +[assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/src/GitVersion.Output.Tests/GitVersion.Output.Tests.csproj b/src/GitVersion.Output.Tests/GitVersion.Output.Tests.csproj new file mode 100644 index 0000000000..d54414c314 --- /dev/null +++ b/src/GitVersion.Output.Tests/GitVersion.Output.Tests.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFile.approved.txt similarity index 77% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFile.approved.txt index aac25ac588..d935478f68 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFile.approved.txt @@ -4,23 +4,15 @@ - - - - - - - - diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt similarity index 77% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt index aac25ac588..d935478f68 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/WixFileTests.UpdateWixVersionFileWhenFileAlreadyExists.approved.txt @@ -4,23 +4,15 @@ - - - - - - - - diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/cs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt new file mode 100644 index 0000000000..1289bd4dc8 --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GitVersion +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +[global::System.Runtime.CompilerServices.CompilerGenerated] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +static class GitVersionInformation +{ + public const string AssemblySemFileVer = "1.2.3.0"; + public const string AssemblySemVer = "1.2.3.0"; + public const string BranchName = "feature1"; + public const string BuildMetaData = "5"; + public const string CommitDate = "2014-03-06"; + public const string CommitsSinceVersionSource = "5"; + public const string EscapedBranchName = "feature1"; + public const string FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"; + public const string FullSemVer = "1.2.3-unstable.4+5"; + public const string InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"; + public const string Major = "1"; + public const string MajorMinorPatch = "1.2.3"; + public const string Minor = "2"; + public const string Patch = "3"; + public const string PreReleaseLabel = "unstable"; + public const string PreReleaseLabelWithDash = "-unstable"; + public const string PreReleaseNumber = "4"; + public const string PreReleaseTag = "unstable.4"; + public const string PreReleaseTagWithDash = "-unstable.4"; + public const string SemVer = "1.2.3-unstable.4"; + public const string Sha = "commitSha"; + public const string ShortSha = "commitShortSha"; + public const string UncommittedChanges = "0"; + public const string VersionSourceSha = "versionSourceSha"; + public const string WeightedPreReleaseNumber = "4"; +} diff --git a/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt new file mode 100644 index 0000000000..8cb6fbe737 --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GitVersion +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace My.Custom.Namespace +{ + [global::System.Runtime.CompilerServices.CompilerGenerated] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static class GitVersionInformation + { + public const string AssemblySemFileVer = "1.2.3.0"; + public const string AssemblySemVer = "1.2.3.0"; + public const string BranchName = "feature1"; + public const string BuildMetaData = "5"; + public const string CommitDate = "2014-03-06"; + public const string CommitsSinceVersionSource = "5"; + public const string EscapedBranchName = "feature1"; + public const string FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"; + public const string FullSemVer = "1.2.3-unstable.4+5"; + public const string InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"; + public const string Major = "1"; + public const string MajorMinorPatch = "1.2.3"; + public const string Minor = "2"; + public const string Patch = "3"; + public const string PreReleaseLabel = "unstable"; + public const string PreReleaseLabelWithDash = "-unstable"; + public const string PreReleaseNumber = "4"; + public const string PreReleaseTag = "unstable.4"; + public const string PreReleaseTagWithDash = "-unstable.4"; + public const string SemVer = "1.2.3-unstable.4"; + public const string Sha = "commitSha"; + public const string ShortSha = "commitShortSha"; + public const string UncommittedChanges = "0"; + public const string VersionSourceSha = "versionSourceSha"; + public const string WeightedPreReleaseNumber = "4"; + } +} diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt similarity index 60% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt index b8aa9a35bb..f653c20b31 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -8,58 +8,34 @@ // //------------------------------------------------------------------------------ -#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 -namespace System.Diagnostics.CodeAnalysis - -[] -[] -type ExcludeFromCodeCoverageAttribute() = inherit global.System.Attribute() -#endif - namespace global [] [] [] type GitVersionInformation = + static member AssemblySemFileVer = "1.2.3.0" + static member AssemblySemVer = "1.2.3.0" + static member BranchName = "feature1" + static member BuildMetaData = "5" + static member CommitDate = "2014-03-06" + static member CommitsSinceVersionSource = "5" + static member EscapedBranchName = "feature1" + static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha" + static member FullSemVer = "1.2.3-unstable.4+5" + static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" static member Major = "1" + static member MajorMinorPatch = "1.2.3" static member Minor = "2" static member Patch = "3" - static member PreReleaseTag = "unstable.4" - static member PreReleaseTagWithDash = "-unstable.4" static member PreReleaseLabel = "unstable" static member PreReleaseLabelWithDash = "-unstable" static member PreReleaseNumber = "4" - static member WeightedPreReleaseNumber = "4" - static member BuildMetaData = "5" - static member BuildMetaDataPadded = "0005" - static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha" - static member MajorMinorPatch = "1.2.3" + static member PreReleaseTag = "unstable.4" + static member PreReleaseTagWithDash = "-unstable.4" static member SemVer = "1.2.3-unstable.4" - static member LegacySemVer = "1.2.3-unstable4" - static member LegacySemVerPadded = "1.2.3-unstable0004" - static member AssemblySemVer = "1.2.3.0" - static member AssemblySemFileVer = "1.2.3.0" - static member FullSemVer = "1.2.3-unstable.4+5" - static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" - static member BranchName = "feature1" - static member EscapedBranchName = "feature1" static member Sha = "commitSha" static member ShortSha = "commitShortSha" - static member NuGetVersionV2 = "1.2.3-unstable0004" - static member NuGetVersion = "1.2.3-unstable0004" - static member NuGetPreReleaseTagV2 = "unstable0004" - static member NuGetPreReleaseTag = "unstable0004" - static member VersionSourceSha = "versionSourceSha" - static member CommitsSinceVersionSource = "5" - static member CommitsSinceVersionSourcePadded = "0005" static member UncommittedChanges = "0" - static member CommitDate = "2014-03-06" + static member VersionSourceSha = "versionSourceSha" + static member WeightedPreReleaseNumber = "4" diff --git a/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt new file mode 100644 index 0000000000..ac564fb232 --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GitVersion +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace My.Custom.Namespace + +[] +[] +[] +type GitVersionInformation = + static member AssemblySemFileVer = "1.2.3.0" + static member AssemblySemVer = "1.2.3.0" + static member BranchName = "feature1" + static member BuildMetaData = "5" + static member CommitDate = "2014-03-06" + static member CommitsSinceVersionSource = "5" + static member EscapedBranchName = "feature1" + static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha" + static member FullSemVer = "1.2.3-unstable.4+5" + static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" + static member Major = "1" + static member MajorMinorPatch = "1.2.3" + static member Minor = "2" + static member Patch = "3" + static member PreReleaseLabel = "unstable" + static member PreReleaseLabelWithDash = "-unstable" + static member PreReleaseNumber = "4" + static member PreReleaseTag = "unstable.4" + static member PreReleaseTagWithDash = "-unstable.4" + static member SemVer = "1.2.3-unstable.4" + static member Sha = "commitSha" + static member ShortSha = "commitShortSha" + static member UncommittedChanges = "0" + static member VersionSourceSha = "versionSourceSha" + static member WeightedPreReleaseNumber = "4" diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt similarity index 100% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/AssemblyInfoFileUpdaterTests.ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone.approved.txt diff --git a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt similarity index 61% rename from src/GitVersion.Core.Tests/VersionConverters/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt rename to src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt index 39760d6b8e..91cb09fa24 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -8,22 +8,6 @@ ' '------------------------------------------------------------------------------ -#If NET20 OrElse NET35 OrElse NETCOREAPP1_0 OrElse NETCOREAPP1_1 OrElse NETSTANDARD1_0 OrElse NETSTANDARD1_1 OrElse NETSTANDARD1_2 OrElse NETSTANDARD1_3 OrElse NETSTANDARD1_4 OrElse NETSTANDARD1_5 OrElse NETSTANDARD1_6 Then -Namespace Global.System.Diagnostics.CodeAnalysis - - Friend NotInheritable Class ExcludeFromCodeCoverageAttribute - Inherits Global.System.Attribute - End Class -End Namespace -#End If - Namespace Global @@ -31,39 +15,31 @@ Namespace Global NotInheritable Class GitVersionInformation Private Sub New() End Sub + Public Shared AssemblySemFileVer As String = "1.2.3.0" + Public Shared AssemblySemVer As String = "1.2.3.0" + Public Shared BranchName As String = "feature1" + Public Shared BuildMetaData As String = "5" + Public Shared CommitDate As String = "2014-03-06" + Public Shared CommitsSinceVersionSource As String = "5" + Public Shared EscapedBranchName As String = "feature1" + Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha" + Public Shared FullSemVer As String = "1.2.3-unstable.4+5" + Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" Public Shared Major As String = "1" + Public Shared MajorMinorPatch As String = "1.2.3" Public Shared Minor As String = "2" Public Shared Patch As String = "3" - Public Shared PreReleaseTag As String = "unstable.4" - Public Shared PreReleaseTagWithDash As String = "-unstable.4" Public Shared PreReleaseLabel As String = "unstable" Public Shared PreReleaseLabelWithDash As String = "-unstable" Public Shared PreReleaseNumber As String = "4" - Public Shared WeightedPreReleaseNumber As String = "4" - Public Shared BuildMetaData As String = "5" - Public Shared BuildMetaDataPadded As String = "0005" - Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha" - Public Shared MajorMinorPatch As String = "1.2.3" + Public Shared PreReleaseTag As String = "unstable.4" + Public Shared PreReleaseTagWithDash As String = "-unstable.4" Public Shared SemVer As String = "1.2.3-unstable.4" - Public Shared LegacySemVer As String = "1.2.3-unstable4" - Public Shared LegacySemVerPadded As String = "1.2.3-unstable0004" - Public Shared AssemblySemVer As String = "1.2.3.0" - Public Shared AssemblySemFileVer As String = "1.2.3.0" - Public Shared FullSemVer As String = "1.2.3-unstable.4+5" - Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" - Public Shared BranchName As String = "feature1" - Public Shared EscapedBranchName As String = "feature1" Public Shared Sha As String = "commitSha" Public Shared ShortSha As String = "commitShortSha" - Public Shared NuGetVersionV2 As String = "1.2.3-unstable0004" - Public Shared NuGetVersion As String = "1.2.3-unstable0004" - Public Shared NuGetPreReleaseTagV2 As String = "unstable0004" - Public Shared NuGetPreReleaseTag As String = "unstable0004" - Public Shared VersionSourceSha As String = "versionSourceSha" - Public Shared CommitsSinceVersionSource As String = "5" - Public Shared CommitsSinceVersionSourcePadded As String = "0005" Public Shared UncommittedChanges As String = "0" - Public Shared CommitDate As String = "2014-03-06" + Public Shared VersionSourceSha As String = "versionSourceSha" + Public Shared WeightedPreReleaseNumber As String = "4" End Class End Namespace diff --git a/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt new file mode 100644 index 0000000000..f1fc481aaa --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt @@ -0,0 +1,45 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' GitVersion +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Namespace My.Custom.Namespace + + + + NotInheritable Class GitVersionInformation + Private Sub New() + End Sub + Public Shared AssemblySemFileVer As String = "1.2.3.0" + Public Shared AssemblySemVer As String = "1.2.3.0" + Public Shared BranchName As String = "feature1" + Public Shared BuildMetaData As String = "5" + Public Shared CommitDate As String = "2014-03-06" + Public Shared CommitsSinceVersionSource As String = "5" + Public Shared EscapedBranchName As String = "feature1" + Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha" + Public Shared FullSemVer As String = "1.2.3-unstable.4+5" + Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" + Public Shared Major As String = "1" + Public Shared MajorMinorPatch As String = "1.2.3" + Public Shared Minor As String = "2" + Public Shared Patch As String = "3" + Public Shared PreReleaseLabel As String = "unstable" + Public Shared PreReleaseLabelWithDash As String = "-unstable" + Public Shared PreReleaseNumber As String = "4" + Public Shared PreReleaseTag As String = "unstable.4" + Public Shared PreReleaseTagWithDash As String = "-unstable.4" + Public Shared SemVer As String = "1.2.3-unstable.4" + Public Shared Sha As String = "commitSha" + Public Shared ShortSha As String = "commitShortSha" + Public Shared UncommittedChanges As String = "0" + Public Shared VersionSourceSha As String = "versionSourceSha" + Public Shared WeightedPreReleaseNumber As String = "4" + End Class + +End Namespace diff --git a/src/GitVersion.Core.Tests/VersionConverters/AssemblyFileVersionTests.cs b/src/GitVersion.Output.Tests/Output/AssemblyFileVersionTests.cs similarity index 86% rename from src/GitVersion.Core.Tests/VersionConverters/AssemblyFileVersionTests.cs rename to src/GitVersion.Output.Tests/Output/AssemblyFileVersionTests.cs index a7e343cefe..d6f50b26ee 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/AssemblyFileVersionTests.cs +++ b/src/GitVersion.Output.Tests/Output/AssemblyFileVersionTests.cs @@ -1,7 +1,6 @@ +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Extensions; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -14,11 +13,11 @@ public class AssemblyFileVersionTests : TestBase [TestCase(AssemblyFileVersioningScheme.MajorMinorPatch, 1, 2, 3, 4, "1.2.3.0")] [TestCase(AssemblyFileVersioningScheme.MajorMinorPatchTag, 1, 2, 3, 4, "1.2.3.4")] public void ValidateAssemblyFileVersionBuilder(AssemblyFileVersioningScheme assemblyFileVersioningScheme, int major, int minor, int patch, - int tag, string versionString) + int tag, string? versionString) { var semVer = new SemanticVersion(major, minor, patch) { - PreReleaseTag = new SemanticVersionPreReleaseTag("Test", tag) + PreReleaseTag = new("Test", tag, true) }; var assemblyFileVersion = semVer.GetAssemblyFileVersion(assemblyFileVersioningScheme); diff --git a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs similarity index 56% rename from src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs rename to src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs index 4fe8af3182..3b05e42d85 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs @@ -1,15 +1,12 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; -using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.Logging; -using GitVersion.Model.Configuration; +using GitVersion.Output.AssemblyInfo; using GitVersion.OutputVariables; using GitVersion.VersionCalculation; -using GitVersion.VersionConverters.AssemblyInfo; using Microsoft.Extensions.DependencyInjection; -using NSubstitute; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -20,6 +17,13 @@ public class AssemblyInfoFileUpdaterTests : TestBase private IVariableProvider variableProvider; private ILog log; private IFileSystem fileSystem; + private string workingDir; + + [OneTimeSetUp] + public void OneTimeSetUp() => workingDir = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), nameof(AssemblyInfoFileUpdaterTests)); + + [OneTimeTearDown] + public void OneTimeTearDown() => FileSystemHelper.Directory.DeleteDirectory(workingDir); [SetUp] public void Setup() @@ -36,61 +40,52 @@ public void Setup() [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; - var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var fullPath = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); + + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, true, assemblyInfoFile)); - this.fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + this.fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); } [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = PathHelper.Combine("src", "Project", "Properties", $"VersionAssemblyInfo.{fileExtension}"); - var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var assemblyInfoFile = FileSystemHelper.Path.Combine("src", "Project", "Properties", $"VersionAssemblyInfo.{fileExtension}"); + var fullPath = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0 + ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, true, assemblyInfoFile)); - this.fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + this.fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); } [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFiles = new HashSet - { - "AssemblyInfo." + fileExtension, - PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) - }; - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var assemblyInfoFiles = new HashSet { "AssemblyInfo." + fileExtension, FileSystemHelper.Path.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) }; + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFiles.ToArray())); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, true, [.. assemblyInfoFiles])); foreach (var item in assemblyInfoFiles) { - var fullPath = PathHelper.Combine(workingDir, item); - this.fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + var fullPath = FileSystemHelper.Path.Combine(workingDir, item); + this.fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); } } @@ -99,44 +94,49 @@ public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInf [TestCase("vb")] public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo(string fileExtension) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; - var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var assemblyInfoFile = "NoVersionAssemblyInfo." + fileExtension; + var fullPath = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0 + ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - this.fileSystem.Exists(fullPath).ShouldBeFalse(); + this.fileSystem.File.Exists(fullPath).ShouldBeFalse(); } [Test] public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssemblyInfo() { this.fileSystem = Substitute.For(); - var workingDir = Path.GetTempPath(); + const string assemblyInfoFile = "VersionAssemblyInfo.js"; - var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var fullPath = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0 + ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, true, assemblyInfoFile)); - this.fileSystem.Received(0).WriteAllText(fullPath, Arg.Any()); + this.fileSystem.Received(1).File.WriteAllText(fullPath, Arg.Any()); } [Test] public void ShouldStartSearchFromWorkingDirectory() { this.fileSystem = Substitute.For(); - var workingDir = Path.GetTempPath(); - var assemblyInfoFiles = Array.Empty(); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", Config.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + + string[] assemblyInfoFiles = []; + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("1.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0 + ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFiles.ToArray())); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, [.. assemblyInfoFiles])); - this.fileSystem.Received().DirectoryEnumerateFiles(Arg.Is(workingDir), Arg.Any(), Arg.Any()); + this.fileSystem.Received(1).Directory.EnumerateFiles(Arg.Is(workingDir), Arg.Any(), Arg.Any()); } [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyInformationalVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] @@ -144,40 +144,36 @@ public void ShouldStartSearchFromWorkingDirectory() [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersion(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } [TestCase("cs", "[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]")] [TestCase("vb", "")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.None, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - assemblyFileContent = fs.ReadAllText(fileName); - assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + assemblyFileContent = fs.File.ReadAllText(fileName); + assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); }); } @@ -186,19 +182,18 @@ public void ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone(string fileEx [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePath(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var assemblyInfoFile = FileSystemHelper.Path.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -207,19 +202,18 @@ public void ShouldReplaceAssemblyVersionInRelativePath(string fileExtension, str [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithWhiteSpace(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var assemblyInfoFile = FileSystemHelper.Path.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -228,19 +222,18 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithWhiteSpace(string file [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWithStar(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -249,22 +242,21 @@ public void ShouldReplaceAssemblyVersionWithStar(string fileExtension, string as [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWithAttributeSuffix(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, verify: (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); - - fs.Received().WriteAllText(fileName, Arg.Is(s => - !s.Contains(@"AssemblyVersionAttribute(""1.0.0.0"")") && - !s.Contains(@"AssemblyInformationalVersionAttribute(""1.0.0.0"")") && - !s.Contains(@"AssemblyFileVersionAttribute(""1.0.0.0"")") && - s.Contains(@"AssemblyVersion(""2.3.1.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); + + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + !s.Contains("""AssemblyVersionAttribute("1.0.0.0")""") && + !s.Contains("""AssemblyInformationalVersionAttribute("1.0.0.0")""") && + !s.Contains("""AssemblyFileVersionAttribute("1.0.0.0")""") && + s.Contains("""AssemblyVersion("2.3.1.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -273,19 +265,18 @@ public void ShouldReplaceAssemblyVersionWithAttributeSuffix(string fileExtension [TestCase("vb")] public void ShouldAddAssemblyVersionIfMissingFromInfoFile(string fileExtension) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile("", fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -294,19 +285,18 @@ public void ShouldAddAssemblyVersionIfMissingFromInfoFile(string fileExtension) [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAlreadySubstitutedValues(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -315,19 +305,18 @@ public void ShouldReplaceAlreadySubstitutedValues(string fileExtension, string a [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionWhenCreatingAssemblyVersionFileAndEnsureAssemblyInfo(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, verify: (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.1.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.1.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -336,19 +325,18 @@ public void ShouldReplaceAssemblyVersionWhenCreatingAssemblyVersionFileAndEnsure [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithVariables(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var assemblyInfoFile = FileSystemHelper.Path.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } @@ -357,82 +345,72 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithVariables(string fileE [TestCase("vb", "\r\n\r\n")] public void ShouldReplaceAssemblyVersionInRelativePathWithVariablesAndWhiteSpace(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); - var assemblyInfoFile = PathHelper.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var assemblyInfoFile = FileSystemHelper.Path.Combine("Project", "src", "Properties", "AssemblyInfo." + fileExtension); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.MajorMinor, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - fs.Received().WriteAllText(fileName, Arg.Is(s => - s.Contains(@"AssemblyVersion(""2.3.0.0"")") && - s.Contains(@"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")") && - s.Contains(@"AssemblyFileVersion(""2.3.1.0"")"))); + fs.Received().File.WriteAllText(fileName, Arg.Is(s => + s.Contains("""AssemblyVersion("2.3.0.0")""") && + s.Contains("""AssemblyInformationalVersion("2.3.1+3.Branch.foo.Sha.hash")""") && + s.Contains("""AssemblyFileVersion("2.3.1.0")"""))); }); } [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]\r\n[]")] [TestCase("vb", "\r\n")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, verify: (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - assemblyFileContent = fs.ReadAllText(fileName); - assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + assemblyFileContent = fs.File.ReadAllText(fileName); + assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); }); } [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n// comment\r\n")] [TestCase("fs", "[]\r\n[]\r\ndo\r\n()\r\n")] [TestCase("vb", "\r\n\r\n' comment\r\n")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, verify: (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - assemblyFileContent = fs.ReadAllText(fileName); - assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + assemblyFileContent = fs.File.ReadAllText(fileName); + assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); }); } [TestCase("cs", "[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]")] [TestCase("vb", "")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { - var workingDir = Path.GetTempPath(); var assemblyInfoFile = "AssemblyInfo." + fileExtension; - var fileName = PathHelper.Combine(workingDir, assemblyInfoFile); + var fileName = FileSystemHelper.Path.Combine(workingDir, assemblyInfoFile); VerifyAssemblyInfoFile(assemblyFileContent, fileName, AssemblyVersioningScheme.None, (fs, variables) => { using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, fs); - assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); + assemblyInfoFileUpdater.Execute(variables, new(workingDir, false, assemblyInfoFile)); - assemblyFileContent = fs.ReadAllText(fileName); - assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved", fileExtension))); + assemblyFileContent = fs.File.ReadAllText(fileName); + assemblyFileContent.ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); }); } @@ -440,28 +418,25 @@ private void VerifyAssemblyInfoFile( string assemblyFileContent, string fileName, AssemblyVersioningScheme versioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - Action? verify = null) + Action? verify = null) { - this.fileSystem = Substitute.For(); - var version = new SemanticVersion - { - BuildMetaData = new SemanticVersionBuildMetaData("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), - Major = 2, - Minor = 3, - Patch = 1 - }; - - this.fileSystem.Exists(fileName).Returns(true); - this.fileSystem.ReadAllText(fileName).Returns(assemblyFileContent); - this.fileSystem.When(f => f.WriteAllText(fileName, Arg.Any())).Do(c => + var file = Substitute.For(); + var version = new SemanticVersion { BuildMetaData = new("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), Major = 2, Minor = 3, Patch = 1 }; + + file.Exists(fileName).Returns(true); + file.ReadAllText(fileName).Returns(assemblyFileContent); + file.When(f => f.WriteAllText(fileName, Arg.Any())).Do(c => { assemblyFileContent = c.ArgAt(1); - this.fileSystem.ReadAllText(fileName).Returns(assemblyFileContent); + file.ReadAllText(fileName).Returns(assemblyFileContent); }); - var config = new TestEffectiveConfiguration(versioningScheme); - var variables = this.variableProvider.GetVariablesFor(version, config, false); + var configuration = EmptyConfigurationBuilder.New.WithAssemblyVersioningScheme(versioningScheme).Build(); + var variables = this.variableProvider.GetVariablesFor(version, configuration, 0); + this.fileSystem = Substitute.For(); + this.fileSystem.File.Returns(file); + this.fileSystem.FileInfo.Returns(new FileSystem().FileInfo); verify?.Invoke(this.fileSystem, variables); } } diff --git a/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs b/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs new file mode 100644 index 0000000000..b93fdec479 --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs @@ -0,0 +1,210 @@ +using GitVersion.Core.Tests.Helpers; +using GitVersion.Logging; +using GitVersion.Output.OutputGenerator; +using LibGit2Sharp; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace GitVersion.Core.Tests; + +[TestFixture] +public class FormatArgumentTests : TestBase +{ + [TestCase("{SemVer}", "1.1.0-foo.1")] + [TestCase("{Major}.{Minor}", "1.1")] + [TestCase("{Major}.{Minor}.{Patch}", "1.1.0")] + [TestCase("{Major}.{Minor}.{Patch}.{PreReleaseTag}", "1.1.0.foo.1")] + public void ShouldOutputFormatTests(string format, string expectedValue) + { + var fixture = CreateTestRepository(); + + var consoleBuilder = new StringBuilder(); + IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Format = format, Output = { OutputType.Json } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(consoleAdapter); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString().Replace("\n", "").Replace("\r", ""); + output.ShouldBeEquivalentTo(expectedValue); + } + + [TestCase("{Major}.{Minor}.{env:CustomVar}", "1.1.foo")] + [TestCase("{Major}.{Minor}.{Patch}.{env:CustomVar}", "1.1.0.foo")] + public void ShouldOutputFormatWithEnvironmentVariablesTests(string format, string expectedValue) + { + var fixture = CreateTestRepository(); + var consoleBuilder = new StringBuilder(); + IConsole console = new TestConsoleAdapter(consoleBuilder); + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable("CustomVar", "foo"); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Format = format, Output = { OutputType.Json } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(console); + services.AddSingleton(environment); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString().Replace("\n", "").Replace("\r", ""); + output.ShouldBeEquivalentTo(expectedValue); + } + + [TestCase("Major", "'1'")] + [TestCase("MajorMinorPatch", "'1.1.0'")] + [TestCase("SemVer", "'1.1.0-foo.1'")] + [TestCase("PreReleaseTagWithDash", "'-foo.1'")] + [TestCase("AssemblySemFileVer", "'1.1.0.0'")] + [TestCase("BranchName", "'feature/foo'")] + [TestCase("FullSemVer", "'1.1.0-foo.1+1'")] + public void ShouldOutputDotEnvEntries(string variableName, string expectedValue) + { + var fixture = CreateTestRepository(); + + var consoleBuilder = new StringBuilder(); + IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Output = { OutputType.DotEnv } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(consoleAdapter); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString(); + output.ShouldContain($"GitVersion_{variableName}={expectedValue}{SysEnv.NewLine}"); + } + + [TestCase] + public void ShouldOutputAllCalculatedVariablesAsDotEnvEntries() + { + var fixture = CreateTestRepository(); + + var consoleBuilder = new StringBuilder(); + IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Output = { OutputType.DotEnv } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(consoleAdapter); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString(); + var totalOutputLines = output.Split(SysEnv.NewLine).Length - 1; // ignore last item that also ends with the newline string + Assert.That(totalOutputLines, Is.EqualTo(versionVariables.Count())); + } + + [TestCase("Major", "'0'")] + [TestCase("MajorMinorPatch", "'0.0.1'")] + [TestCase("SemVer", "'0.0.1-1'")] + [TestCase("BuildMetaData", "''")] + [TestCase("AssemblySemVer", "'0.0.1.0'")] + [TestCase("PreReleaseTagWithDash", "'-1'")] + [TestCase("BranchName", "'main'")] + [TestCase("PreReleaseLabel", "''")] + [TestCase("PreReleaseLabelWithDash", "''")] + public void ShouldOutputAllDotEnvEntriesEvenForMinimalRepositories(string variableName, string expectedValue) + { + var fixture = CreateMinimalTestRepository(); + + var consoleBuilder = new StringBuilder(); + IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Output = { OutputType.DotEnv } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(consoleAdapter); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString(); + output.ShouldContain($"GitVersion_{variableName}={expectedValue}{SysEnv.NewLine}"); + } + + [TestCase] + public void ShouldOutputAllCalculatedVariablesAsDotEnvEntriesEvenForMinimalRepositories() + { + var fixture = CreateMinimalTestRepository(); + + var consoleBuilder = new StringBuilder(); + IConsole consoleAdapter = new TestConsoleAdapter(consoleBuilder); + + var sp = ConfigureServices(services => + { + var options = Options.Create(new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, RepositoryInfo = { TargetBranch = fixture.Repository.Head.CanonicalName }, Output = { OutputType.DotEnv } }); + var repository = fixture.Repository.ToGitRepository(); + + services.AddSingleton(options); + services.AddSingleton(repository); + services.AddSingleton(consoleAdapter); + }); + + var versionVariables = sp.GetRequiredService().CalculateVersionVariables(); + var outputGenerator = sp.GetRequiredService(); + + outputGenerator.Execute(versionVariables, new()); + var output = consoleBuilder.ToString(); + var totalOutputLines = output.Split(SysEnv.NewLine).Length - 1; // ignore last item that also ends with the newline string + Assert.That(totalOutputLines, Is.EqualTo(versionVariables.Count())); + } + + private static EmptyRepositoryFixture CreateTestRepository() + { + var fixture = new EmptyRepositoryFixture(); + _ = fixture.Repository.MakeACommit(); + Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop")); + var secondCommit = fixture.Repository.MakeACommit(); + _ = fixture.Repository.Tags.Add("1.0.0", secondCommit); + var featureBranch = fixture.Repository.CreateBranch("feature/foo"); + Commands.Checkout(fixture.Repository, featureBranch); + _ = fixture.Repository.MakeACommit(); + return fixture; + } + + private static EmptyRepositoryFixture CreateMinimalTestRepository() + { + var fixture = new EmptyRepositoryFixture(); + _ = fixture.Repository.MakeACommit(); + return fixture; + } +} diff --git a/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs b/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs new file mode 100644 index 0000000000..f179c64469 --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs @@ -0,0 +1,94 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; +using GitVersion.Output.GitVersionInfo; +using GitVersion.VersionCalculation; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Core.Tests; + +[TestFixture] +[Parallelizable(ParallelScope.None)] +public class GitVersionInfoGeneratorTests : TestBase +{ + [SetUp] + public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); + + [TestCase("cs")] + [TestCase("fs")] + [TestCase("vb")] + public void ShouldCreateFile(string fileExtension) + { + var semanticVersion = new SemanticVersion + { + Major = 1, + Minor = 2, + Patch = 3, + PreReleaseTag = "unstable4", + BuildMetaData = new("versionSourceSha", 5, + "feature1", "commitSha", "commitShortSha", DateTimeOffset.Parse("2014-03-06 23:59:59Z"), 0) + }; + + var sp = ConfigureServices(); + + var fileSystem = sp.GetRequiredService(); + + var directory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "GitVersionInfoGeneratorTests", Guid.NewGuid().ToString()); + if (!fileSystem.Directory.Exists(directory)) + fileSystem.Directory.CreateDirectory(directory); + var fileName = "GitVersionInformation.g." + fileExtension; + var fullPath = FileSystemHelper.Path.Combine(directory, fileName); + + var variableProvider = sp.GetRequiredService(); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); + using var generator = sp.GetRequiredService(); + + generator.Execute(variables, new(directory, fileName)); + + fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); + + FileSystemHelper.Directory.DeleteDirectory(directory); + } + + /// + /// Regression test for issue #4196 (https://github.com/GitTools/GitVersion/issues/4196) + /// + [TestCase("cs")] + [TestCase("fs")] + [TestCase("vb")] + public void ShouldProperlyOutputNamespaceDeclaration(string fileExtension) + { + const string targetNamespace = "My.Custom.Namespace"; + + var semanticVersion = new SemanticVersion + { + Major = 1, + Minor = 2, + Patch = 3, + PreReleaseTag = "unstable4", + BuildMetaData = new("versionSourceSha", 5, + "feature1", "commitSha", "commitShortSha", DateTimeOffset.Parse("2014-03-06 23:59:59Z"), 0) + }; + + var sp = ConfigureServices(); + + var fileSystem = sp.GetRequiredService(); + + var directory = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "GitVersionInfoGeneratorTests", Guid.NewGuid().ToString()); + if (!fileSystem.Directory.Exists(directory)) + fileSystem.Directory.CreateDirectory(directory); + var fileName = "GitVersionInformation.g." + fileExtension; + var fullPath = FileSystemHelper.Path.Combine(directory, fileName); + + var variableProvider = sp.GetRequiredService(); + var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0); + using var generator = sp.GetRequiredService(); + + generator.Execute(variables, new(directory, fileName, targetNamespace)); + + fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension))); + + FileSystemHelper.Directory.DeleteDirectory(directory); + } +} diff --git a/src/GitVersion.Core.Tests/VersionConverters/InformationalVersionBuilderTests.cs b/src/GitVersion.Output.Tests/Output/InformationalVersionBuilderTests.cs similarity index 90% rename from src/GitVersion.Core.Tests/VersionConverters/InformationalVersionBuilderTests.cs rename to src/GitVersion.Output.Tests/Output/InformationalVersionBuilderTests.cs index 93e0b95df2..b9e1bb6a24 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/InformationalVersionBuilderTests.cs +++ b/src/GitVersion.Output.Tests/Output/InformationalVersionBuilderTests.cs @@ -1,5 +1,4 @@ using GitVersion.Core.Tests.Helpers; -using NUnit.Framework; namespace GitVersion.Core.Tests; @@ -20,7 +19,7 @@ public class InformationalVersionBuilderTests : TestBase [TestCase("release/1.2", "a682956dc1a2752aa24597a0f5cd939f93614509", "a682956d", 1, 2, 0, "beta2", null, null, "1.2.0-beta.2+Branch.release-1.2.Sha.a682956dc1a2752aa24597a0f5cd939f93614509")] [TestCase("release/1.2", "a682956dc1a2752aa24597a0f5cd939f93614509", "a682956d", 1, 2, 0, "alpha2", null, null, "1.2.0-alpha.2+Branch.release-1.2.Sha.a682956dc1a2752aa24597a0f5cd939f93614509")] public void ValidateInformationalVersionBuilder(string branchName, string sha, string shortSha, int major, int minor, int patch, - string tag, string versionSourceSha, int? commitsSinceTag, string versionString) + string? tag, string? versionSourceSha, int? commitsSinceTag, string versionString) { var semanticVersion = new SemanticVersion { @@ -28,11 +27,10 @@ public void ValidateInformationalVersionBuilder(string branchName, string sha, s Minor = minor, Patch = patch, PreReleaseTag = tag, - BuildMetaData = new SemanticVersionBuildMetaData(versionSourceSha, commitsSinceTag, branchName, sha, shortSha, DateTimeOffset.MinValue, 0) + BuildMetaData = new(versionSourceSha, commitsSinceTag, branchName, sha, shortSha, DateTimeOffset.MinValue, 0) }; var informationalVersion = semanticVersion.ToString("i"); - Assert.AreEqual(versionString, informationalVersion); + Assert.That(informationalVersion, Is.EqualTo(versionString)); } - } diff --git a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs new file mode 100644 index 0000000000..aac07abadb --- /dev/null +++ b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs @@ -0,0 +1,327 @@ +using System.IO.Abstractions; +using System.Xml.Linq; +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.Output.AssemblyInfo; +using GitVersion.OutputVariables; +using GitVersion.VersionCalculation; +using Microsoft.Extensions.DependencyInjection; + +namespace GitVersion.Core.Tests; + +[TestFixture] +[Parallelizable(ParallelScope.None)] +public class ProjectFileUpdaterTests : TestBase +{ + private const string TargetFramework = "net8.0"; + private IVariableProvider variableProvider; + private ILog log; + private IFileSystem fileSystem; + private ProjectFileUpdater projectFileUpdater; + private List logMessages; + + [SetUp] + public void Setup() + { + ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); + var sp = ConfigureServices(); + + this.logMessages = []; + this.log = new Log(new TestLogAppender(this.logMessages.Add)); + + this.fileSystem = sp.GetRequiredService(); + this.variableProvider = sp.GetRequiredService(); + this.projectFileUpdater = new ProjectFileUpdater(this.log, this.fileSystem); + } + + [TearDown] + public void Teardown() => this.projectFileUpdater.Dispose(); + + [TestCase("Microsoft.NET.Sdk")] + [TestCase("Microsoft.NET.Sdk.Worker")] + [TestCase("Microsoft.NET.Sdk.Web")] + [TestCase("Microsoft.NET.Sdk.WindowsDesktop")] + [TestCase("Microsoft.NET.Sdk.Razor")] + [TestCase("Microsoft.NET.Sdk.BlazorWebAssembly")] + [TestCase("Microsoft.Build.Sql")] + public void CanUpdateProjectFileWithSdkProjectFileXml(string sdk) + { + var xml = $""" + + + Exe + {TargetFramework} + + + """; + var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); + + canUpdate.ShouldBe(true); + logMessages.ShouldBeEmpty(); + } + + [TestCase($""" + + + Exe + {TargetFramework} + + + """)] + public void CannotUpdateProjectFileWithIncorrectProjectSdk(string xml) + { + var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); + + canUpdate.ShouldBe(false); + + logMessages.ShouldNotBeEmpty(); + logMessages.Count.ShouldBe(1); + logMessages[0].ShouldContain("Specified project file Sdk (SomeOtherProject.Sdk) is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk' or 'Microsoft.Build.Sql'"); + } + + [TestCase($""" + + + Exe + {TargetFramework} + + + """)] + public void CannotUpdateProjectFileWithMissingProjectSdk(string xml) + { + var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); + + canUpdate.ShouldBe(false); + + logMessages.ShouldNotBeEmpty(); + logMessages.Count.ShouldBe(1); + logMessages[0].ShouldContain("Specified project file Sdk () is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk' or 'Microsoft.Build.Sql'"); + } + + [TestCase($""" + + + Exe + {TargetFramework} + false + + + """)] + public void CannotUpdateProjectFileWithoutAssemblyInfoGeneration(string xml) + { + var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); + + canUpdate.ShouldBe(false); + + logMessages.ShouldNotBeEmpty(); + logMessages.Count.ShouldBe(1); + logMessages[0].ShouldContain("Project file specifies false: versions set in this project file will not affect the output artifacts"); + } + + [TestCase(""" + + + """)] + public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) + { + var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); + + canUpdate.ShouldBe(false); + + logMessages.ShouldNotBeEmpty(); + logMessages.Count.ShouldBe(1); + logMessages[0].ShouldContain("Unable to locate any elements in specified project file. Are you sure it is in a correct format?"); + } + + [TestCase($""" + + + Exe + {TargetFramework} + + + """ + )] + public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) + { + var variables = this.variableProvider.GetVariablesFor( + SemanticVersion.Parse("2.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0 + ); + var xmlRoot = XElement.Parse(xml); + variables.AssemblySemVer.ShouldNotBeNull(); + ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); + + const string projectFileContent = $""" + + + Exe + {TargetFramework} + 2.0.0.0 + + + """; + var expectedXml = XElement.Parse(projectFileContent); + xmlRoot.ToString().ShouldBe(expectedXml.ToString()); + } + + [TestCase($""" + + + Exe + {TargetFramework} + 1.0.0.0 + + + """ + )] + public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) + { + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0); + var xmlRoot = XElement.Parse(xml); + variables.AssemblySemVer.ShouldNotBeNull(); + ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); + + const string projectFileContent = $""" + + + Exe + {TargetFramework} + 2.0.0.0 + + + """; + var expectedXml = XElement.Parse(projectFileContent); + xmlRoot.ToString().ShouldBe(expectedXml.ToString()); + } + + [TestCase($""" + + + Exe + {TargetFramework} + 1.0.0.0 + + + 1.0.0.0 + + + """ + )] + public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) + { + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0); + var xmlRoot = XElement.Parse(xml); + variables.AssemblySemVer.ShouldNotBeNull(); + ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); + + const string projectFileContent = $""" + + + Exe + {TargetFramework} + 1.0.0.0 + + + 2.0.0.0 + + + """; + var expectedXml = XElement.Parse(projectFileContent); + xmlRoot.ToString().ShouldBe(expectedXml.ToString()); + } + + [TestCase($""" + + + Exe + {TargetFramework} + 1.0.0.0 + 1.0.0.0 + + + """ + )] + public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) + { + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", RegexPatterns.Configuration.DefaultTagPrefixRegexPattern), EmptyConfigurationBuilder.New.Build(), 0); + var xmlRoot = XElement.Parse(xml); + variables.AssemblySemVer.ShouldNotBeNull(); + ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); + + const string projectFileContent = $""" + + + Exe + {TargetFramework} + 1.0.0.0 + 2.0.0.0 + + + """; + var expectedXml = XElement.Parse(projectFileContent); + xmlRoot.ToString().ShouldBe(expectedXml.ToString()); + } + + [TestCase("Microsoft.NET.Sdk", "TestProject.csproj")] + [TestCase("Microsoft.Build.Sql", "TestProject.sqlproj")] + public void UpdateProjectFileAddsVersionToFile(string sdk, string projectName) + { + var xml = $""" + + + net8.0 + + + """; + var workingDirectory = FileSystemHelper.Path.GetTempPath(); + var fileName = FileSystemHelper.Path.Combine(workingDirectory, projectName); + + VerifyAssemblyInfoFile(xml, fileName, AssemblyVersioningScheme.MajorMinorPatch, (fs, variables) => + { + using var projFileUpdater = new ProjectFileUpdater(this.log, fs); + projFileUpdater.Execute(variables, new(workingDirectory, false, fileName)); + + var expectedXml = $""" + + + {TargetFramework} + 2.3.1.0 + 2.3.1.0 + 2.3.1+3.Branch.foo.Sha.hash + 2.3.1 + + + """; + var transformedXml = fs.File.ReadAllText(fileName); + transformedXml.ShouldBe(XElement.Parse(expectedXml).ToString()); + }); + } + + private void VerifyAssemblyInfoFile( + string projectFileContent, + string fileName, + AssemblyVersioningScheme versioningScheme = AssemblyVersioningScheme.MajorMinorPatch, + Action? verify = null) + { + var file = Substitute.For(); + var version = new SemanticVersion { BuildMetaData = new("versionSourceHash", 3, "foo", "hash", "shortHash", DateTimeOffset.Now, 0), Major = 2, Minor = 3, Patch = 1 }; + + file.Exists(fileName).Returns(true); + file.ReadAllText(fileName).Returns(projectFileContent); + file.When(f => f.WriteAllText(fileName, Arg.Any())).Do(c => + { + projectFileContent = c.ArgAt(1); + file.ReadAllText(fileName).Returns(projectFileContent); + }); + + var configuration = EmptyConfigurationBuilder.New.WithAssemblyVersioningScheme(versioningScheme).Build(); + var variables = this.variableProvider.GetVariablesFor(version, configuration, 0); + + this.fileSystem = Substitute.For(); + this.fileSystem.File.Returns(file); + this.fileSystem.FileInfo.Returns(new FileSystem().FileInfo); + verify?.Invoke(this.fileSystem, variables); + } +} diff --git a/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs b/src/GitVersion.Output.Tests/Output/WixFileTests.cs similarity index 52% rename from src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs rename to src/GitVersion.Output.Tests/Output/WixFileTests.cs index 3e5758bb81..1fff03bd17 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs +++ b/src/GitVersion.Output.Tests/Output/WixFileTests.cs @@ -1,11 +1,11 @@ +using System.IO.Abstractions; +using GitVersion.Configuration; using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; using GitVersion.Logging; +using GitVersion.Output.WixUpdater; using GitVersion.VersionCalculation; -using GitVersion.VersionConverters.WixUpdater; using Microsoft.Extensions.DependencyInjection; -using NUnit.Framework; -using Shouldly; namespace GitVersion.Core.Tests; @@ -13,32 +13,35 @@ namespace GitVersion.Core.Tests; [Parallelizable(ParallelScope.None)] internal class WixFileTests : TestBase { + private string workingDir; + + [OneTimeSetUp] + public void OneTimeSetUp() => workingDir = FileSystemHelper.Path.Combine(FileSystemHelper.Path.GetTempPath(), "WixFileTests"); + + [OneTimeTearDown] + public void OneTimeTearDown() => FileSystemHelper.Directory.DeleteDirectory(workingDir); + [SetUp] public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateWixVersionFile() { - var workingDir = Path.GetTempPath(); var semVer = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.develop" + BuildMetaData = new("5.Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2019-02-20 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2019-02-20 23:59:59Z"); - - var config = new TestEffectiveConfiguration(buildMetaDataPadding: 2, legacySemVerPadding: 5); - var stringBuilder = new StringBuilder(); - void Action(string s) => stringBuilder.AppendLine(s); var logAppender = new TestLogAppender(Action); var log = new Log(logAppender); @@ -47,41 +50,39 @@ public void UpdateWixVersionFile() var fileSystem = sp.GetRequiredService(); var variableProvider = sp.GetRequiredService(); - var versionVariables = variableProvider.GetVariablesFor(semVer, config, false); + var versionVariables = variableProvider.GetVariablesFor(semVer, EmptyConfigurationBuilder.New.Build(), 0); using var wixVersionFileUpdater = sp.GetRequiredService(); - wixVersionFileUpdater.Execute(versionVariables, new WixVersionContext(workingDir)); + wixVersionFileUpdater.Execute(versionVariables, new(workingDir)); - var file = PathHelper.Combine(workingDir, WixVersionFileUpdater.WixVersionFileName); + var file = FileSystemHelper.Path.Combine(workingDir, WixVersionFileUpdater.WixVersionFileName); fileSystem - .ReadAllText(file) - .ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved"))); + .File.ReadAllText(file) + .ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved"))); + return; + + void Action(string s) => stringBuilder.AppendLine(s); } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateWixVersionFileWhenFileAlreadyExists() { - var workingDir = Path.GetTempPath(); var semVer = new SemanticVersion { Major = 1, Minor = 2, Patch = 3, - BuildMetaData = "5.Branch.develop" + BuildMetaData = new("5.Branch.develop") + { + VersionSourceSha = "versionSourceSha", + Sha = "commitSha", + ShortSha = "commitShortSha", + CommitDate = DateTimeOffset.Parse("2019-02-20 23:59:59Z") + } }; - semVer.BuildMetaData.VersionSourceSha = "versionSourceSha"; - semVer.BuildMetaData.Sha = "commitSha"; - semVer.BuildMetaData.ShortSha = "commitShortSha"; - semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2019-02-20 23:59:59Z"); - - var config = new TestEffectiveConfiguration(buildMetaDataPadding: 2, legacySemVerPadding: 5); - var stringBuilder = new StringBuilder(); - void Action(string s) => stringBuilder.AppendLine(s); var logAppender = new TestLogAppender(Action); var log = new Log(logAppender); @@ -90,19 +91,25 @@ public void UpdateWixVersionFileWhenFileAlreadyExists() var fileSystem = sp.GetRequiredService(); var variableProvider = sp.GetRequiredService(); - var versionVariables = variableProvider.GetVariablesFor(semVer, config, false); + var versionVariables = variableProvider.GetVariablesFor(semVer, EmptyConfigurationBuilder.New.Build(), 0); using var wixVersionFileUpdater = sp.GetRequiredService(); // fake an already existing file - var file = PathHelper.Combine(workingDir, WixVersionFileUpdater.WixVersionFileName); - fileSystem.WriteAllText(file, new string('x', 1024 * 1024)); + var file = FileSystemHelper.Path.Combine(workingDir, WixVersionFileUpdater.WixVersionFileName); + if (!fileSystem.Directory.Exists(workingDir)) + { + fileSystem.Directory.CreateDirectory(workingDir); + } + fileSystem.File.WriteAllText(file, new('x', 1024 * 1024)); - wixVersionFileUpdater.Execute(versionVariables, new WixVersionContext(workingDir)); + wixVersionFileUpdater.Execute(versionVariables, new(workingDir)); fileSystem - .ReadAllText(file) - .ShouldMatchApproved(c => c.SubFolder(PathHelper.Combine("Approved"))); - } + .File.ReadAllText(file) + .ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved"))); + return; + void Action(string s) => stringBuilder.AppendLine(s); + } } diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.cs b/src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.cs similarity index 100% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.cs rename to src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.cs diff --git a/src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs b/src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs new file mode 100644 index 0000000000..d687f8e2f0 --- /dev/null +++ b/src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.fs @@ -0,0 +1 @@ +[] diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.vb b/src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.vb similarity index 100% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/AddFormats/VersionAssemblyInfo.vb rename to src/GitVersion.Output/AssemblyInfo/AddFormats/VersionAssemblyInfo.vb diff --git a/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs new file mode 100644 index 0000000000..c8e51572dd --- /dev/null +++ b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs @@ -0,0 +1,4 @@ +namespace GitVersion.Output.AssemblyInfo; + +internal readonly record struct AssemblyInfoContext(string WorkingDirectory, bool EnsureAssemblyInfo, params string[] AssemblyInfoFiles) + : IConverterContext; diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoFileUpdater.cs b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs similarity index 60% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoFileUpdater.cs rename to src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs index c2e64710a6..3b531597ee 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/AssemblyInfoFileUpdater.cs +++ b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs @@ -1,49 +1,36 @@ +using System.IO.Abstractions; using System.Text.RegularExpressions; +using GitVersion.Core; using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.VersionConverters.AssemblyInfo; +namespace GitVersion.Output.AssemblyInfo; -public interface IAssemblyInfoFileUpdater : IVersionConverter -{ -} +internal interface IAssemblyInfoFileUpdater : IVersionConverter; -public sealed class AssemblyInfoFileUpdater : IAssemblyInfoFileUpdater +internal sealed class AssemblyInfoFileUpdater(ILog log, IFileSystem fileSystem) : IAssemblyInfoFileUpdater { - private readonly List restoreBackupTasks = new(); - private readonly List cleanupBackupTasks = new(); + private readonly List restoreBackupTasks = []; + private readonly List cleanupBackupTasks = []; - private readonly IDictionary assemblyAttributeRegexes = new Dictionary + private readonly Dictionary assemblyAttributeRegexes = new() { - {".cs", new Regex( @"(\s*\[\s*assembly:\s*(?:.*)\s*\]\s*$(\r?\n)?)", RegexOptions.Multiline) }, - {".fs", new Regex( @"(\s*\[\s*\\s*\]\s*$(\r?\n)?)", RegexOptions.Multiline) }, - {".vb", new Regex( @"(\s*\\s*$(\r?\n)?)", RegexOptions.Multiline) } + [".cs"] = RegexPatterns.Output.CsharpAssemblyAttributeRegex(), + [".fs"] = RegexPatterns.Output.FsharpAssemblyAttributeRegex(), + [".vb"] = RegexPatterns.Output.VisualBasicAssemblyAttributeRegex() }; - private readonly Regex assemblyVersionRegex = new(@"AssemblyVersion(Attribute)?\s*\(.*\)\s*"); - private readonly Regex assemblyInfoVersionRegex = new(@"AssemblyInformationalVersion(Attribute)?\s*\(.*\)\s*"); - private readonly Regex assemblyFileVersionRegex = new(@"AssemblyFileVersion(Attribute)?\s*\(.*\)\s*"); - private const string NewLine = "\r\n"; - private readonly IFileSystem fileSystem; - private readonly ILog log; - private readonly TemplateManager templateManager; - - public AssemblyInfoFileUpdater(ILog log, IFileSystem fileSystem) - { - this.fileSystem = fileSystem; - this.log = log; - this.templateManager = new TemplateManager(TemplateType.AssemblyInfo); - } + private readonly TemplateManager templateManager = new(TemplateType.AssemblyInfo); - public void Execute(VersionVariables variables, AssemblyInfoContext context) + public void Execute(GitVersionVariables variables, AssemblyInfoContext context) { var assemblyInfoFiles = GetAssemblyInfoFiles(context).ToList(); - this.log.Info("Updating assembly info files"); - this.log.Info($"Found {assemblyInfoFiles.Count} files"); + log.Info("Updating assembly info files"); + log.Info($"Found {assemblyInfoFiles.Count} files"); var assemblyVersion = variables.AssemblySemVer; var assemblyVersionString = !assemblyVersion.IsNullOrWhiteSpace() ? $"AssemblyVersion(\"{assemblyVersion}\")" : null; @@ -58,37 +45,37 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) { var localAssemblyInfo = assemblyInfoFile.FullName; var backupAssemblyInfo = localAssemblyInfo + ".bak"; - this.fileSystem.Copy(localAssemblyInfo, backupAssemblyInfo, true); + fileSystem.File.Copy(localAssemblyInfo, backupAssemblyInfo, true); this.restoreBackupTasks.Add(() => { - if (this.fileSystem.Exists(localAssemblyInfo)) + if (fileSystem.File.Exists(localAssemblyInfo)) { - this.fileSystem.Delete(localAssemblyInfo); + fileSystem.File.Delete(localAssemblyInfo); } - this.fileSystem.Move(backupAssemblyInfo, localAssemblyInfo); + fileSystem.File.Move(backupAssemblyInfo, localAssemblyInfo); }); - this.cleanupBackupTasks.Add(() => this.fileSystem.Delete(backupAssemblyInfo)); + this.cleanupBackupTasks.Add(() => fileSystem.File.Delete(backupAssemblyInfo)); - var originalFileContents = this.fileSystem.ReadAllText(localAssemblyInfo); + var originalFileContents = fileSystem.File.ReadAllText(localAssemblyInfo); var fileContents = originalFileContents; var appendedAttributes = false; if (!assemblyVersion.IsNullOrWhiteSpace()) { - fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(this.assemblyVersionRegex, fileContents, assemblyVersionString, assemblyInfoFile.Extension, ref appendedAttributes); + fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(RegexPatterns.Output.AssemblyVersionRegex(), fileContents, assemblyVersionString, assemblyInfoFile.Extension, ref appendedAttributes); } if (!assemblyFileVersion.IsNullOrWhiteSpace()) { - fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(this.assemblyFileVersionRegex, fileContents, assemblyFileVersionString, assemblyInfoFile.Extension, ref appendedAttributes); + fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(RegexPatterns.Output.AssemblyFileVersionRegex(), fileContents, assemblyFileVersionString, assemblyInfoFile.Extension, ref appendedAttributes); } if (!assemblyInfoVersion.IsNullOrWhiteSpace()) { - fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(this.assemblyInfoVersionRegex, fileContents, assemblyInfoVersionString, assemblyInfoFile.Extension, ref appendedAttributes); + fileContents = ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(RegexPatterns.Output.AssemblyInfoVersionRegex(), fileContents, assemblyInfoVersionString, assemblyInfoFile.Extension, ref appendedAttributes); } if (appendedAttributes) @@ -99,7 +86,7 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) if (originalFileContents != fileContents) { - this.fileSystem.WriteAllText(localAssemblyInfo, fileContents); + fileSystem.File.WriteAllText(localAssemblyInfo, fileContents); } } CommitChanges(); @@ -141,7 +128,7 @@ private string ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(Regex replaceRe var assemblyMatches = assemblyRegex.Matches(inputString); if (assemblyMatches.Count > 0) { - var lastMatch = assemblyMatches[assemblyMatches.Count - 1]; + var lastMatch = assemblyMatches[^1]; var replacementString = lastMatch.Value; if (!lastMatch.Value.EndsWith(NewLine)) replacementString += NewLine; if (assemblyAddFormat != null) @@ -157,7 +144,7 @@ private string ReplaceOrInsertAfterLastAssemblyAttributeOrAppend(Regex replaceRe return inputString; } - private IEnumerable GetAssemblyInfoFiles(AssemblyInfoContext context) + private IEnumerable GetAssemblyInfoFiles(AssemblyInfoContext context) { var workingDirectory = context.WorkingDirectory; var ensureAssemblyInfo = context.EnsureAssemblyInfo; @@ -167,19 +154,19 @@ private IEnumerable GetAssemblyInfoFiles(AssemblyInfoContext context) { foreach (var item in assemblyInfoFileNames) { - var fullPath = PathHelper.Combine(workingDirectory, item); + var fullPath = FileSystemHelper.Path.Combine(workingDirectory, item); if (EnsureVersionAssemblyInfoFile(fullPath, ensureAssemblyInfo)) { - yield return new FileInfo(fullPath); + yield return fileSystem.FileInfo.New(fullPath); } } } else { - foreach (var item in this.fileSystem.DirectoryEnumerateFiles(workingDirectory, "AssemblyInfo.*", SearchOption.AllDirectories)) + foreach (var item in fileSystem.Directory.EnumerateFiles(workingDirectory, "AssemblyInfo.*", SearchOption.AllDirectories)) { - var assemblyInfoFile = new FileInfo(item); + var assemblyInfoFile = fileSystem.FileInfo.New(item); if (this.templateManager.IsSupported(assemblyInfoFile.Extension)) { @@ -192,7 +179,7 @@ private IEnumerable GetAssemblyInfoFiles(AssemblyInfoContext context) private bool EnsureVersionAssemblyInfoFile(string fullPath, bool ensureAssemblyInfo) { fullPath = fullPath.NotNull(); - if (this.fileSystem.Exists(fullPath)) + if (fileSystem.File.Exists(fullPath)) { return true; } @@ -202,22 +189,22 @@ private bool EnsureVersionAssemblyInfoFile(string fullPath, bool ensureAssemblyI return false; } - var assemblyInfoSource = this.templateManager.GetTemplateFor(Path.GetExtension(fullPath)); + var assemblyInfoSource = this.templateManager.GetTemplateFor(FileSystemHelper.Path.GetExtension(fullPath)); if (!assemblyInfoSource.IsNullOrWhiteSpace()) { - var fileInfo = new FileInfo(fullPath); + var fileInfo = fileSystem.FileInfo.New(fullPath); - if (fileInfo.Directory != null && !this.fileSystem.DirectoryExists(fileInfo.Directory.FullName)) + if (fileInfo.Directory != null && !fileSystem.Directory.Exists(fileInfo.Directory.FullName)) { - this.fileSystem.CreateDirectory(fileInfo.Directory.FullName); + fileSystem.Directory.CreateDirectory(fileInfo.Directory.FullName); } - this.fileSystem.WriteAllText(fullPath, assemblyInfoSource); + fileSystem.File.WriteAllText(fullPath, assemblyInfoSource); return true; } - this.log.Warning($"No version assembly info template available to create source file '{fullPath}'"); + log.Warning($"No version assembly info template available to create source file '{fullPath}'"); return false; } } diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs b/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs similarity index 61% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs rename to src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs index 3670157dc1..4c362568fa 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs +++ b/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs @@ -1,36 +1,27 @@ +using System.IO.Abstractions; using System.Xml.Linq; using GitVersion.Extensions; using GitVersion.Helpers; using GitVersion.Logging; using GitVersion.OutputVariables; -namespace GitVersion.VersionConverters.AssemblyInfo; +namespace GitVersion.Output.AssemblyInfo; -public interface IProjectFileUpdater : IVersionConverter -{ - bool CanUpdateProjectFile(XElement xmlRoot); -} +internal interface IProjectFileUpdater : IVersionConverter; -public sealed class ProjectFileUpdater : IProjectFileUpdater +internal sealed class ProjectFileUpdater(ILog log, IFileSystem fileSystem) : IProjectFileUpdater { internal const string AssemblyVersionElement = "AssemblyVersion"; + + private const int DefaultMaxRecursionDepth = 255; private const string FileVersionElement = "FileVersion"; private const string InformationalVersionElement = "InformationalVersion"; private const string VersionElement = "Version"; - private readonly List restoreBackupTasks = new(); - private readonly List cleanupBackupTasks = new(); - - private readonly IFileSystem fileSystem; - private readonly ILog log; - - public ProjectFileUpdater(ILog log, IFileSystem fileSystem) - { - this.fileSystem = fileSystem; - this.log = log; - } + private readonly List restoreBackupTasks = []; + private readonly List cleanupBackupTasks = []; - public void Execute(VersionVariables variables, AssemblyInfoContext context) + public void Execute(GitVersionVariables variables, AssemblyInfoContext context) { if (context.EnsureAssemblyInfo) throw new WarningException($"Configuration setting {nameof(context.EnsureAssemblyInfo)} is not valid when updating project files!"); @@ -40,13 +31,13 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) var assemblyVersion = variables.AssemblySemVer; var assemblyInfoVersion = variables.InformationalVersion; var assemblyFileVersion = variables.AssemblySemFileVer; - var packageVersion = variables.NuGetVersion; + var packageVersion = variables.SemVer; foreach (var projectFile in projectFilesToUpdate) { var localProjectFile = projectFile.FullName; - var originalFileContents = this.fileSystem.ReadAllText(localProjectFile); + var originalFileContents = fileSystem.File.ReadAllText(localProjectFile); XElement fileXml; try { @@ -59,26 +50,26 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) if (!CanUpdateProjectFile(fileXml)) { - this.log.Warning($"Unable to update file: {localProjectFile}"); + log.Warning($"Unable to update file: {localProjectFile}"); continue; } - this.log.Debug($"Update file: {localProjectFile}"); + log.Debug($"Update file: {localProjectFile}"); var backupProjectFile = localProjectFile + ".bak"; - this.fileSystem.Copy(localProjectFile, backupProjectFile, true); + fileSystem.File.Copy(localProjectFile, backupProjectFile, true); this.restoreBackupTasks.Add(() => { - if (this.fileSystem.Exists(localProjectFile)) + if (fileSystem.File.Exists(localProjectFile)) { - this.fileSystem.Delete(localProjectFile); + fileSystem.File.Delete(localProjectFile); } - this.fileSystem.Move(backupProjectFile, localProjectFile); + fileSystem.File.Move(backupProjectFile, localProjectFile); }); - this.cleanupBackupTasks.Add(() => this.fileSystem.Delete(backupProjectFile)); + this.cleanupBackupTasks.Add(() => fileSystem.File.Delete(backupProjectFile)); if (!assemblyVersion.IsNullOrWhiteSpace()) { @@ -103,7 +94,7 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) var outputXmlString = fileXml.ToString(); if (originalFileContents != outputXmlString) { - this.fileSystem.WriteAllText(localProjectFile, outputXmlString); + fileSystem.File.WriteAllText(localProjectFile, outputXmlString); } } @@ -114,32 +105,29 @@ public bool CanUpdateProjectFile(XElement xmlRoot) { if (xmlRoot.Name != "Project") { - this.log.Warning("Invalid project file specified, root element must be ."); + log.Warning("Invalid project file specified, root element must be ."); return false; } var sdkAttribute = xmlRoot.Attribute("Sdk"); - if (sdkAttribute == null || !sdkAttribute.Value.StartsWith("Microsoft.NET.Sdk")) + if (sdkAttribute?.Value.StartsWith("Microsoft.NET.Sdk") != true && + sdkAttribute?.Value.StartsWith("Microsoft.Build.Sql") != true) { - this.log.Warning($"Specified project file Sdk ({sdkAttribute?.Value}) is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk'"); + log.Warning($"Specified project file Sdk ({sdkAttribute?.Value}) is not supported, please ensure the project sdk starts with 'Microsoft.NET.Sdk' or 'Microsoft.Build.Sql'"); return false; } var propertyGroups = xmlRoot.Descendants("PropertyGroup").ToList(); - if (!propertyGroups.Any()) + if (propertyGroups.Count == 0) { - this.log.Warning("Unable to locate any elements in specified project file. Are you sure it is in a correct format?"); + log.Warning("Unable to locate any elements in specified project file. Are you sure it is in a correct format?"); return false; } var lastGenerateAssemblyInfoElement = propertyGroups.SelectMany(s => s.Elements("GenerateAssemblyInfo")).LastOrDefault(); - if (lastGenerateAssemblyInfoElement != null && (bool)lastGenerateAssemblyInfoElement == false) - { - this.log.Warning("Project file specifies false: versions set in this project file will not affect the output artifacts."); - return false; - } - - return true; + if (lastGenerateAssemblyInfoElement == null || (bool)lastGenerateAssemblyInfoElement) return true; + log.Warning("Project file specifies false: versions set in this project file will not affect the output artifacts."); + return false; } internal static void UpdateProjectVersionElement(XElement xmlRoot, string versionElement, string versionValue) @@ -147,7 +135,7 @@ internal static void UpdateProjectVersionElement(XElement xmlRoot, string versio var propertyGroups = xmlRoot.Descendants("PropertyGroup").ToList(); var propertyGroupToModify = propertyGroups.LastOrDefault(l => l.Element(versionElement) != null) - ?? propertyGroups.First(); + ?? propertyGroups[0]; var versionXmlElement = propertyGroupToModify.Elements(versionElement).LastOrDefault(); if (versionXmlElement != null) @@ -182,7 +170,7 @@ private void CommitChanges() this.restoreBackupTasks.Clear(); } - private IEnumerable GetProjectFiles(AssemblyInfoContext context) + private IEnumerable GetProjectFiles(AssemblyInfoContext context) { var workingDirectory = context.WorkingDirectory; var assemblyInfoFileNames = new HashSet(context.AssemblyInfoFiles); @@ -191,25 +179,32 @@ private IEnumerable GetProjectFiles(AssemblyInfoContext context) { foreach (var item in assemblyInfoFileNames) { - var fullPath = PathHelper.Combine(workingDirectory, item); + var fullPath = FileSystemHelper.Path.Combine(workingDirectory, item); - if (this.fileSystem.Exists(fullPath)) + if (fileSystem.File.Exists(fullPath)) { - yield return new FileInfo(fullPath); + yield return fileSystem.FileInfo.New(fullPath); } else { - this.log.Warning($"Specified file {fullPath} was not found and will not be updated."); + log.Warning($"Specified file {fullPath} was not found and will not be updated."); } } } else { - foreach (var item in this.fileSystem.DirectoryEnumerateFiles(workingDirectory, "*", SearchOption.AllDirectories).Where(IsSupportedProjectFile)) + var options = new EnumerationOptions { - var assemblyInfoFile = new FileInfo(item); - - yield return assemblyInfoFile; + RecurseSubdirectories = true, + MaxRecursionDepth = DefaultMaxRecursionDepth + }; + var projectFiles = fileSystem.Directory + .EnumerateFiles(workingDirectory, "*proj", options) + .Where(IsSupportedProjectFile); + + foreach (var projectFile in projectFiles) + { + yield return fileSystem.FileInfo.New(projectFile); } } } @@ -223,6 +218,7 @@ private static bool IsSupportedProjectFile(string fileName) return fileName.EndsWith(".csproj") || fileName.EndsWith(".fsproj") || - fileName.EndsWith(".vbproj"); + fileName.EndsWith(".vbproj") || + fileName.EndsWith(".sqlproj"); } } diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.cs b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.cs similarity index 83% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.cs rename to src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.cs index e0f419a1ac..6442e79b39 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.cs +++ b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by GitVersion. // diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.fs b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.fs similarity index 84% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.fs rename to src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.fs index ebd55a3786..0092ac3bb7 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.fs +++ b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.fs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by GitVersion. // diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.vb b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.vb similarity index 83% rename from src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.vb rename to src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.vb index a7689fa90f..d8a506e8c6 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/Templates/VersionAssemblyInfo.vb +++ b/src/GitVersion.Output/AssemblyInfo/Templates/VersionAssemblyInfo.vb @@ -1,4 +1,4 @@ -''------------------------------------------------------------------------------ +''------------------------------------------------------------------------------ '' '' This code was generated by GitVersion. '' diff --git a/src/GitVersion.Output/GitVersion.Output.csproj b/src/GitVersion.Output/GitVersion.Output.csproj new file mode 100644 index 0000000000..179b5e8198 --- /dev/null +++ b/src/GitVersion.Output/GitVersion.Output.csproj @@ -0,0 +1,28 @@ + + + + GITVERSION_OUTPUT + + + + + + + + + + + Attributes\JsonPropertyDescriptionAttribute.cs + + + + + + + + + + + + + diff --git a/src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.cs b/src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.cs new file mode 100644 index 0000000000..56f191a449 --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.cs @@ -0,0 +1 @@ +public const string {0} = "{1}"; diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.fs b/src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.fs similarity index 100% rename from src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.fs rename to src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.fs diff --git a/src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.vb b/src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.vb similarity index 100% rename from src/GitVersion.Core/VersionConverters/GitVersionInfo/AddFormats/GitVersionInformation.vb rename to src/GitVersion.Output/GitVersionInfo/AddFormats/GitVersionInformation.vb diff --git a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs new file mode 100644 index 0000000000..02973b293f --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs @@ -0,0 +1,7 @@ +namespace GitVersion.Output.GitVersionInfo; + +internal readonly record struct GitVersionInfoContext( + string WorkingDirectory, + string FileName, + string? TargetNamespace = null) + : IConverterContext; diff --git a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs new file mode 100644 index 0000000000..9056e51092 --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs @@ -0,0 +1,85 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.OutputVariables; + +namespace GitVersion.Output.GitVersionInfo; + +internal interface IGitVersionInfoGenerator : IVersionConverter; + +internal sealed class GitVersionInfoGenerator(IFileSystem fileSystem) : IGitVersionInfoGenerator +{ + private const string targetNamespaceSentinelValue = ""; + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly TemplateManager templateManager = new(TemplateType.GitVersionInfo); + + public void Execute(GitVersionVariables variables, GitVersionInfoContext context) + { + var fileName = context.FileName; + var directory = context.WorkingDirectory; + var filePath = FileSystemHelper.Path.Combine(directory, fileName); + + string? originalFileContents = null; + + if (this.fileSystem.File.Exists(filePath)) + { + originalFileContents = this.fileSystem.File.ReadAllText(filePath); + } + + var fileExtension = FileSystemHelper.Path.GetExtension(filePath); + ArgumentNullException.ThrowIfNull(fileExtension); + + var template = this.templateManager.GetTemplateFor(fileExtension); + var addFormat = this.templateManager.GetAddFormatFor(fileExtension); + var targetNamespace = getTargetNamespace(fileExtension); + + if (string.IsNullOrWhiteSpace(template) || string.IsNullOrWhiteSpace(addFormat) || targetNamespace == targetNamespaceSentinelValue) + return; + + var indentation = GetIndentation(fileExtension); + string? closeBracket = null; + string? openBracket = null; + var indent = ""; + + if (!string.IsNullOrWhiteSpace(targetNamespace) && fileExtension == ".cs") + { + indent = " "; + closeBracket = FileSystemHelper.Path.NewLine + "}"; + openBracket = FileSystemHelper.Path.NewLine + "{"; + indentation += " "; + } + + var lines = variables.OrderBy(x => x.Key).Select(v => string.Format(indentation + addFormat, v.Key, v.Value)); + var members = string.Join(FileSystemHelper.Path.NewLine, lines); + + var fileContents = string.Format(template, members, targetNamespace, openBracket, closeBracket, indent); + + if (fileContents != originalFileContents) + { + this.fileSystem.File.WriteAllText(filePath, fileContents); + } + + return; + + string getTargetNamespace(string? extension) => extension switch + { + ".vb" => context.TargetNamespace ?? "Global", + ".cs" => context.TargetNamespace != null ? $"{FileSystemHelper.Path.NewLine}namespace {context.TargetNamespace}" : "", + ".fs" => context.TargetNamespace ?? "global", + _ => targetNamespaceSentinelValue + }; + } + + public void Dispose() + { + } + + // Because The VB-generated class is included in a namespace declaration, + // the properties must be offset by 2 tabs. + // Whereas in the C# and F# cases, 1 tab is enough. + private static string GetIndentation(string fileExtension) + { + var tabs = fileExtension.EndsWith("vb", StringComparison.InvariantCultureIgnoreCase) ? 2 : 1; + return new string(' ', tabs * 4); + } +} diff --git a/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.cs b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.cs new file mode 100644 index 0000000000..46527b8ca3 --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GitVersion +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +{1}{2} +{4}[global::System.Runtime.CompilerServices.CompilerGenerated] +{4}[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +{4}static class GitVersionInformation +{4}{{ +{0} +{4}}}{3} diff --git a/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.fs b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.fs new file mode 100644 index 0000000000..5fff544676 --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.fs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GitVersion +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace {1} + +[] +[] +[] +type GitVersionInformation = +{0} diff --git a/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.vb b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.vb new file mode 100644 index 0000000000..48105ab7ce --- /dev/null +++ b/src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.vb @@ -0,0 +1,21 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' GitVersion +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Namespace {1} + + + + NotInheritable Class GitVersionInformation + Private Sub New() + End Sub +{0} + End Class + +End Namespace diff --git a/src/GitVersion.Core/VersionConverters/VersionConvertersModule.cs b/src/GitVersion.Output/GitVersionOutputModule.cs similarity index 54% rename from src/GitVersion.Core/VersionConverters/VersionConvertersModule.cs rename to src/GitVersion.Output/GitVersionOutputModule.cs index 938c3a2f13..3787e1b9e2 100644 --- a/src/GitVersion.Core/VersionConverters/VersionConvertersModule.cs +++ b/src/GitVersion.Output/GitVersionOutputModule.cs @@ -1,16 +1,19 @@ -using GitVersion.VersionConverters.AssemblyInfo; -using GitVersion.VersionConverters.GitVersionInfo; -using GitVersion.VersionConverters.OutputGenerator; -using GitVersion.VersionConverters.WixUpdater; +using GitVersion.Output.AssemblyInfo; +using GitVersion.Output.GitVersionInfo; +using GitVersion.Output.OutputGenerator; +using GitVersion.Output.WixUpdater; +using GitVersion.OutputVariables; using Microsoft.Extensions.DependencyInjection; -namespace GitVersion.VersionConverters; +namespace GitVersion.Output; -public class VersionConvertersModule : IGitVersionModule +public class GitVersionOutputModule : IGitVersionModule { public void RegisterTypes(IServiceCollection services) { + services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/GitVersion.Output/GitVersionOutputTool.cs b/src/GitVersion.Output/GitVersionOutputTool.cs new file mode 100644 index 0000000000..76dac75b27 --- /dev/null +++ b/src/GitVersion.Output/GitVersionOutputTool.cs @@ -0,0 +1,71 @@ +using GitVersion.Extensions; +using GitVersion.Output.AssemblyInfo; +using GitVersion.Output.GitVersionInfo; +using GitVersion.Output.OutputGenerator; +using GitVersion.Output.WixUpdater; +using GitVersion.OutputVariables; +using Microsoft.Extensions.Options; + +namespace GitVersion; + +internal class GitVersionOutputTool( + IOptions options, + IOutputGenerator outputGenerator, + IWixVersionFileUpdater wixVersionFileUpdater, + IGitVersionInfoGenerator gitVersionInfoGenerator, + IAssemblyInfoFileUpdater assemblyInfoFileUpdater, + IProjectFileUpdater projectFileUpdater) + : IGitVersionOutputTool +{ + private readonly GitVersionOptions gitVersionOptions = options.Value.NotNull(); + private readonly IOutputGenerator outputGenerator = outputGenerator.NotNull(); + private readonly IWixVersionFileUpdater wixVersionFileUpdater = wixVersionFileUpdater.NotNull(); + private readonly IGitVersionInfoGenerator gitVersionInfoGenerator = gitVersionInfoGenerator.NotNull(); + private readonly IAssemblyInfoFileUpdater assemblyInfoFileUpdater = assemblyInfoFileUpdater.NotNull(); + private readonly IProjectFileUpdater projectFileUpdater = projectFileUpdater.NotNull(); + + public void OutputVariables(GitVersionVariables variables, bool updateBuildNumber) + { + using (this.outputGenerator) + { + this.outputGenerator.Execute(variables, new OutputContext(gitVersionOptions.OutputFile, updateBuildNumber)); + } + } + + public void UpdateAssemblyInfo(GitVersionVariables variables) + { + var assemblyInfoContext = new AssemblyInfoContext(gitVersionOptions.WorkingDirectory, gitVersionOptions.AssemblySettingsInfo.EnsureAssemblyInfo, [.. gitVersionOptions.AssemblySettingsInfo.Files]); + + if (gitVersionOptions.AssemblySettingsInfo.UpdateProjectFiles) + { + using (this.projectFileUpdater) + { + this.projectFileUpdater.Execute(variables, assemblyInfoContext); + } + } + else if (gitVersionOptions.AssemblySettingsInfo.UpdateAssemblyInfo) + { + using (this.assemblyInfoFileUpdater) + { + this.assemblyInfoFileUpdater.Execute(variables, assemblyInfoContext); + } + } + } + + public void UpdateWixVersionFile(GitVersionVariables variables) + { + if (!this.gitVersionOptions.WixInfo.UpdateWixVersionFile) return; + using (this.wixVersionFileUpdater) + { + this.wixVersionFileUpdater.Execute(variables, new WixVersionContext(this.gitVersionOptions.WorkingDirectory)); + } + } + + public void GenerateGitVersionInformation(GitVersionVariables variables, FileWriteInfo fileWriteInfo, string? targetNamespace = null) + { + using (this.gitVersionInfoGenerator) + { + this.gitVersionInfoGenerator.Execute(variables, new GitVersionInfoContext(gitVersionOptions.WorkingDirectory, fileWriteInfo.FileName, targetNamespace)); + } + } +} diff --git a/src/GitVersion.Output/IGitVersionOutputTool.cs b/src/GitVersion.Output/IGitVersionOutputTool.cs new file mode 100644 index 0000000000..16654a01c6 --- /dev/null +++ b/src/GitVersion.Output/IGitVersionOutputTool.cs @@ -0,0 +1,11 @@ +using GitVersion.OutputVariables; + +namespace GitVersion; + +public interface IGitVersionOutputTool +{ + void OutputVariables(GitVersionVariables variables, bool updateBuildNumber); + void UpdateAssemblyInfo(GitVersionVariables variables); + void UpdateWixVersionFile(GitVersionVariables variables); + void GenerateGitVersionInformation(GitVersionVariables variables, FileWriteInfo fileWriteInfo, string? targetNamespace = null); +} diff --git a/src/GitVersion.Output/OutputGenerator/OutputContext.cs b/src/GitVersion.Output/OutputGenerator/OutputContext.cs new file mode 100644 index 0000000000..25791385b5 --- /dev/null +++ b/src/GitVersion.Output/OutputGenerator/OutputContext.cs @@ -0,0 +1,3 @@ +namespace GitVersion.Output.OutputGenerator; + +internal readonly record struct OutputContext(string? OutputFile, bool? UpdateBuildNumber) : IConverterContext; diff --git a/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs b/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs new file mode 100644 index 0000000000..971e165c70 --- /dev/null +++ b/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs @@ -0,0 +1,122 @@ +using System.IO.Abstractions; +using GitVersion.Agents; +using GitVersion.Extensions; +using GitVersion.Formatting; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.OutputVariables; +using Microsoft.Extensions.Options; + +namespace GitVersion.Output.OutputGenerator; + +internal interface IOutputGenerator : IVersionConverter; + +internal sealed class OutputGenerator( + ICurrentBuildAgent buildAgent, + IConsole console, + IFileSystem fileSystem, + IVersionVariableSerializer serializer, + IEnvironment environment, + IOptions options) + : IOutputGenerator +{ + private readonly IConsole console = console.NotNull(); + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly IVersionVariableSerializer serializer = serializer.NotNull(); + private readonly IOptions options = options.NotNull(); + private readonly ICurrentBuildAgent buildAgent = buildAgent.NotNull(); + + public void Execute(GitVersionVariables variables, OutputContext context) + { + var gitVersionOptions = this.options.Value; + + if (gitVersionOptions.Output.Contains(OutputType.BuildServer)) + { + this.buildAgent.WriteIntegration(this.console.WriteLine, variables, context.UpdateBuildNumber ?? true); + } + + if (gitVersionOptions.Output.Contains(OutputType.DotEnv)) + { + List dotEnvEntries = []; + foreach (var (key, value) in variables.OrderBy(x => x.Key)) + { + var prefixedKey = "GitVersion_" + key; + var environmentValue = ""; + if (!value.IsNullOrEmpty()) + { + environmentValue = value; + } + dotEnvEntries.Add($"{prefixedKey}='{environmentValue}'"); + } + + foreach (var dotEnvEntry in dotEnvEntries) + { + this.console.WriteLine(dotEnvEntry); + } + + return; + } + + var json = this.serializer.ToJson(variables); + if (gitVersionOptions.Output.Contains(OutputType.File)) + { + var retryOperation = new RetryAction(); + retryOperation.Execute(() => + { + if (context.OutputFile != null) this.fileSystem.File.WriteAllText(context.OutputFile, json); + }); + } + + if (!gitVersionOptions.Output.Contains(OutputType.Json)) return; + + if (gitVersionOptions.ShowVariable is null && gitVersionOptions.Format is null) + { + this.console.WriteLine(json); + return; + } + + if (gitVersionOptions.ShowVariable is not null && gitVersionOptions.Format is not null) + { + throw new WarningException("Cannot specify both /showvariable and /format"); + } + + if (gitVersionOptions.ShowVariable is not null) + { + if (!variables.TryGetValue(gitVersionOptions.ShowVariable, out var part)) + { + throw new WarningException($"'{gitVersionOptions.ShowVariable}' variable does not exist"); + } + + this.console.WriteLine(part); + return; + } + + if (gitVersionOptions.Format is not null) + { + var format = gitVersionOptions.Format; + var formatted = format.FormatWith(variables, environment); + this.console.WriteLine(formatted); + return; + } + + switch (gitVersionOptions.ShowVariable) + { + case null: + this.console.WriteLine(variables.ToString()); + break; + + default: + if (!variables.TryGetValue(gitVersionOptions.ShowVariable, out var part)) + { + throw new WarningException($"'{gitVersionOptions.ShowVariable}' variable does not exist"); + } + + this.console.WriteLine(part); + break; + } + } + + public void Dispose() + { + } +} diff --git a/src/GitVersion.Output/PublicAPI.Shipped.txt b/src/GitVersion.Output/PublicAPI.Shipped.txt new file mode 100644 index 0000000000..52f0ea6886 --- /dev/null +++ b/src/GitVersion.Output/PublicAPI.Shipped.txt @@ -0,0 +1,12 @@ +#nullable enable +GitVersion.IGitVersionOutputTool +GitVersion.IGitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.GitVersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo, string? targetNamespace = null) -> void +GitVersion.IGitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber) -> void +GitVersion.IGitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.GitVersionVariables! variables) -> void +GitVersion.IGitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.GitVersionVariables! variables) -> void +GitVersion.Output.Attributes.JsonPropertyDescriptionAttribute +GitVersion.Output.Attributes.JsonPropertyDescriptionAttribute.Description.get -> string! +GitVersion.Output.Attributes.JsonPropertyDescriptionAttribute.JsonPropertyDescriptionAttribute(string! description) -> void +GitVersion.Output.GitVersionOutputModule +GitVersion.Output.GitVersionOutputModule.GitVersionOutputModule() -> void +GitVersion.Output.GitVersionOutputModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void diff --git a/src/GitVersion.Output/PublicAPI.Unshipped.txt b/src/GitVersion.Output/PublicAPI.Unshipped.txt new file mode 100644 index 0000000000..7dc5c58110 --- /dev/null +++ b/src/GitVersion.Output/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/GitVersion.Output/Serializer/VersionVariableSerializer.cs b/src/GitVersion.Output/Serializer/VersionVariableSerializer.cs new file mode 100644 index 0000000000..eb5c7fc536 --- /dev/null +++ b/src/GitVersion.Output/Serializer/VersionVariableSerializer.cs @@ -0,0 +1,111 @@ +using System.IO.Abstractions; +using System.Text.Encodings.Web; +using GitVersion.Extensions; +using GitVersion.Helpers; + +namespace GitVersion.OutputVariables; + +internal class VersionVariableSerializer(IFileSystem fileSystem) : IVersionVariableSerializer +{ + public static GitVersionVariables FromJson(string json) + { + var serializeOptions = JsonSerializerOptions(); + var variablePairs = JsonSerializer.Deserialize>(json, serializeOptions); + return FromDictionary(variablePairs); + } + + public string ToJson(GitVersionVariables gitVersionVariables) + { + var variablesType = typeof(VersionVariablesJsonModel); + var variables = new VersionVariablesJsonModel(); + + foreach (var (key, value) in gitVersionVariables.OrderBy(x => x.Key)) + { + var propertyInfo = variablesType.GetProperty(key); + propertyInfo?.SetValue(variables, ChangeType(value, propertyInfo.PropertyType)); + } + + var serializeOptions = JsonSerializerOptions(); + + return JsonSerializer.Serialize(variables, serializeOptions); + } + + public GitVersionVariables FromFile(string filePath) + { + try + { + var retryAction = new RetryAction(); + return retryAction.Execute(() => FromFileInternal(filePath)); + } + catch (AggregateException ex) + { + var lastException = ex.InnerExceptions.LastOrDefault() ?? ex.InnerException; + if (lastException != null) + { + throw lastException; + } + + throw; + } + } + + public void ToFile(GitVersionVariables gitVersionVariables, string filePath) + { + try + { + var retryAction = new RetryAction(); + retryAction.Execute(() => ToFileInternal(gitVersionVariables, filePath)); + } + catch (AggregateException ex) + { + var lastException = ex.InnerExceptions.LastOrDefault() ?? ex.InnerException; + if (lastException != null) + { + throw lastException; + } + + throw; + } + } + + private static GitVersionVariables FromDictionary(IEnumerable>? properties) + { + var type = typeof(GitVersionVariables); + var constructors = type.GetConstructors(); + + var ctor = constructors.Single(); + var ctorArgs = ctor.GetParameters() + .Select(p => properties?.Single(v => string.Equals(v.Key, p.Name, StringComparison.InvariantCultureIgnoreCase)).Value) + .Cast() + .ToArray(); + var instance = Activator.CreateInstance(type, ctorArgs).NotNull(); + return (GitVersionVariables)instance; + } + + private GitVersionVariables FromFileInternal(string filePath) + { + var json = fileSystem.File.ReadAllText(filePath); + return FromJson(json); + } + + private void ToFileInternal(GitVersionVariables gitVersionVariables, string filePath) + { + var json = ToJson(gitVersionVariables); + fileSystem.File.WriteAllText(filePath, json); + } + + private static JsonSerializerOptions JsonSerializerOptions() => new() { WriteIndented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Converters = { new VersionVariablesJsonStringConverter() } }; + + private static object? ChangeType(object? value, Type type) + { + if (!type.IsGenericType || type.GetGenericTypeDefinition() != typeof(Nullable<>)) return Convert.ChangeType(value, type); + if (value == null || value.ToString()?.Length == 0) + { + return null; + } + + type = Nullable.GetUnderlyingType(type)!; + + return Convert.ChangeType(value, type); + } +} diff --git a/src/GitVersion.Output/Serializer/VersionVariablesJsonModel.cs b/src/GitVersion.Output/Serializer/VersionVariablesJsonModel.cs new file mode 100644 index 0000000000..89d32b254b --- /dev/null +++ b/src/GitVersion.Output/Serializer/VersionVariablesJsonModel.cs @@ -0,0 +1,81 @@ +using GitVersion.Output.Attributes; + +namespace GitVersion.OutputVariables; + +internal class VersionVariablesJsonModel +{ + [JsonPropertyDescription("Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.")] + public string? AssemblySemFileVer { get; set; } + + [JsonPropertyDescription("Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0")] + public string? AssemblySemVer { get; set; } + + [JsonPropertyDescription("The name of the checked out Git branch.")] + public string? BranchName { get; set; } + + [JsonPropertyDescription("The build metadata, usually representing number of commits since the VersionSourceSha.")] + public int? BuildMetaData { get; set; } + + [JsonPropertyDescription("The ISO-8601 formatted date of the commit identified by Sha.")] + public string? CommitDate { get; set; } + + [JsonPropertyDescription("The number of commits since the version source.")] + public int? CommitsSinceVersionSource { get; set; } + + [JsonPropertyDescription("Equal to BranchName, but with / replaced with -.")] + public string? EscapedBranchName { get; set; } + + [JsonPropertyDescription("The BuildMetaData suffixed with BranchName and Sha.")] + public string? FullBuildMetaData { get; set; } + + [JsonPropertyDescription("The full, SemVer 2.0 compliant version number.")] + public string? FullSemVer { get; set; } + + [JsonPropertyDescription("Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.")] + public string? InformationalVersion { get; set; } + + [JsonPropertyDescription("The major version. Should be incremented on breaking changes.")] + public int? Major { get; set; } + + [JsonPropertyDescription("Major, Minor and Patch joined together, separated by '.'.")] + public string? MajorMinorPatch { get; set; } + + [JsonPropertyDescription("The minor version. Should be incremented on new features.")] + public int? Minor { get; set; } + + [JsonPropertyDescription("The patch version. Should be incremented on bug fixes.")] + public int? Patch { get; set; } + + [JsonPropertyDescription("The pre-release label is the name of the pre-release.")] + public string? PreReleaseLabel { get; set; } + + [JsonPropertyDescription("The pre-release label prefixed with a dash.")] + public string? PreReleaseLabelWithDash { get; set; } + + [JsonPropertyDescription("The pre-release number is the number of commits since the last version bump.")] + public int? PreReleaseNumber { get; set; } + + [JsonPropertyDescription("The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.")] + public string? PreReleaseTag { get; set; } + + [JsonPropertyDescription("The pre-release tag prefixed with a dash.")] + public string? PreReleaseTagWithDash { get; set; } + + [JsonPropertyDescription("The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.")] + public string? SemVer { get; set; } + + [JsonPropertyDescription("The SHA of the Git commit.")] + public string? Sha { get; set; } + + [JsonPropertyDescription("The Sha limited to 7 characters.")] + public string? ShortSha { get; set; } + + [JsonPropertyDescription("The number of uncommitted changes present in the repository.")] + public int? UncommittedChanges { get; set; } + + [JsonPropertyDescription("The SHA of the commit used as version source.")] + public string? VersionSourceSha { get; set; } + + [JsonPropertyDescription("A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.")] + public int? WeightedPreReleaseNumber { get; set; } +} diff --git a/src/GitVersion.Core/Model/VersionVariablesJsonStringConverter.cs b/src/GitVersion.Output/Serializer/VersionVariablesJsonStringConverter.cs similarity index 89% rename from src/GitVersion.Core/Model/VersionVariablesJsonStringConverter.cs rename to src/GitVersion.Output/Serializer/VersionVariablesJsonStringConverter.cs index 375d54c266..236853f11d 100644 --- a/src/GitVersion.Core/Model/VersionVariablesJsonStringConverter.cs +++ b/src/GitVersion.Output/Serializer/VersionVariablesJsonStringConverter.cs @@ -1,11 +1,9 @@ using System.Buffers; using System.Buffers.Text; -using System.Text.Json; -using System.Text.Json.Serialization; namespace GitVersion.OutputVariables; -public class VersionVariablesJsonStringConverter : JsonConverter +internal class VersionVariablesJsonStringConverter : JsonConverter { public override bool CanConvert(Type typeToConvert) => typeToConvert == typeof(string); diff --git a/src/GitVersion.Output/TemplateManager.cs b/src/GitVersion.Output/TemplateManager.cs new file mode 100644 index 0000000000..6da666c691 --- /dev/null +++ b/src/GitVersion.Output/TemplateManager.cs @@ -0,0 +1,67 @@ +using GitVersion.Extensions; +using GitVersion.Helpers; + +namespace GitVersion.Output; + +internal enum TemplateType +{ + AssemblyInfo, + GitVersionInfo +} + +internal class TemplateManager(TemplateType templateType) +{ + private readonly Dictionary templates = GetEmbeddedTemplates(templateType, "Templates").ToDictionary(tuple => tuple.ext, tuple => tuple.name, StringComparer.OrdinalIgnoreCase); + private readonly Dictionary addFormats = GetEmbeddedTemplates(templateType, "AddFormats").ToDictionary(tuple => tuple.ext, tuple => tuple.name, StringComparer.OrdinalIgnoreCase); + + public string? GetTemplateFor(string? fileExtension) + { + ArgumentNullException.ThrowIfNull(fileExtension); + + string? result = null; + + if (this.templates.TryGetValue(fileExtension, out var template)) + { + result = template.ReadAsStringFromEmbeddedResource(); + } + + return result; + } + + public string? GetAddFormatFor(string? fileExtension) + { + ArgumentNullException.ThrowIfNull(fileExtension); + + string? result = null; + + if (this.addFormats.TryGetValue(fileExtension, out var addFormat)) + { + result = addFormat.ReadAsStringFromEmbeddedResource().TrimEnd('\r', '\n'); + } + + return result; + } + + public bool IsSupported(string fileExtension) + { + ArgumentNullException.ThrowIfNull(fileExtension); + + return this.templates.ContainsKey(fileExtension); + } + + private static IEnumerable<(string ext, string name)> GetEmbeddedTemplates(TemplateType templateType, string templateCategory) + { + var assembly = typeof(TemplateManager).Assembly; + + foreach (var name in assembly.GetManifestResourceNames()) + { + if (!name.Contains(templateType.ToString()) || !name.Contains(templateCategory)) continue; + var extension = FileSystemHelper.Path.GetExtension(name); + if (string.IsNullOrWhiteSpace(extension)) + { + continue; + } + yield return (ext: extension, name); + } + } +} diff --git a/src/GitVersion.Output/WixUpdater/WixVersionContext.cs b/src/GitVersion.Output/WixUpdater/WixVersionContext.cs new file mode 100644 index 0000000000..391beaf11d --- /dev/null +++ b/src/GitVersion.Output/WixUpdater/WixVersionContext.cs @@ -0,0 +1,3 @@ +namespace GitVersion.Output.WixUpdater; + +internal readonly record struct WixVersionContext(string WorkingDirectory) : IConverterContext; diff --git a/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs b/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs new file mode 100644 index 0000000000..b7ecd65565 --- /dev/null +++ b/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs @@ -0,0 +1,57 @@ +using System.IO.Abstractions; +using GitVersion.Extensions; +using GitVersion.Helpers; +using GitVersion.Logging; +using GitVersion.OutputVariables; + +namespace GitVersion.Output.WixUpdater; + +internal interface IWixVersionFileUpdater : IVersionConverter; +internal sealed class WixVersionFileUpdater(ILog log, IFileSystem fileSystem) : IWixVersionFileUpdater +{ + private readonly IFileSystem fileSystem = fileSystem.NotNull(); + private readonly ILog log = log.NotNull(); + private string? wixVersionFile; + public const string WixVersionFileName = "GitVersion_WixVersion.wxi"; + + public void Execute(GitVersionVariables variables, WixVersionContext context) + { + this.wixVersionFile = FileSystemHelper.Path.Combine(context.WorkingDirectory, WixVersionFileName); + this.log.Info("Updating GitVersion_WixVersion.wxi"); + + var doc = new XmlDocument(); + doc.LoadXml(GetWixFormatFromVersionVariables(variables)); + + var xmlDecl = doc.CreateXmlDeclaration("1.0", "utf-8", null); + var root = doc.DocumentElement; + doc.InsertBefore(xmlDecl, root); + + if (this.fileSystem.File.Exists(this.wixVersionFile)) + { + this.fileSystem.File.Delete(this.wixVersionFile); + } + + if (!this.fileSystem.Directory.Exists(context.WorkingDirectory)) + { + this.fileSystem.Directory.CreateDirectory(context.WorkingDirectory); + } + using var fs = this.fileSystem.File.OpenWrite(this.wixVersionFile); + doc.Save(fs); + } + + private static string GetWixFormatFromVersionVariables(GitVersionVariables variables) + { + var builder = new StringBuilder(); + builder.Append("\n"); + foreach (var (key, value) in variables.OrderBy(x => x.Key)) + { + builder.Append("\t\n"); + } + builder.Append("\n"); + return builder.ToString(); + } + + public void Dispose() + { + } +} diff --git a/src/GitVersion.Schema/DefaultAttributeHandler.cs b/src/GitVersion.Schema/DefaultAttributeHandler.cs new file mode 100644 index 0000000000..3d80690d21 --- /dev/null +++ b/src/GitVersion.Schema/DefaultAttributeHandler.cs @@ -0,0 +1,16 @@ +using GitVersion.Configuration.Attributes; +using Json.Schema.Generation; +using Json.Schema.Generation.Intents; + +namespace GitVersion.Schema; + +internal class DefaultAttributeHandler : IAttributeHandler +{ + void IAttributeHandler.AddConstraints(SchemaGenerationContextBase context, Attribute attribute) + { + if (attribute is JsonPropertyDefaultAttribute defaultAttribute) + { + context.Intents.Insert(0, new DefaultIntent(defaultAttribute.Value)); + } + } +} diff --git a/src/GitVersion.Schema/DescriptionAttributeHandler.cs b/src/GitVersion.Schema/DescriptionAttributeHandler.cs new file mode 100644 index 0000000000..2ebfd69302 --- /dev/null +++ b/src/GitVersion.Schema/DescriptionAttributeHandler.cs @@ -0,0 +1,29 @@ +using Json.Schema.Generation; +using Json.Schema.Generation.Intents; + +using ConfigurationDescriptionAttribute = GitVersion.Configuration.Attributes.JsonPropertyDescriptionAttribute; +using OutputDescriptionAttribute = GitVersion.Output.Attributes.JsonPropertyDescriptionAttribute; + +namespace GitVersion.Schema; + +internal class DescriptionAttributeHandler1 : IAttributeHandler +{ + void IAttributeHandler.AddConstraints(SchemaGenerationContextBase context, Attribute attribute) + { + if (attribute is ConfigurationDescriptionAttribute descriptionAttribute) + { + context.Intents.Insert(0, new DescriptionIntent(descriptionAttribute.Description)); + } + } +} + +internal class DescriptionAttributeHandler2 : IAttributeHandler +{ + void IAttributeHandler.AddConstraints(SchemaGenerationContextBase context, Attribute attribute) + { + if (attribute is OutputDescriptionAttribute descriptionAttribute) + { + context.Intents.Insert(0, new DescriptionIntent(descriptionAttribute.Description)); + } + } +} diff --git a/src/GitVersion.Schema/Extensions.cs b/src/GitVersion.Schema/Extensions.cs new file mode 100644 index 0000000000..dac09a46c1 --- /dev/null +++ b/src/GitVersion.Schema/Extensions.cs @@ -0,0 +1,19 @@ +using System.Text.Encodings.Web; +using Json.More; +using Json.Schema; + +namespace GitVersion.Schema; + +internal static class Extensions +{ + public static void WriteToFile(this JsonSchema jsonSchema, string outputFileName) + { + var jsonDocument = jsonSchema.ToJsonDocument(); + + using var fs = File.Create(outputFileName); + using var writer = new Utf8JsonWriter(fs, new() { Indented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }); + jsonDocument.WriteTo(writer); + writer.Flush(); + fs.Flush(); + } +} diff --git a/src/GitVersion.Schema/FormatAttributeHandler.cs b/src/GitVersion.Schema/FormatAttributeHandler.cs new file mode 100644 index 0000000000..fcd57c4c5f --- /dev/null +++ b/src/GitVersion.Schema/FormatAttributeHandler.cs @@ -0,0 +1,40 @@ +using Json.Schema; +using Json.Schema.Generation; +using Json.Schema.Generation.Intents; +using Format = GitVersion.Configuration.Attributes.Format; +using FormatAttribute = GitVersion.Configuration.Attributes.JsonPropertyFormatAttribute; + +namespace GitVersion.Schema; +internal class FormatAttributeHandler : IAttributeHandler +{ + void IAttributeHandler.AddConstraints(SchemaGenerationContextBase context, Attribute attribute) + { + if (attribute is not FormatAttribute formatAttribute) return; + var format = formatAttribute.Format switch + { + Format.Date => Formats.Date, + Format.DateTime => Formats.DateTime, + Format.Duration => Formats.Duration, + Format.Email => Formats.Email, + Format.Hostname => Formats.Hostname, + Format.IdnEmail => Formats.IdnEmail, + Format.IdnHostname => Formats.IdnHostname, + Format.Ipv4 => Formats.Ipv4, + Format.Ipv6 => Formats.Ipv6, + Format.Iri => Formats.Iri, + Format.IriReference => Formats.IriReference, + Format.JsonPointer => Formats.JsonPointer, + Format.Regex => Formats.Regex, + Format.RelativeJsonPointer => Formats.RelativeJsonPointer, + Format.Time => Formats.Time, + Format.Uri => Formats.Uri, + Format.UriReference => Formats.UriReference, + Format.UriTemplate => Formats.UriTemplate, + Format.Uuid => Formats.Uuid, + _ => null // in case new formats are added. + }; + + if (format != null) + context.Intents.Insert(0, new FormatIntent(format)); + } +} diff --git a/src/GitVersion.Schema/GitVersion.Schema.csproj b/src/GitVersion.Schema/GitVersion.Schema.csproj new file mode 100644 index 0000000000..beef892b98 --- /dev/null +++ b/src/GitVersion.Schema/GitVersion.Schema.csproj @@ -0,0 +1,16 @@ + + + Exe + schema + + + + + + + + + + + + diff --git a/src/GitVersion.Schema/Program.cs b/src/GitVersion.Schema/Program.cs new file mode 100644 index 0000000000..e6f7eb39a1 --- /dev/null +++ b/src/GitVersion.Schema/Program.cs @@ -0,0 +1,54 @@ +using GitVersion.Configuration; +using GitVersion.OutputVariables; +using GitVersion.Schema; +using Json.Schema; +using Json.Schema.Generation; +using Microsoft.Extensions.Configuration; + +var configurationManager = new ConfigurationManager().AddCommandLine(args).Build(); +var schemasDirectory = configurationManager["OutputDirectory"]!; +var schemaVersion = configurationManager["Version"]!; + +var configuration = new SchemaGeneratorConfiguration +{ + PropertyNameResolver = PropertyNameResolvers.KebabCase, + PropertyOrder = PropertyOrder.ByName +}; + +AttributeHandler.AddHandler(); +AttributeHandler.AddHandler(); +AttributeHandler.AddHandler(); +AttributeHandler.AddHandler(); + +if (!Directory.Exists(schemasDirectory)) +{ + Directory.CreateDirectory(schemasDirectory); +} +if (!Directory.Exists(Path.Combine(schemasDirectory, schemaVersion))) +{ + Directory.CreateDirectory(Path.Combine(schemasDirectory, schemaVersion)); +} + +var builder = new JsonSchemaBuilder(); +builder.Schema("http://json-schema.org/draft-07/schema#"); +builder.Id($"https://gitversion.net/schemas/%7BschemaVersion%7D/GitVersion.configuration.json"); +builder.Title($"GitVersion Configuration ({schemaVersion})"); +builder.Description($"GitVersion configuration schema ({schemaVersion})"); +var schema = builder.FromType(configuration).Build(); + +var fileName = Path.Combine(schemasDirectory, schemaVersion, "GitVersion.configuration.json"); +Console.WriteLine($"Writing schema to {fileName}"); +schema.WriteToFile(fileName); + +configuration.PropertyNameResolver = PropertyNameResolvers.AsDeclared; + +builder = new(); +builder.Schema("http://json-schema.org/draft-07/schema#"); +builder.Id($"https://gitversion.net/schemas/%7BschemaVersion%7D/GitVersion.json"); +builder.Title("GitVersion version variables output"); +builder.Description("GitVersion output schema"); +schema = builder.FromType(configuration).Build(); + +fileName = Path.Combine(schemasDirectory, schemaVersion, "GitVersion.json"); +Console.WriteLine($"Writing schema to {fileName}"); +schema.WriteToFile(fileName); diff --git a/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs new file mode 100644 index 0000000000..ebf88bf939 --- /dev/null +++ b/src/GitVersion.Testing/Fixtures/BaseGitFlowRepositoryFixture.cs @@ -0,0 +1,38 @@ +using GitVersion.Helpers; +using LibGit2Sharp; + +namespace GitVersion.Testing; + +/// +/// Creates a repo with a develop branch off main which is a single commit ahead of main +/// +public class BaseGitFlowRepositoryFixture : EmptyRepositoryFixture +{ + /// + /// Creates a repo with a develop branch off main which is a single commit ahead of main branch + /// Main will be tagged with the initial version before branching develop + /// + public BaseGitFlowRepositoryFixture(string initialVersion, string branchName = "main") : + this(r => r.MakeATaggedCommit(initialVersion), branchName) + { + } + + /// + /// Creates a repo with a develop branch off main which is a single commit ahead of main + /// The initial setup actions will be performed before branching develop + /// + public BaseGitFlowRepositoryFixture(Action initialMainAction, string branchName = "main") : + base(branchName) => SetupRepo(initialMainAction); + + private void SetupRepo(Action initialMainAction) + { + var randomFile = FileSystemHelper.Path.Combine(Repository.Info.WorkingDirectory, Guid.NewGuid().ToString()); + FileSystemHelper.File.WriteAllText(randomFile, string.Empty); + Commands.Stage(Repository, randomFile); + + initialMainAction(Repository); + + Commands.Checkout(Repository, Repository.CreateBranch("develop")); + Repository.MakeACommit(); + } +} diff --git a/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs new file mode 100644 index 0000000000..b864b31247 --- /dev/null +++ b/src/GitVersion.Testing/Fixtures/EmptyRepositoryFixture.cs @@ -0,0 +1,3 @@ +namespace GitVersion.Testing; + +public class EmptyRepositoryFixture(string branchName = "main") : RepositoryFixtureBase(path => CreateNewRepository(path, branchName)); diff --git a/src/GitVersion.Testing/Fixtures/LocalRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/LocalRepositoryFixture.cs new file mode 100644 index 0000000000..8431d4435e --- /dev/null +++ b/src/GitVersion.Testing/Fixtures/LocalRepositoryFixture.cs @@ -0,0 +1,5 @@ +using LibGit2Sharp; + +namespace GitVersion.Testing; + +public class LocalRepositoryFixture(Repository repository) : RepositoryFixtureBase(repository); diff --git a/src/GitTools.Testing/Fixtures/RemoteRepositoryFixture.cs b/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs similarity index 50% rename from src/GitTools.Testing/Fixtures/RemoteRepositoryFixture.cs rename to src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs index e17c13714c..2312d47f62 100644 --- a/src/GitTools.Testing/Fixtures/RemoteRepositoryFixture.cs +++ b/src/GitVersion.Testing/Fixtures/RemoteRepositoryFixture.cs @@ -1,6 +1,6 @@ using LibGit2Sharp; -namespace GitTools.Testing; +namespace GitVersion.Testing; /// /// Creates a remote repository then clones it @@ -9,34 +9,18 @@ namespace GitTools.Testing; /// public class RemoteRepositoryFixture : RepositoryFixtureBase { - public RemoteRepositoryFixture(Func builder) - : base(builder) => CreateLocalRepository(); + public RemoteRepositoryFixture(Func builder) + : base(builder) => LocalRepositoryFixture = CloneRepository(); - public RemoteRepositoryFixture() : this("main") - { - } - - public RemoteRepositoryFixture(string branchName) : - this(path => CreateNewRepository(path, branchName)) + public RemoteRepositoryFixture(string branchName = "main") + : this(path => CreateNewRepository(path, branchName, 5)) { } /// /// Fixture pointing at the local repository /// - public LocalRepositoryFixture LocalRepositoryFixture { get; private set; } - - private static IRepository CreateNewRepository(string path, string branchName) - { - Init(path, branchName); - Console.WriteLine("Created git repository at '{0}'", path); - - var repo = new Repository(path); - repo.MakeCommits(5); - return repo; - } - - private void CreateLocalRepository() => LocalRepositoryFixture = CloneRepository(); + public LocalRepositoryFixture LocalRepositoryFixture { get; } /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. @@ -47,7 +31,6 @@ protected override void Dispose(bool disposing) { LocalRepositoryFixture.Dispose(); } - base.Dispose(disposing); } } diff --git a/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs b/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs new file mode 100644 index 0000000000..be177bbf0a --- /dev/null +++ b/src/GitVersion.Testing/Fixtures/RepositoryFixtureBase.cs @@ -0,0 +1,174 @@ +using GitVersion.Helpers; +using LibGit2Sharp; +using Shouldly; + +namespace GitVersion.Testing; + +/// +/// Fixture abstracting a git repository +/// +public abstract class RepositoryFixtureBase : IDisposable +{ + protected RepositoryFixtureBase(Func repositoryBuilder) + : this(repositoryBuilder(FileSystemHelper.Path.GetRepositoryTempPath())) + { + } + + protected RepositoryFixtureBase(Repository repository) + { + SequenceDiagram = new(); + Repository = repository.ShouldNotBeNull(); + Repository.Config.Set("user.name", "Test"); + Repository.Config.Set("user.email", "test@email.com"); + } + + public Repository Repository { get; } + + public string RepositoryPath => Repository.Info.WorkingDirectory.TrimEnd('\\'); + + public SequenceDiagram SequenceDiagram { get; } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + + Repository.Dispose(); + var directoryPath = FileSystemHelper.Path.GetFileName(RepositoryPath); + + try + { + Console.WriteLine("Cleaning up repository path at {0}", directoryPath); + FileSystemHelper.Directory.DeleteDirectory(RepositoryPath); + Console.WriteLine("Cleaned up repository path at {0}", directoryPath); + } + catch (Exception e) + { + Console.WriteLine("Failed to clean up repository path at {0}. Received exception: {1}", directoryPath, e.Message); + // throw; + } + + this.SequenceDiagram.End(); + Console.WriteLine("**Visualisation of test:**"); + Console.WriteLine(string.Empty); + Console.WriteLine(this.SequenceDiagram.GetDiagram()); + } + + public void Checkout(string branch) => Commands.Checkout(Repository, branch); + + public void Remove(string branch) + { + Repository.Branches.Remove(branch); + SequenceDiagram.Destroy(branch); + } + + public static void Init(string path, string branchName = "main") => GitTestExtensions.ExecuteGitCmd($"init {path} -b {branchName}", "."); + + public string MakeATaggedCommit(string tag) + { + var sha = MakeACommit(); + ApplyTag(tag); + return sha; + } + + public void ApplyTag(string tag) + { + this.SequenceDiagram.ApplyTag(tag, Repository.Head.FriendlyName); + Repository.ApplyTag(tag); + } + + public void CreateBranch(string branchName, string? @as = null) + { + this.SequenceDiagram.BranchTo(branchName, Repository.Head.FriendlyName, @as); + Repository.CreateBranch(branchName); + } + + public void BranchTo(string branchName, string? @as = null) + { + this.SequenceDiagram.BranchTo(branchName, Repository.Head.FriendlyName, @as); + var branch = Repository.CreateBranch(branchName); + Commands.Checkout(Repository, branch); + } + + public void BranchToFromTag(string branchName, string fromTag, string onBranch, string? @as = null) + { + this.SequenceDiagram.BranchToFromTag(branchName, fromTag, onBranch, @as); + var branch = Repository.CreateBranch(branchName); + Commands.Checkout(Repository, branch); + } + + public string MakeACommit() + { + var to = Repository.Head.FriendlyName; + this.SequenceDiagram.MakeACommit(to); + var commit = Repository.MakeACommit(); + return commit.Sha; + } + + /// + /// Merges (no-ff) specified branch into the current HEAD of this repository + /// + public void MergeNoFF(string mergeSource) + { + this.SequenceDiagram.Merge(mergeSource, Repository.Head.FriendlyName); + Repository.MergeNoFF(mergeSource, Generate.SignatureNow()); + } + + public void MergeTo(string branchName, bool removeBranchAfterMerging = false) + { + var mergeSource = Repository.Head.FriendlyName; + Checkout(branchName); + MergeNoFF(mergeSource); + if (removeBranchAfterMerging) + { + Remove(mergeSource); + } + } + + /// + /// Clones the repository managed by this fixture into another LocalRepositoryFixture + /// + public LocalRepositoryFixture CloneRepository() + { + var localPath = FileSystemHelper.Path.GetRepositoryTempPath(); + Repository.Clone(RepositoryPath, localPath); + Console.WriteLine($"Cloned repository to '{localPath}' from '{RepositoryPath}'"); + return new LocalRepositoryFixture(new Repository(localPath)); + } + + protected static Repository CreateNewRepository(string path, string branchName, int commits = 0) + { + Init(path, branchName); + Console.WriteLine("Created git repository at '{0}'", path); + + var repository = new Repository(path); + if (commits > 0) + { + repository.MakeCommits(commits); + } + return repository; + } + + /// + /// Pulls with a depth of 1 and prunes all older commits, making the repository shallow. + /// + public void MakeShallow() + { + GitTestExtensions.ExecuteGitCmd($"-C {RepositoryPath} pull --depth 1", "."); + GitTestExtensions.ExecuteGitCmd($"-C {RepositoryPath} gc --prune=all", "."); + } + + public void Fetch(string remote, FetchOptions? options = null) + => Commands.Fetch(Repository, remote, [], options, null); +} diff --git a/src/GitTools.Testing/Fixtures/SequenceDiagram.cs b/src/GitVersion.Testing/Fixtures/SequenceDiagram.cs similarity index 83% rename from src/GitTools.Testing/Fixtures/SequenceDiagram.cs rename to src/GitVersion.Testing/Fixtures/SequenceDiagram.cs index e28d6cafd7..35e73d21cf 100644 --- a/src/GitTools.Testing/Fixtures/SequenceDiagram.cs +++ b/src/GitVersion.Testing/Fixtures/SequenceDiagram.cs @@ -1,13 +1,14 @@ -using GitTools.Testing.Internal; +using GitVersion.Testing.Helpers; +using GitVersion.Testing.Internal; -namespace GitTools.Testing; +namespace GitVersion.Testing; /// /// Creates an abstraction over a PlantUML Sequence diagram to draw a sequence diagram of a git repository being created /// public class SequenceDiagram { - private readonly Dictionary participants = new(); + private readonly Dictionary participants = []; private readonly StringBuilder diagramBuilder; /// @@ -24,6 +25,11 @@ public SequenceDiagram() /// public void Activate(string branch) => this.diagramBuilder.AppendLineFormat("activate {0}", GetParticipant(branch)); + /// + /// Deactivates a branch/participant in the sequence diagram + /// + public void Deactivate(string branch) => this.diagramBuilder.AppendLineFormat("deactivate {0}", GetParticipant(branch)); + /// /// Destroys a branch/participant in the sequence diagram /// @@ -34,11 +40,12 @@ public SequenceDiagram() /// public void Participant(string participant, string? @as = null) { - this.participants.Add(participant, @as ?? participant); - if (@as == null) + var cleanParticipant = ParticipantSanitizer.SanitizeParticipant(@as ?? participant); + this.participants.Add(participant, cleanParticipant); + if (participant == cleanParticipant) this.diagramBuilder.AppendLineFormat("participant {0}", participant); else - this.diagramBuilder.AppendLineFormat("participant \"{0}\" as {1}", participant, @as); + this.diagramBuilder.AppendLineFormat("participant \"{0}\" as {1}", participant, cleanParticipant); } /// @@ -51,9 +58,11 @@ public void Participant(string participant, string? @as = null) /// public void NoteOver(string noteText, string startParticipant, string? endParticipant = null, string? prefix = null, string? color = null) => this.diagramBuilder.AppendLineFormat( - prefix + @"note over {0}{1}{2} - {3} -end note", + prefix + """ + note over {0}{1}{2} + {3} + end note + """, GetParticipant(startParticipant), endParticipant == null ? null : ", " + GetParticipant(endParticipant), color == null ? null : " " + color, @@ -105,7 +114,7 @@ public void BranchToFromTag(string branchName, string fromTag, string onBranch, /// public void Merge(string from, string to) => this.diagramBuilder.AppendLineFormat("{0} -> {1}: merge", GetParticipant(from), GetParticipant(to)); - private string GetParticipant(string branch) => this.participants.ContainsKey(branch) ? this.participants[branch] : branch; + private string GetParticipant(string branch) => this.participants.GetValueOrDefault(branch, branch); /// /// Ends the sequence diagram diff --git a/src/GitTools.Testing/Generate.cs b/src/GitVersion.Testing/Generate.cs similarity index 95% rename from src/GitTools.Testing/Generate.cs rename to src/GitVersion.Testing/Generate.cs index 5bb7aedeca..4dbc87b271 100644 --- a/src/GitTools.Testing/Generate.cs +++ b/src/GitVersion.Testing/Generate.cs @@ -1,6 +1,6 @@ using LibGit2Sharp; -namespace GitTools.Testing; +namespace GitVersion.Testing; /// /// Static helper class for generating data git needs, like signatures diff --git a/src/GitTools.Testing/GitTestExtensions.cs b/src/GitVersion.Testing/GitTestExtensions.cs similarity index 78% rename from src/GitTools.Testing/GitTestExtensions.cs rename to src/GitVersion.Testing/GitTestExtensions.cs index b659bfa4b4..be1a0518cf 100644 --- a/src/GitTools.Testing/GitTestExtensions.cs +++ b/src/GitVersion.Testing/GitTestExtensions.cs @@ -1,7 +1,8 @@ -using GitTools.Testing.Internal; +using GitVersion.Helpers; +using GitVersion.Testing.Internal; using LibGit2Sharp; -namespace GitTools.Testing; +namespace GitVersion.Testing; public static class GitTestExtensions { @@ -16,21 +17,20 @@ public static class GitTestExtensions FastForwardStrategy = FastForwardStrategy.NoFastForward }); - public static Commit[] MakeCommits(this IRepository repository, int numCommitsToMake) => Enumerable.Range(1, numCommitsToMake) - .Select(_ => repository.MakeACommit()) - .ToArray(); + public static Commit[] MakeCommits(this IRepository repository, int numCommitsToMake) + => [.. Enumerable.Range(1, numCommitsToMake).Select(_ => repository.MakeACommit())]; private static Commit CreateFileAndCommit(this IRepository repository, string relativeFileName, string? commitMessage = null) { - var randomFile = Path.Combine(repository.Info.WorkingDirectory, relativeFileName); - if (File.Exists(randomFile)) + var randomFile = FileSystemHelper.Path.Combine(repository.Info.WorkingDirectory, relativeFileName); + if (FileSystemHelper.File.Exists(randomFile)) { - File.Delete(randomFile); + FileSystemHelper.File.Delete(randomFile); } var totalWidth = 36 + (_pad++ % 10); var contents = Guid.NewGuid().ToString().PadRight(totalWidth, '.'); - File.WriteAllText(randomFile, contents); + FileSystemHelper.File.WriteAllText(randomFile, contents); Commands.Stage(repository, randomFile); @@ -42,7 +42,7 @@ public static Tag MakeATaggedCommit(this IRepository repository, string tag) { var commit = repository.MakeACommit(); var existingTag = repository.Tags.SingleOrDefault(t => t.FriendlyName == tag); - return existingTag != null ? existingTag : repository.Tags.Add(tag, commit); + return existingTag ?? repository.Tags.Add(tag, commit); } public static Commit CreatePullRequestRef(this IRepository repository, string from, string to, int prNumber = 2, bool normalise = false, bool allowFastForwardMerge = false) @@ -68,7 +68,7 @@ public static Commit CreatePullRequestRef(this IRepository repository, string fr return commit; } - public static void ExecuteGitCmd(string gitCmd, Action? writer = null) + public static void ExecuteGitCmd(string gitCmd, string workingDirectory, Action? writer = null) { var output = new StringBuilder(); try @@ -79,15 +79,10 @@ public static void ExecuteGitCmd(string gitCmd, Action? writer = null) null, "git", gitCmd, - "."); + workingDirectory); } - catch (FileNotFoundException exception) + catch (FileNotFoundException exception) when (exception.FileName == "git") { - if (exception.FileName != "git") - { - throw; - } - output.AppendLine("Could not execute 'git log' due to the following error:"); output.AppendLine(exception.ToString()); } diff --git a/src/GitVersion.Testing/GitVersion.Testing.csproj b/src/GitVersion.Testing/GitVersion.Testing.csproj new file mode 100644 index 0000000000..08c0eba912 --- /dev/null +++ b/src/GitVersion.Testing/GitVersion.Testing.csproj @@ -0,0 +1,22 @@ + + + false + true + + + + + + + + + + + + + + + + + + diff --git a/src/GitVersion.Testing/Helpers/ParticipantSanitizer.cs b/src/GitVersion.Testing/Helpers/ParticipantSanitizer.cs new file mode 100644 index 0000000000..826728b19b --- /dev/null +++ b/src/GitVersion.Testing/Helpers/ParticipantSanitizer.cs @@ -0,0 +1,26 @@ +using GitVersion.Core; + +namespace GitVersion.Testing.Helpers; + +public static class ParticipantSanitizer +{ + /// + /// Converts a participant identifier to a standardized format that won't break PlantUml. + /// + /// The participant identifier to convert. This value cannot be null, empty, or consist only of whitespace. + public static string SanitizeParticipant(string participant) + { + GuardAgainstInvalidParticipants(participant); + + return RegexPatterns.Output.SanitizeParticipantRegex().Replace(participant, "_"); + } + + private static void GuardAgainstInvalidParticipants(string participant) + { + ArgumentException.ThrowIfNullOrWhiteSpace(participant); + if (participant.EndsWith('/')) + { + throw new ArgumentException("The value cannot end with a folder separator ('/').", nameof(participant)); + } + } +} diff --git a/src/GitVersion.Core/Helpers/ProcessHelper.cs b/src/GitVersion.Testing/Helpers/ProcessHelper.cs similarity index 90% rename from src/GitVersion.Core/Helpers/ProcessHelper.cs rename to src/GitVersion.Testing/Helpers/ProcessHelper.cs index cbac47cd03..e37c74e534 100644 --- a/src/GitVersion.Core/Helpers/ProcessHelper.cs +++ b/src/GitVersion.Testing/Helpers/ProcessHelper.cs @@ -1,10 +1,10 @@ using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; -using GitVersion.Extensions; -namespace GitVersion.Helpers; +namespace GitVersion.Testing; -public static class ProcessHelper +public static partial class ProcessHelper { private static readonly object LockObject = new(); @@ -37,6 +37,8 @@ public static class ProcessHelper case NativeErrorCode.PathNotFound: throw new DirectoryNotFoundException($"The path to the executable file '{startInfo.FileName}' could not be found.", exception); + default: + throw new ArgumentOutOfRangeException($"The error code '{exception.NativeErrorCode}' is not supported.", nameof(exception)); } throw; @@ -77,10 +79,8 @@ public static class ProcessHelper // http://csharptest.net/532/using-processstart-to-capture-console-output/ public static int Run(Action output, Action errorOutput, TextReader? input, string exe, string args, string workingDirectory, params KeyValuePair[] environmentalVariables) { - if (string.IsNullOrEmpty(exe)) - throw new ArgumentNullException(nameof(exe)); - if (output == null) - throw new ArgumentNullException(nameof(output)); + ArgumentException.ThrowIfNullOrWhiteSpace(exe); + ArgumentNullException.ThrowIfNull(output); var psi = new ProcessStartInfo { @@ -142,8 +142,7 @@ public static int Run(Action output, Action errorOutput, TextRea }; process.BeginErrorReadLine(); - string? line; - while ((line = input?.ReadLine()) != null) + while (input?.ReadLine() is { } line) process.StandardInput.WriteLine(line); process.StandardInput.Close(); @@ -167,6 +166,7 @@ private enum NativeErrorCode } [Flags] + [SuppressMessage("ReSharper", "UnusedMember.Local")] private enum ErrorModes { Default = 0x0, @@ -176,7 +176,7 @@ private enum ErrorModes NoOpenFileErrorBox = 0x8000 } - private readonly struct ChangeErrorMode : IDisposable + private readonly partial struct ChangeErrorMode : IDisposable { private readonly int oldMode; @@ -192,12 +192,11 @@ public ChangeErrorMode(ErrorModes mode) } } - void IDisposable.Dispose() { try { - SetErrorMode(this.oldMode); + _ = SetErrorMode(this.oldMode); } catch (Exception ex) when (ex is EntryPointNotFoundException or DllNotFoundException) { @@ -205,7 +204,7 @@ void IDisposable.Dispose() } } - [DllImport("kernel32.dll")] - private static extern int SetErrorMode(int newMode); + [LibraryImport("kernel32.dll")] + private static partial int SetErrorMode(int newMode); } } diff --git a/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs b/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs new file mode 100644 index 0000000000..2893be4336 --- /dev/null +++ b/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GitVersion.Testing.Internal; + +internal static class StringBuilderExtensions +{ + public static void AppendLineFormat(this StringBuilder stringBuilder, + [StringSyntax(StringSyntaxAttribute.CompositeFormat)] + string format, + params object?[] args) + { + stringBuilder.AppendFormat(format, args); + stringBuilder.AppendLine(); + } +} diff --git a/src/GitTools.Testing/VirtualTime.cs b/src/GitVersion.Testing/VirtualTime.cs similarity index 95% rename from src/GitTools.Testing/VirtualTime.cs rename to src/GitVersion.Testing/VirtualTime.cs index baac3b8822..0b23cd6ce4 100644 --- a/src/GitTools.Testing/VirtualTime.cs +++ b/src/GitVersion.Testing/VirtualTime.cs @@ -1,4 +1,4 @@ -namespace GitTools.Testing; +namespace GitVersion.Testing; /// /// VirtualTime starts at an hour before now, then each time it is called increments by a minute diff --git a/src/GitVersion.sln b/src/GitVersion.sln deleted file mode 100644 index 2774e6681c..0000000000 --- a/src/GitVersion.sln +++ /dev/null @@ -1,80 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28714.193 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.App", "GitVersion.App\GitVersion.App.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Core.Tests", "GitVersion.Core.Tests\GitVersion.Core.Tests.csproj", "{BF905F84-382C-440D-92F5-C61108626D8D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EFFC5D6-88D0-49D9-BB53-E1B7EB49DD45}" - ProjectSection(SolutionItems) = preProject - ..\.editorconfig = ..\.editorconfig - ..\.gitattributes = ..\.gitattributes - ..\.gitignore = ..\.gitignore - ..\azure-pipelines.yml = ..\azure-pipelines.yml - ..\build.ps1 = ..\build.ps1 - ..\CONTRIBUTING.md = ..\CONTRIBUTING.md - Directory.Build.props = Directory.Build.props - ..\GitVersion.yml = ..\GitVersion.yml - ..\LICENSE = ..\LICENSE - ..\README.md = ..\README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Core", "GitVersion.Core\GitVersion.Core.csproj", "{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.App.Tests", "GitVersion.App.Tests\GitVersion.App.Tests.csproj", "{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.MsBuild", "GitVersion.MsBuild\GitVersion.MsBuild.csproj", "{20D61ED7-B5BA-42CD-A05A-85EA1EEA2E2F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.MsBuild.Tests", "GitVersion.MsBuild.Tests\GitVersion.MsBuild.Tests.csproj", "{B35EF742-95D4-4E6A-B782-BE1C3E5CF9AE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitTools.Testing", "GitTools.Testing\GitTools.Testing.csproj", "{6138640B-5C05-4070-BE32-6B17BEFDF63C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.LibGit2Sharp", "GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj", "{093AFCF2-68F4-49B1-8173-7CB88467E783}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.Build.0 = Release|Any CPU - {BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.Build.0 = Release|Any CPU - {F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.Build.0 = Release|Any CPU - {75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.Build.0 = Release|Any CPU - {20D61ED7-B5BA-42CD-A05A-85EA1EEA2E2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20D61ED7-B5BA-42CD-A05A-85EA1EEA2E2F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20D61ED7-B5BA-42CD-A05A-85EA1EEA2E2F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20D61ED7-B5BA-42CD-A05A-85EA1EEA2E2F}.Release|Any CPU.Build.0 = Release|Any CPU - {B35EF742-95D4-4E6A-B782-BE1C3E5CF9AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B35EF742-95D4-4E6A-B782-BE1C3E5CF9AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B35EF742-95D4-4E6A-B782-BE1C3E5CF9AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B35EF742-95D4-4E6A-B782-BE1C3E5CF9AE}.Release|Any CPU.Build.0 = Release|Any CPU - {6138640B-5C05-4070-BE32-6B17BEFDF63C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6138640B-5C05-4070-BE32-6B17BEFDF63C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6138640B-5C05-4070-BE32-6B17BEFDF63C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6138640B-5C05-4070-BE32-6B17BEFDF63C}.Release|Any CPU.Build.0 = Release|Any CPU - {093AFCF2-68F4-49B1-8173-7CB88467E783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {093AFCF2-68F4-49B1-8173-7CB88467E783}.Debug|Any CPU.Build.0 = Debug|Any CPU - {093AFCF2-68F4-49B1-8173-7CB88467E783}.Release|Any CPU.ActiveCfg = Release|Any CPU - {093AFCF2-68F4-49B1-8173-7CB88467E783}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0C1C310E-7A4D-4032-878B-6DC375894C49} - EndGlobalSection -EndGlobal diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 6cb996e947..7f21c9ff09 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -1,4 +1,4 @@ - + True @@ -644,6 +644,21 @@ II.2.12 <HandlesEvent /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Type parameters"><ElementKinds><Kind Name="TYPE_PARAMETER" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Instance fields (not private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local variables"><ElementKinds><Kind Name="LOCAL_VARIABLE" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Static fields (not private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Parameters"><ElementKinds><Kind Name="PARAMETER" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Enum members"><ElementKinds><Kind Name="ENUM_MEMBER" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Types and namespaces"><ElementKinds><Kind Name="NAMESPACE" /><Kind Name="CLASS" /><Kind Name="STRUCT" /><Kind Name="ENUM" /><Kind Name="DELEGATE" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local constants"><ElementKinds><Kind Name="LOCAL_CONSTANT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Interfaces"><ElementKinds><Kind Name="INTERFACE" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Static readonly fields (not private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> @@ -681,23 +696,22 @@ II.2.12 <HandlesEvent /> True True True + True True True True True True + True True True True True - - - True + True False - - - - - <data /> + <data /> <data><IncludeFilters /><ExcludeFilters /></data> - True + True + True + True + True diff --git a/src/GitVersion.slnx b/src/GitVersion.slnx new file mode 100644 index 0000000000..11c8908bea --- /dev/null +++ b/src/GitVersion.slnx @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mark-shipped.ps1 b/src/mark-shipped.ps1 new file mode 100755 index 0000000000..46940fea6c --- /dev/null +++ b/src/mark-shipped.ps1 @@ -0,0 +1,46 @@ +#! /usr/bin/env pwsh + +[CmdletBinding(PositionalBinding = $false)] +param () + +Set-StrictMode -version 2.0 +$ErrorActionPreference = "Stop" + +function MarkShipped([string]$dir) { + $shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt" + $shipped = @() + $shipped += Get-Content $shippedFilePath + + $unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt" + $unshipped = Get-Content $unshippedFilePath + $removed = @() + $removedPrefix = "*REMOVED*"; + Write-Host "Processing $dir" + + foreach ($item in $unshipped) { + if ($item.Length -gt 0) { + if ( $item.StartsWith($removedPrefix)) { + $item = $item.Substring($removedPrefix.Length) + $removed += $item + } + else { + $shipped += $item + } + } + } + + $shipped | Sort-Object -Unique | Where-Object { -not $removed.Contains($_) } | Out-File $shippedFilePath -Encoding Ascii + "#nullable enable" | Out-File $unshippedFilePath -Encoding Ascii +} + +try { + foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") { + $dir = Split-Path -parent $file + MarkShipped $dir + } +} +catch { + Write-Host $_ + Write-Host $_.Exception + exit 1 +} diff --git a/tests/integration/Directory.Build.props b/tests/integration/Directory.Build.props index f00105a575..20e3939c27 100644 --- a/tests/integration/Directory.Build.props +++ b/tests/integration/Directory.Build.props @@ -10,15 +10,11 @@ https://api.nuget.org/v3/index.json - - - all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/integration/Directory.Packages.props b/tests/integration/Directory.Packages.props new file mode 100644 index 0000000000..1ef9ac25e7 --- /dev/null +++ b/tests/integration/Directory.Packages.props @@ -0,0 +1,6 @@ + + + + false + + diff --git a/tests/integration/core/app.csproj b/tests/integration/app.csproj similarity index 100% rename from tests/integration/core/app.csproj rename to tests/integration/app.csproj diff --git a/tests/integration/full/app.csproj b/tests/integration/full/app.csproj deleted file mode 100644 index 67a478fbf0..0000000000 --- a/tests/integration/full/app.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - AnyCPU - {C1765652-F8AE-4FFD-AFC8-72054A5A91B7} - v4.8 - 512 - true - true - - - AnyCPU - true - full - false - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - TRACE - prompt - 4 - - - - - - - - - - - - - - diff --git a/tests/scripts/test-global-tool.sh b/tests/scripts/test-global-tool.sh index 19074f4834..778863663f 100644 --- a/tests/scripts/test-global-tool.sh +++ b/tests/scripts/test-global-tool.sh @@ -1,5 +1,5 @@ #!/usr/bin/sh -# sh /scripts/test-global-tool.sh --version 5.7.1-beta1.56 --nugetPath /nuget --repoPath /repo +# sh /scripts/test-global-tool.sh --version 6.0.0 --nugetPath /nuget --repoPath /repo while test "$#" -gt 0 do case $1 in @@ -16,11 +16,12 @@ do shift done +git config --global --add safe.directory '*' result=$(dotnet tool install GitVersion.Tool --version $version --tool-path /tools --add-source $nugetPath) # >/dev/null status=$? if test $status -eq 0 then - /tools/dotnet-gitversion $repoPath /showvariable FullSemver + /tools/dotnet-gitversion $repoPath /showvariable FullSemver /nocache else echo $result fi diff --git a/tests/scripts/test-msbuild-task.sh b/tests/scripts/test-msbuild-task.sh index 9999e37afc..b75db70371 100644 --- a/tests/scripts/test-msbuild-task.sh +++ b/tests/scripts/test-msbuild-task.sh @@ -1,5 +1,5 @@ #!/usr/bin/sh -# sh /scripts/test-msbuild-task.sh --version 5.7.1-beta1.56 --nugetPath /nuget --repoPath /repo/tests/integration/core --targetframework net5.0 +# sh /scripts/test-msbuild-task.sh --version 6.0.0 --nugetPath /nuget --repoPath /repo/tests/integration --targetframework net8.0 while test "$#" -gt 0 do case $1 in @@ -19,6 +19,7 @@ do shift done +git config --global --add safe.directory '*' result=$(dotnet build $repoPath --source $nugetPath --source https://api.nuget.org/v3/index.json -p:GitVersionMsBuildVersion=$version -p:TargetFrameworks=$targetframework) # >/dev/null status=$? if test $status -eq 0 @@ -27,3 +28,5 @@ then else echo $result fi +rm -rf $repoPath/build >/dev/null +rm -rf $repoPath/obj >/dev/null diff --git a/tests/scripts/test-native-tool.sh b/tests/scripts/test-native-tool.sh index 262d8efcac..81aa2d9314 100644 --- a/tests/scripts/test-native-tool.sh +++ b/tests/scripts/test-native-tool.sh @@ -1,5 +1,5 @@ #!/usr/bin/sh -# sh /scripts/test-native-tool.sh --version 5.7.1-beta1-56 --runtime linux-musl-x64 /nuget --repoPath /repo +# sh /scripts/test-native-tool.sh --version 6.0.0 --runtime linux-musl-x64 /nuget --repoPath /repo while test "$#" -gt 0 do case $1 in @@ -16,11 +16,12 @@ do shift done +git config --global --add safe.directory '*' result=$(tar -xvpf /native/gitversion-$runtime-$version.tar.gz -C /native) # >/dev/null status=$? if test $status -eq 0 then - /native/gitversion $repoPath /showvariable FullSemver; + /native/gitversion $repoPath /showvariable FullSemver /nocache else echo $result -fi \ No newline at end of file +fi